【问题标题】:how to clone the blocks while drag and drop using vue js?如何在使用 vue js 拖放时克隆块?
【发布时间】:2017-10-27 04:52:05
【问题描述】:

我是 Vue.js 的新手。我正在使用 Vue js 制作待办事项列表。在这里,我使用 拖放 概念将块从一个 div 移动到另一个 div。问题是我不知道如何克隆父元素中的块。这是代码https://codepen.io/supraniti/pen/zogjGW?editors=1010

对于克隆,“LMDD”使用lmdd-clonnerlmdd-dispatcher 类来克隆可拖动块。这是引用克隆详细信息的链接。 https://supraniti.github.io/Lean-Mean-Drag-and-Drop/

谁能帮我克隆块?

【问题讨论】:

    标签: drag-and-drop vue.js


    【解决方案1】:

    要克隆,只需从原始数组中复制元素而不是删除它:

        newContainer.splice(newIndex, 0, oldContainer[oldIndex]);
    

    【讨论】:

      猜你喜欢
      • 2018-03-04
      • 2011-10-18
      • 2023-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-07
      相关资源
      最近更新 更多