ElemeFE / ElemeFE/element

[bug report] cascade: when the IDs of two adjacent menus in the cascading menu are the same and selected by default, the level returned by the node is repeated, which results in the failure of normal display

Open
#18,557 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Element UI version
2.13.0

### OS/Browsers version
chrome 79.0.3945.88

### Vue version
2.6.10

### Reproduction Link
https://codepen.io/strong_snail/pen/bGNrPBY

### Steps to reproduce
let id = 0; let count = 0; export default { name: 'sd-all-cascader-demo', data() { return { props: { lazy: true, lazyLoad (node, resolve) { const { level } = node; console.log(node); setTimeout(() => { count; const nodes = Array.from({ length: level 1 }) .map(item => ({ value: id, label: `选项${id}`, leaf: count >= 3 })); id = 0; // 通过调用resolve将子节点数据返回,通知组件数据加载完成 resolve(nodes); }, 1000); } }, data: [1,1,2] }; } };

### What is Expected?
{level: 0} => {level: 1} => {level: 2}

### What is actually happening?
{level: 0} => {level: 1} => {level: 1} => {level: 2}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.