typescript vue3 VueDraggable 报错 Uncaught TypeError: Cannot read properties of null (reading 'element')
Uncaught TypeError: Cannot read properties of null (reading 'element')
nnot read properties of null (reading 'index')
错误写法
就是说子组件需要用div包着,你用其他东西,他无法添加key,然后就会报错。
<template #item="{element}">
<Todo :detail="element"></Todo>
</template>
问题
要用div包住自己的子组件
<template #item="{element}">
<div>
<Todo :detail="element"></Todo>
</div>
</template>