element-ui table表头部使用checkbox状态不回显
文章目录
header中即使不使用scope,也要把插槽加上(slot-scope="scope"),否则change之后无法回显表头中checkbox的勾选状态!!!!!
<el-table-column prop="ischecked" >
<template slot="header" slot-scope="scope">
<el-checkbox
v-model="istableallsearch"
@change="tableAllchecked">{{istableallsearch}}</el-checkbox>
</template>
<template slot-scope="scope">
<el-checkbox
:disabled="scope.row.disabled"
v-model="scope.row.ischecked"
@change="checkSingle"></el-checkbox>
</template>
</el-table-column>我找了一个小时BUG,真想反手给自己一巴掌/苦涩
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论