New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Component] [dialog] dialog zIndex动态修改的情况下无效 #16329
Comments
目前部分组件的zIndex都是初始化后固定的,或许可以考虑将其改为计算属性。 |
我正在准备提一个pr,我先考虑下修改方案 |
可以参考部分组件已经实现的方案 |
// const zIndex = ref(props.zIndex ?? nextZIndex()) ---- 改前
const zIndex = !isUndefined(props.zIndex)
? computed(() => props.zIndex)
: ref(nextZIndex()) 我在公司尝试改成如上,是可以解决问题的,具体pr今天下班回家提一个 |
这个写法是存在问题的,如果初始化zIndex是undefined,你后续怎么变更都是使用nextZIndex返回的值,完全可以用计算属性直接解决,建议参考tour组件中的处理方案。 |
确实是存在问题得 |
OK,感谢,我再修改 |
pr构建报错,zIndex已经是计算属性了,我是否可以吧 |
可不可以这样改: const zIndex = computed(() => props.zIndex ?? nextZIndex()) |
不可以,,会陷入 无限递归中,我一开始就这么改的 |
Bug Type:
Component
Environment
3.4.20
2.6.3
edge win10
Vite
Reproduction
Related Component
el-dialog
Reproduction Link
Element Plus Playground
Steps to reproduce
我现在界面上有多个弹框,每个弹框可以拖动,且当点击弹框的时候,此弹框要处于界面顶端
What is Expected?
处于顶端
What is actually happening?
弹框的zindex修改成功,但是zindex不是相应式的,真是的zindex并未发生改变,导致未处于顶端
Additional comments
(empty)
The text was updated successfully, but these errors were encountered: