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

z-index层级太低 #93

Open
tenYear2023 opened this issue May 23, 2024 · 2 comments
Open

z-index层级太低 #93

tenYear2023 opened this issue May 23, 2024 · 2 comments

Comments

@tenYear2023
Copy link

我在element-plus的弹窗中使用时,右键菜单被弹窗遮蔽。

@lizhen789
Copy link
Contributor

这玩意不是可以自己设置吗?自己用element-plus的useZIndex的nextZIndex就可以了

@lipengin1975
Copy link

用elementplus的useZIndex().nextZIndex(),代码如下:

import { useZIndex } from 'element-plus';

topoContainer.value?.addEventListener('TopoContextMenu', e => {
const ce: CustomEvent = e as CustomEvent;
ContextMenu.showContextMenu({
x: ce.detail.mousePos.x,
y: ce.detail.mousePos.y,
zIndex: useZIndex().nextZIndex(),
items: [
{
label: '置顶', onClick: () => {
content.toTop(ce.detail.node);
}
},
{
label: '置底', onClick: () => {
content.toBottom(ce.detail.node);
}
}
});

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

3 participants