vue3-grid-layout icon indicating copy to clipboard operation
vue3-grid-layout copied to clipboard

需要在两个GridLayout之间移动GridItem,请问有什么解决办法?

Open touchrank-dev opened this issue 11 months ago • 3 comments

尝试过在GridItem移动事件中,删除源GridLayout中的layout数组中的item,再插入到目标GridLayout的layout数组中,但这样会引发handleDrag中的异常:

  if (!mouseInGrid) {
    let draggingIndex = layoutData.value[0].findIndex(ele => ele.i === itemId)
    let removed = layoutData.value[0].splice(draggingIndex, 1)
    console.log(layoutData.value[0], removed)
  }

大概可以模仿drag-from-outside例子,但先要解决拖少源GridItem时从源数组上删除该项引发异常?

touchrank-dev avatar Mar 16 '24 02:03 touchrank-dev