ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.13k stars 14.64k forks source link

[bug report] when the cascade selector lazy loads the radio selection, the checkstrictly mode is selected. When the child node has not been loaded, select the node, and no data will pop up () #21329

Open yituomao opened 3 years ago

yituomao commented 3 years ago

Element UI version

2.15.6

OS/Browsers version

chrome 91.0.4472.124

Vue version

2.6.14

Reproduction Link

项目要登录,单独弄个链接太麻烦,直接看问题吧

Steps to reproduce

代码大概这样,多级单选不关联,选中父节点没有触发lazyLoad,导致弹出暂无数据的子选项框,需要点击父节点条目才会加载子节点 <el-cascader :props="props" placeholder="选择地区" ref="sele" @change="getSchool" v-model="areaList" clearable>

props: { lazy: true, checkStrictly: true,

                lazyLoad(node, resolve) {
                    console.log(node)

                //异步方法,省略}

}

What is Expected?

单选选中条目会触发lazyLoad加载子节点数据

What is actually happening?

单选选中没有调用lazyLoad,导致子节点没有数据,但还是弹出了子节点面板,所以显示暂无数据,只有点击条目才会触发lazyLoad去加载数据

element-bot commented 3 years ago

Translation of this issue:

Element UI version

2.15.6

OS/Browsers version

chrome 91.0.4472.124

Vue version

2.6.14

Reproduction Link

The project needs to log in. It's too troublesome to get a link alone. Look at the problem directly

Steps to reproduce

The code is like this. Multi level radio selection is not associated. Selecting the parent node does not trigger lazyload, resulting in the pop-up of the child option box with no data. You need to click the parent node entry to load the child node

< El cascade: props = \"props\" placeholder = \"select region\" ref = \"sell\" @ change = \"getschool\" V-model = \"arealist\" clear > < / El cascade > props: {

lazy: true, checkStrictly: true,

lazyLoad(node, resolve) { console.log(node)

//Asynchronous method, omitting} }

What is Expected?

Selecting an entry by radio will trigger lazyload to load child node data

What is actually happening?

If lazyload is not called, the child node has no data, but the child node panel pops up, so there is no data. Only clicking the entry will trigger lazyload to load data

yituomao commented 3 years ago

image image 直接单选和直接点击的效果

JarvisMarkDown commented 1 year ago

遇到了同样的问题 有解决方法吗

JarvisMarkDown commented 1 year ago

终于找到解决办法了 在change方法里通过获取选中的dom元素 触发dom元素的click事件 就可以了 里面需要判断下是第几级级联

XiaolinQian commented 6 days ago

终于找到解决办法了 在change方法里通过获取选中的dom元素 触发dom元素的click事件 就可以了 里面需要判断下是第几级级联

大佬,能贴下代码么