element-plus: [Bug Report] Cascader `lazyLoad` triggers on every re-render
Element Plus version
1.0.2-beta.51
OS/Browsers version
Windows 10 Chrome v91
Vue version
3.1.2
Reproduction Link
https://github.com/wenfangdu/cascader-lazy-load-repro
Steps to reproduce
Please use the repro link.
What is Expected?
props are checked by content, e.g. using lodash’s isEqual, if it indeed changed, then run lazyLoad.
What is actually happening?
lazyLoad triggers on every re-rerender.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 26 (16 by maintainers)
Commits related to this issue
- fix(cascader-panel): should not re-init when props's value not change fix #2317 #1871 — committed to element-plus/element-plus by SimonaliaChen 3 years ago
- fix(cascader-panel): should not re-init when props's value not change (#2344) * fix(cascader-panel): should not re-init when props's value not change fix #2317 #1871 * style: extra space — committed to element-plus/element-plus by SimonaliaChen 3 years ago
Could you give me more insights about the work you are doing right now? I’d like to provide as many help as I can to help you out of this issue. If you do feel like you can share that with me please do not hesitate to ping me.
Done. I will revert https://github.com/element-plus/element-plus/pull/2298 and submit another pr ASAP
@SimonaliaChen You can use
isEqualWithinstead, in this case:Same goes to the object literal. In your code
If you do this: