<draggable
v-model="imageList"
:options="options"
filter=".undraggable"
@update="dataragEnd"
@change="change"
@start="start"
@end="end"
>
<!-- <transition-group> -->
<block v-for="item in imageList" class="imgList" :key="item.url">
<view class="uni-uploader__file">
<image
class="uni-uploader__img"
:src="item.url"
:data-src="item.url"
@touchstart="gtouchstart(item, $event)"
@touchmove="gtouchmove(item, $event)"
@touchend="gtouchend(item, $event)"
@tap="previewImage(item)"
></image>
</view>
</block>
</draggable>
data() {
return {
options: {
delayOnTouchOnly: true, //开启触摸延时
// direction: 'vertical', //拖动方向
delay: 500, //延时时长
touchStartThreshold: 3, //防止某些手机过于敏感(3~5 效果最好)
chosenClass: "chosen", //选中之后拖拽项添加的class名(用于选中时候添加样式)
scroll: false
},
}
}
拖动的时候报错 Cannot read property 'id' of null",start,end函数没生效
@start="start"
@end="end"
这两个方法删除就没有报错了。请问什么原因?
chunk-vendors.js:35055 [Vue warn]: Error in v-on handler: "TypeError: Cannot read property 'id' of null"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…