递归vue可拖动列表仅在父对象被编辑后才更新

问题描述

经过几天的测试,我无法弄清楚为什么出现此问题。我有一个draggable组件(来自Vue.Draggable),其中包含一个组件列表,其中一些也是draggrable组件(有点嵌套)。

问题在于,当我在嵌套的draggable列表中拖动某些内容时,它不会显示任何内容,而我不会在父列表中拖动其他内容。当然,顶级父级不会显示任何内容,因为没有其他父级可以更新。

<template>
  <draggable
    class="h-100"
    :group="{ name: 'conditions',put: true }"
    :list="conditions"
    :sort="false"
    handle=".drag"
    @change="onUpdate"
  >
    <component
      v-for="(condition,index) in conditions"
      :key="index"
      :is="condition.conditionType"
      v-bind.sync="conditions[index]"
    />
  </draggable>
</template>
import Vue from 'vue'
import draggable from 'vuedraggable'

export default Vue.extend({
  name: 'local-draggable',components: {
    draggable,...someComponents
  },...
})

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)