1

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,真想反手给自己一巴掌/苦涩


charlotteeeeeee
74 声望7 粉丝