vue.js - 我正在使用'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()
}
}
});
解决方案
推荐阅读
- r - 如何用R中的字符替换列表中特定列的空单元格
- geopandas - Altair 不渲染 mark_geoshape
- typescript - 如何在 describe 或 it 块中使用 jest.mock?
- grafana - Grafana - InfluxDB 2 - 标签/别名数据
- python - Python:如何阻止用户通过另一个模块调用模块(通过归因)?
- r - 旋转/重塑并创建新列
- python - 仅当第一个值是真值时,才解包元组并将变量分配给第二个值
- javascript - 从完整的 Lodash 模块导入成员是什么意思
- angular - Stryker 初始运行超时
- postgresql - 如何追加到gorm中的字符串数组