How to prevent Vue to interpreted custom tags?

2019-04-12 21:58发布

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>

Now I am getting error: Unknown custom element: <slider> - did you register the component correctly?

标签: vue.js
2条回答
一夜七次
2楼-- · 2019-04-12 22:51

This is a warning, not an error, so you should have no issues with it. You can use Vue.config.silent = true to hide all of the warnings. Also I think it would be hidden if you set Vue.config.debug = false. So it is really just a logged warning during development but shouldn't affect production.

查看更多
3楼-- · 2019-04-12 22:53

If you are using Vue Version 2.0

You can use config's ignoredElements

Vue.config.ignoredElements = ['slider']

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

resource: vuejs issues 3090: Ignore some custom HTML components

查看更多
登录 后发表回答