Conflicts of custom elements' named slot (defineCustomElement) #6574
Answered
by
LinusBorg
rhzone
asked this question in
Help/Questions
|
Link to minimal reproduction edit/vitejs-vite-sxhlbh?file=src/App.vue custom-element below is a web component This snippets working as expected, but eslint complaint about it
<custom-element>
<span slot="icon">hello, world</span>
</custom-element>Below snippets trigger compiler error
<custom-element>
<template #icon>
<span>hello, world</span>
</template>
</custom-element> |
Answered by
LinusBorg
Sep 2, 2022
Replies: 2 comments 3 replies
3 replies
|
The first way (with a https://vuejs.org/guide/extras/web-components.html#slots So a workaround would be to skip this rule in these instances: <custom-element>
<!-- eslint-disable-next-line vue/no-deprecated-slot-attribute -->
<span slot="icon">hello, world</span>
</custom-element>You can also open an issue in the eslint plugin repo and ask for a fix / feature to skip this rule for custom elements. |
0 replies
Answer selected by
rhzone
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The first way (with a
slot="icon"prop) is the correct way, as documented here:https://vuejs.org/guide/extras/web-components.html#slots
So a workaround would be to skip this rule in these instances:
You can also open an issue in the eslint plugin repo and ask for a fix / feature to skip this rule for custom elements.