-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slots with modifiers #1241
Comments
That’s a parser level change - making it work is essentially adding a special case to the parsing rules. Ideally we should avoid that. Is it difficult to switch to different slot names? |
Ah I see the AST is completely different now, vue-template-compiler parses v-slot to scopedSlots instead of keeping the template element.
It's used for arbitrary property lookup on objects, so It looks like vue-template-compiler can do |
Vuetify does this on their table component in combination with dynamic slot names. https://vuetifyjs.com/en/components/data-tables/#api var items = [
{
firstname: 'foo',
lastname: 'bar',
},
]; <v-data-table :items="items">
<!-- this slot only applies to the firstname column. -->
<template v-slot:item.firstname="{item}">
</template>
</v-data-table> The point is to differentiate the dynamic parts of the slot name from the static one. |
IMO in Vue templates there’s a unified syntax of |
Version
3.0.0-beta.14
Reproduction link
https://vue-next-template-explorer.netlify.app/...
Steps to reproduce
Use v-slot with a dot in the name
What is expected?
It should be compiled to a slot
'item.name'
What is actually happening?
It's compiled to
'item'
, the "modifier" is ignoredvuejs/eslint-plugin-vue#1165
This works in Vue 2, it was originally
slot="item.name"
. We use this to create slots for arbitrary properties on objects.The text was updated successfully, but these errors were encountered: