watch: {
‘deptModel.depts‘: {
handler(newVal, oldVal) {
if (oldVal.length == 4 && newVal.length == 5) {
this.deptModel.depts = oldVal
this.$message.warning(‘最多选择4个科室‘)
}
}
}
}
原文:https://www.cnblogs.com/leslie1943/p/13359584.html