sortable.js——Vue 数据更新了但视频没有更新的问题

// 代码参考: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 数据更新问题_weixin_33712881的博客-CSDN博客

猜你喜欢

转载自blog.csdn.net/liaoxianhua888/article/details/127324761
今日推荐