Skip to content
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

在shadow-root中使用 #100

Open
kankanai opened this issue Mar 22, 2024 · 5 comments
Open

在shadow-root中使用 #100

kankanai opened this issue Mar 22, 2024 · 5 comments

Comments

@kankanai
Copy link

请问如何限制在shadow-root中使用,我在里面打开了drawer,或者是弹框等,全都在外面的最外面层级展示了,就是有没有可能,提供一个参数接收dom节点,表示挂载/父元素?

@lewkamtao
Copy link
Owner

好,很感谢你提出这个建议,我想一下如何实现,谢谢~

@kankanai
Copy link
Author

好,很感谢你提出这个建议,我想一下如何实现,谢谢~

对了,可以参考下这个开源UI的实现
https://primevue.org/dialog/#template
其中有appendTo的参数

@lewkamtao
Copy link
Owner

我发现应该是drawer的z-index优先级太高了,比message高了,我把drawer的z-index降低一些,就好了。

@kankanai
Copy link
Author

我发现应该是drawer的z-index优先级太高了,比message高了,我把drawer的z-index降低一些,就好了。

不不,就是说drawer是直接挂在最外面的body底部了,而不是想要的在shadow-root里面,因为这涉及到样式,我只在shadow-root里定义了drawer里面的子元素的样式,drawer跑到最外面了,shadow-root里面定义的style就不生效了

@lewkamtao
Copy link
Owner

哦哦,方便贴一下代码吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants