Bug Type: Style
Environment
- Vue Version:
3.2.37
- Element Plus Version:
2.3.1
- Browser / OS:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
- Build Tool:
Vue CLI
Reproduction
Related Component
el-cascader
Reproduction Link
Steps to reproduce
let id = 0
var Main = {
data() {
return {
modelValue: [
["ceshi1"],
[1, 2, 5]
],
props: {
multiple: true,
lazy: true,
lazyLoad(node, resolve) {
const { level } = node
setTimeout(() => {
const nodes = Array.from({ length: level + 1 }).map((item) => ({
value: ++id,
label: 选项${id}
,
leaf: level >= 2,
}))
if (level == 0) {
nodes.push({
label: "ceshi1",
value: 'ceshi1',
leaf: true
})
nodes.push({
label: "ceshi2",
value: 'ceshi2',
leaf: true
})
}
console.log("nodes========", nodes)
// 通过调用resolve将子节点数据返回,通知组件数据加载完成
resolve(nodes)
}, 1000)
},
},
}
},
}
;const app = Vue.createApp(Main);
app.use(ElementPlus);
app.mount("#app")
What is Expected?
点击级联框,值对应的选项应是选中状态
What is actually happening?
选项未选中,而且二级以上选项有loading图标,此时选择其它选项时,该选项能选中,以我的例子为例,ceshi1选项已是选中值,此时点击它并未发生任何变化,点击选项1时,默认值对应的选项才显示选中并可操作
Additional comments
(empty)
期望:
实际:
2条答案
按热度按时间nbewdwxp1#
I had the same issue
h4cxqtbf2#
我也遇到同样问题。打包构建后切换分类还会自动收起级联的下拉!