-
Notifications
You must be signed in to change notification settings - Fork 531
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
item slot must have only one child #165
Comments
I think the comments shouldn't be include. |
same issue |
you have to use the name |
It considers your comment to be part of the div. I had the same issue and deleting the comment fixed it. |
I am using the name (A) Works <draggable
v-model="someArray"
group="someGroup"
@start="drag = true"
@end="drag = false"
item-key="id">
<template #item="{element}">
<v-row>
<v-col>{{ element.id }}</v-col>
<v-col>{{ element.name }}</v-col>
</v-row>
</template>
</draggable> (B) Does not work <draggable
v-model="someArray"
group="someGroup"
@start="drag = true"
@end="drag = false"
item-key="id">
<template #item="{element}">
<!-- some comment -->
<v-row>
<v-col>{{ element.id }}</v-col>
<v-col>{{ element.name }}</v-col>
</v-row>
</template>
</draggable> (C) Also does not work, but in a different way <draggable
v-model="someArray"
group="someGroup"
@start="drag = true"
@end="drag = false"
item-key="id">
<template #item="{element}">
<template>
<!-- some comment -->
<v-row>
<v-col>{{ element.id }}</v-col>
<v-col>{{ element.name }}</v-col>
</v-row>
</template>
</template>
</draggable> (D) Does work, renders just like (A) <draggable
v-model="someArray"
group="someGroup"
@start="drag = true"
@end="drag = false"
item-key="id">
<template #item="{element}">
<div>
<!-- some comment -->
<v-row>
<v-col>{{ element.id }}</v-col>
<v-col>{{ element.name }}</v-col>
</v-row>
</div>
</template>
</draggable> I'm using Vuetify, so |
因为注释也被当成了元素 |
When i put a code comment in the Draggable component slot, it will throw error.
The text was updated successfully, but these errors were encountered: