[Vue warn]: Do not use built-in or reserved HTML elements as component id: Switch
See original GitHub issueThe Issue
I get the following warning whilst running the library in my new project, trying to register the components globally (as shown in the readme
:
[Vue warn]: Do not use built-in or reserved HTML elements as component id: Switch
<switch>
element documentation page: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/switch
From the Vue documentation style guide:
Component names should always be multi-word, except for root App components. This prevents conflicts with existing and future HTML elements, since all HTML elements are a single word.
Suggested Change
In order to stay compliant with the style guide, and prevent this from happening in the future, I propose we add a prefix to each of custom elements, and even maybe make the prefix customizable so that, if need be (for backwards compatibility) the prefix can be turned off:
Ex: ui-switch
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:8
Top GitHub Comments
For now, you can remove import of switch component to LibraryModule in coreui-vue/src/index.js (package is in node_modules/@coreui/vue) and then rebuild package (you need config files from github to do this) or remove switch component from LibraryModule in build file.
This component name will be changed in the next version.
Getting the same warning
I think prefixing all elements is a great solution.