The problems encountered when using vuedraggable to drag components in vue3 are recorded as follows:
1. There is no problem using the drag and drop plug-in in the template according to the official website, as follows:
Item is a named slot
<draggable v-model="myArray" item-key="id"> <template #item="{element}"> <div> {{element.name}} </div> </template> </draggable>
2. When using drag plug-in in JSX, an error is reported: draggable element must have an item slot
Note that the item slot is written as follows:
const slots = { item: ({element, index}) => { return <div> {{element.name}} </div> } } render(h) { return <draggable v-model="myArray" item-key="id" v-slots={ slots }></draggable> }
Similar Posts:
- [Solved] Operator overload must take either zero or one argument error
- How to Solve Error: Cannot read property ‘map’ of undefined
- Each child in an array or iterator should have a unique “key” prop. Check the render method of `Tabl
- Warning: Each child in an array or iterator should have a unique “key” prop. Check the render method
- Error message of element and Vue framework
- Component is missing template or render function [How to Solve]
- Error resolving template [index], template might not exist or might not be accessible by any of the configured Template Resolvers
- Error parsing XML: junk after document element [How to Solve]
- Iview Error: [Vue warn]: Error in render: “TypeError: ctx.injections.tableRoot.$scopedSlots[ctx.props.column.slot] is not a function”
- Python scrapy/ ERROR: Spider must return request, item, or None, got ‘Tag ‘insettlement program