如何防止 Vue 解释自定义标签? [英] How to prevent Vue to interpreted custom tags?

查看:32
本文介绍了如何防止 Vue 解释自定义标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 Vue 应用程序.但是我需要向它添加一些来自另一个 JS 框架的自定义标签.如何防止Vue尝试解释它?

I have got Vue App. But I need to to add to it some custom tags, that come from another JS framework. How to prevent Vue to try to interpreted it?

<slider floor="100" ceiling="1000" step="1" ></slider>

现在出现错误:未知的自定义元素:- 您是否正确注册了组件?

推荐答案

如果您使用的是 Vue 2.0 版

If you are using Vue Version 2.0

您可以使用配置的忽略元素

You can use config's ignoredElements

Vue.config.ignoredElements = ['slider']

它已经在 Vue 2.0 中实现,并将在 Vue 1.1 中实现

It is already implemented in Vue 2.0, and will be implemented in Vue 1.1

资源:vuejs 问题 3090:忽略一些自定义 HTML 组件

这篇关于如何防止 Vue 解释自定义标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆