// 代码参考:https://segmentfault.com/q/1010000009672767
mounted : function () {
var that = this;
var sortable1 = new Sortable(document.querySelector('#topicNumBox'), {
sort: true,
animation: 300,
onEnd: function (evt) { //拖拽结束发生该事件
that.questionData.splice(evt.newIndex, 0, that.questionData.splice(evt.oldIndex, 1)[0]);
var newArray = that.questionData.slice(0);
that.questionData = [];
that.$nextTick(function () {
that.questionData = newArray;
});
},
});
}
复制代码
sortable.js——Vue 数据更新了但视频没有更新的问题
最新推荐文章于 2024-05-17 13:52:13 发布