ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
### element ui 表格的checkbox初始化不可勾选 ``` <el-table ref="multipleTable" :data="appList" border tooltip-effect="dark" style="width: 100%;height: 380px;overflow:auto" @selection-change="changeFun"> <el-table-column type="selection" width="55" class="selection" prop='uuid' :selectable='checkboxInit' @selection-change="changeFun"></el-table-column> <el-table-column label=""> <template scope="scope"></template> </el-table-column> <el-table-column prop="username" label="username"></el-table-column> <el-table-column prop="createTime" label="创建时间"></el-table-column> </el-table> ``` 指定这个属性最重要::selectable='checkboxInit' ,来看看是怎么写的: ``` methods: { selectable(row, index) { // 有ID才能选,为空没ID则不能选择 if(row.rockAccountId == "") { // console.log('不可勾选') return false }else { // console.log('可勾选') return true } }, } ```