首页 > 解决方案 > 我正在使用'sortablejs'库是否可以选择动态元素,其值在点击事件时发生变化

问题描述

这是我的代码,'el' 不能包含复选框列表的 id。我希望当 onEnd 事件触发时我可以检查我的复选框值是否为真。如果复选框值为真,则元素可以删除,否则不会。

import Sortable, { MultiDrag, Swap } from 'sortablejs'
Sortable.create(el, {
      group: 'shared',
      sort: true,
      multiDrag: true, // Enable the plugin
      selectedClass: "drag", // Class name for selected item
      animation: 150,
      draggable: ".drag",
      onEnd: function(evt) {
        console.log('evet', evt)
        if (parseInt(evt.originalEvent.screenX) > parseInt(vm.dropZoneThreshold)) {
          vm.remove()
        }
      }
    });

标签: vue.jsquasarsortablejs

解决方案


推荐阅读