关于element-ui:elementui-table表头部使用checkbox状态不回显

12次阅读

共计 452 个字符,预计需要花费 2 分钟才能阅读完成。

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,真想反手给本人一巴掌 / 香甜

正文完
 0