Cascader 级联选择器 中 多选选择任意一级选项 v-model 绑定数据后无法回显子节点,只能回显第一个节点**
zu0ti5jz1#
希望能提供在线demo,才能帮你分析问题。
jecbmhm32#
<el-cascader v-model="selected" :options="permissions" :props="{ multiple: true, checkStrictly: true}" ></el-cascader>data(){ selected:["1","1-1"], permissions :[ { value: '1', label: '计算机学院', children: [ { value: "1-1", label: "17级" }, ], }, { value:'2', label:'陶瓷学院', children:[ { value:"2-1", label:"17级" } ] }]; }
<el-cascader
v-model="selected"
:options="permissions"
:props="{ multiple: true, checkStrictly: true}"
></el-cascader>
data(){
selected:["1","1-1"],
permissions :[
{
value: '1',
label: '计算机学院',
children: [
value: "1-1",
label: "17级"
},
],
value:'2',
label:'陶瓷学院',
children:[
value:"2-1",
label:"17级"
}
]
];
回显示只显示第一级,下一级的选不上默认只选中 计算机学院
lb3vh1jj3#
唔,是你的数据有问题,正确是:
data() { return { selected: [ ['1'], //计算机学院 ['1', '1-1'] //计算机学院/17级 ] }}
data() {
return {
selected: [
['1'], //计算机学院
['1', '1-1'] //计算机学院/17级
l2osamch4#
可以了,非常感谢
qyzbxkaa5#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
5条答案
按热度按时间zu0ti5jz1#
希望能提供在线demo,才能帮你分析问题。
jecbmhm32#
回显示只显示第一级,下一级的选不上
默认只选中 计算机学院
lb3vh1jj3#
唔,是你的数据有问题,正确是:
l2osamch4#
可以了,非常感谢
qyzbxkaa5#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.