Vue ignore custom component tag

后端 未结 2 1575
闹比i
闹比i 2021-01-01 17:19

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

Here is my HTML:

...
相关标签:
2条回答
  • 2021-01-01 17:42

    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']
    
    0 讨论(0)
  • 2021-01-01 18:02

    In addition to the answer of thanksd, you can ignore the unknown tags by adding these tags in the ignoredElements property:

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

    And you can also ignore these tags by using regex instead of using strings:

    Vue.config.ignoredElements = [/gcse:*/]
    

    This is very useful if you want to ignore more tags/components with a specific pattern. In this case, you could ignore all tags starting with "gcse"

    0 讨论(0)
提交回复
热议问题