<div class="block">
<span class="demonstration">默认显示所有Tag</span>
<el-cascader
v-model="Echo"
:options="options"
:props="props"
clearable></el-cascader>
</div>
<script>
export default {
data() {
return {
props: { multiple: true },
options: [{
value: 1,
label: '东南',
children: [{
value: 2,
label: '上海',
children: [
{ value: 3, label: '普陀' },
{ value: 4, label: '黄埔' },
{ value: 5, label: '徐汇' }
]
}, {
value: 7,
label: '江苏',
children: [
{ value: 8, label: '南京' },
{ value: 9, label: '苏州' },
{ value: 10, label: '无锡' }
]
}]
}
}
};
// 回显
this.Echo=[[1,2,3],[1,7,8]] // [东南,上海,普陀] [东南,江苏,南京]
// 清空
this.Echo = [];
</script>
element Cascader 级联选择器 回显以及清空
最新推荐文章于 2024-06-04 08:06:17 发布