el-table多選框有時(shí)需要禁用,selectable為true此行數(shù)據(jù)不禁用,為false則本行禁用
判斷是否禁用方法函數(shù):文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-551084.html
<el-table-column type="selection" :selectable="selectable" width="40"></el-table-column>
methods:{
selectable(row, index) {
//unselectableList為需要禁用的數(shù)組,需要禁用的數(shù)組中與本頁(yè)數(shù)據(jù)無(wú)相匹配的數(shù)據(jù)的數(shù)據(jù)返回true(本行不禁用),
//反之返回false(本行禁用)
return this.unselectableList.findIndex(item => item.id == row.id) === -1
}
}
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-551084.html
到了這里,關(guān)于el-table多選框禁用的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!