<el-cascader
v-model="formModelData.address"
:show-all-levels="false"
:collapse-tags="true"
:options="options"
:props="{ multiple: true, checkStrictly: true }"
:size="size"
:clearable="true"
>
</el-cascader>
@Watch('formModelData.address')
private addressWatch(newVal: any, oldVal: any) {
if (newVal.length > 5) {
this.$message({
message: '最多只支持选择5项',
duration: 1500,
type: 'warning'
})
this.$nextTick(() => {
this.formModelData.address= oldVal;
})
}
}