Vuedraggable:如何一次将多个项目拖动

发布于 01-17 08:15 字数 635 浏览 6 评论 0原文

我想同时在表格列中上下拖动多个 。使用 拖动各个行相当简单,但是我正在寻找一种将前一行与所选行分组并将它们移动在一起的方法同时保持以后单独拖动每一行的能力。

我正在使用 Vue 2 和 vuedraggable v2.24.3。

表格如下。

<table>
  <thead>
    <tr>
      <th>...</th>
      <th>...</th>
      <th>...</th>
      <th>...</th>
    </tr>
  </thead>
  <draggable>
    <vue-component-here
      v-for="(task, i) in tasks"
      :prop="task.id"
      .
      .
      .
    />
  </draggable>
</table>

子组件将为每个任务输出一个

I would like to drag multiple <tr>'s up and down a table column at the same time. It's rather straight forward to drag individual rows using <draggable>, however what I'm looking for is a way to group, say, the previous row with the selected row and move them together while maintaining the ability to drag each row individually later.

I'm using Vue 2 and vuedraggable v2.24.3.

The table is as follows.

<table>
  <thead>
    <tr>
      <th>...</th>
      <th>...</th>
      <th>...</th>
      <th>...</th>
    </tr>
  </thead>
  <draggable>
    <vue-component-here
      v-for="(task, i) in tasks"
      :prop="task.id"
      .
      .
      .
    />
  </draggable>
</table>

The sub-component will output a <tr> for each task.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文