theme: channing-cyan
highlight: arduino-light
场景
- vue3.0
- ivew
- table
需求
要求根据列表数据中某个字段判断,比如状态值,只允许批量删除数据状态为新建的.然后让状态不是新建的编程不可选的方式.
代码 [不可选]
在列表数据获取的时候,进行设置操作 ```js this.$http.get(api.workTicket.list, this.searchParams).then(res => { this.loading = false; if (res && res.total >= 0) { this.total = res.total; this.listData = res.items ? res.items : [];
this.listData.forEach(e => {
if(e.status != 'unstart') {
e._disabled = true
}
})
}
});
```
代码[默认选择]
``` this.$http.get(api.workTicket.list, this.searchParams).then(res => { this.loading = false; if (res && res.total >= 0) { this.total = res.total; this.listData = res.items ? res.items : [];
this.listData.forEach(e => {
if(e.status != 'unstart') {
e._checked = true
}
})
}
});
```