监听workType改变,改变表格key的值,使表格重新渲染
<el-table :data="tableData"
ref="attendanceList"
:key="key">
<el-table-column
align="center"
prop="enmployyName"
sortable="custom"
label="员工姓名"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
v-if="!showBatchCheck"
sortable="custom"
align="center"
prop="remark"
label="备注"
fit="true"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
v-if="showBatchCheck"
sortable="custom"
align="center"
prop="workPlace"
label="打卡位置"
fit="true"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
export default {
data(){
return {
tableData:[],
workType:null,
key:1,//用于监听表格,重新渲染
}
}
watch:{
workType(val){
this.key ++;
}
},
methods:{
}
}