我正在尝试将 b-form-checkbox 与 b-table 一起使用。尝试检索选定的模块 ID。
{{ row.index + 1 }}
data: {
fields: [
{ key: 'checkbox', label: '', class: 'd-none d-lg-table-cell' },
{ key: 'num', label: 'Num', class: 'd-none d-lg-table-cell' },
],
selected: []
}
虽然我能够检索选定的模块 ID,但在切换复选框时无法删除它们。如果有人可以提供有关如何跟踪复选框是否被选中(true)或未选中(false)的想法。提前致谢。
methods: {
selection(item) {
if (true)
app.selected.push(item);
else
app.selected = app.selected.map(x => x != item);
}
}, Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号