点击“全选”之前:
image.png点击“全选”之后:
image.pngimage.pnghtml内:(框内为关键代码,在
el-option
数组上面加一个全选
的选项)
data中定义:
data(){
return{
AllRangeDictCodeList: [],
selectedDeptList: [],
}
}
watch监听:
watch: {
selectedDeptList: {
handler: function(value) {
if (value.includes('000')) {
this.$set(this, 'selectedDeptList', this.AllRangeDictCodeList)
}
},
deep: true
},
}
网友评论