在Safari中,可排序的表格不能拖动所有列。

问题描述 投票:0回答:1

我有一个 VUE引导表 使用v-slot的每个单元格都使用自定义模板。所有这些单元格都是一个自定义组件。我希望这个表格的行是可以排序的,也就是说,我希望用户能够在这个表格中拖放行。可排序的JS. 一切工作正常。但我在safari中拖动表格中的任何一行时,都会出现UI变形。

正常的表格。Normal table

当我在safari中拖动第一行时,我注意到最后一列的UI不像是被拖动的。dragging in safari

注意到最后一列的UI看起来不像是被拖动的行。

这是table的代码。

<template>
  <b-table
    v-sortable="sortableOptions"
    :items="getSortedForms"
    :fields="columns"
    :tbody-tr-class="rowClass"
    primary-key="key"
    show-empty
  >
    <template v-slot:empty>
      <!-- some content here -->
    </template>

    <template v-if="getSortedForms.length > 0" v-slot:head(selectFormAction)>
      <!-- check-box HTML here -->
    </template>
    <template v-slot:cell(col1)="form">
      <div :id="form.value.Key">
        <!-- check-box HTML here -->
      </div>
    </template>
    <template v-slot:cell(col2)="formItem">
      <!-- this is a custom component -->
      <form-display :formDTO="formItem.value" />
    </template>
    <template v-slot:cell(col3)="formStatusItem">
        <!-- some text here -->
      </div>
    </template>
    <template v-slot:cell(col4)="actionItem">
      <div>
        <!-- this is a custom component -->
        <form-progress-bar />
      </div>
    </template>
    <template v-slot:cell(col5)="utilityItem">
      <div class="utilitySet">
        <div
          v-for="(utility, id) in getSomeList()"
          :key="id"
        >
          <FormUtility :form="utilityItem.value.formDTO"></FormUtility>
        </div>     
      </div>
    </template>
  </b-table>
</template>

<script>
import { BTable } from "bootstrap-vue";
export default {
  name: "FormsList",
  directives: {
    sortable: {
      bind(el, binding, vnode) {
        const table = el;       
        Sortable.create(table.querySelector("tbody"), {});
      },
    },
  },
  components: {
    BTable,
  },
  data() {
    ...
  },
  computed: {
    ...
  },
  methods: {
    ...
  }
};
vue.js bootstrap-vue bootstrap-table sortablejs
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.