Vue忽略自定义组件标签 [英] Vue ignore custom component tag

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

问题描述

在我的网站上,我使用的是Google CSE(由google定制的搜索引擎)。



这是我的HTML:

 < div id =应用> 
...
< gcse:search>< / gcse:search>
...
< / div>
< script type =text / javascript>
new Vue({el:'#app'})
< / script>

正如您所看到的,我在我的vue应用程序中放置了一个gcse输入。



因此,我收到警告:


[Vue warn]:未知自定义元素:< gcse:search>


有可能停止尝试在Vue.js中初始化此自定义组件?



在此先感谢。

解决方案

Vue认为您正在尝试加载名为 gcse:search 的Vue组件。

为了忽略这个标签,添加 v-pre 指令

 < gcse:搜索v-pre>< / gcse:search> 






或者,您可以添加 gcse:搜索标记到Vue的 ignoredElements 列表中:

  Vue.config.ignoredElements = ['gcse:search'] 


On my site I am using Google CSE (custom search engine by google).

Here is my HTML:

<div id="app">
  ...
  <gcse:search></gcse:search>
  ...
</div>
<script type="text/javascript">
    new Vue({ el: '#app' })
</script>

As you can see, I have a "gcse input" placed inside of my vue application.

Therefore I am getting a warning:

[Vue warn]: Unknown custom element: <gcse:search>

So my question is how it possible to stop attempting to initialize this custom component in Vue.js?

Thanks in advance.

解决方案

Vue thinks that you are trying to load a Vue component named gcse:search.

In order to ignore this tag, add the v-pre directive:

<gcse:search v-pre></gcse:search>


Or, you could add the gcse:search tag to Vue's list of ignoredElements:

Vue.config.ignoredElements = ['gcse:search']

这篇关于Vue忽略自定义组件标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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