mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(editor): 右键菜单消失子菜单可能不会跟着消失
This commit is contained in:
parent
a22e59e2bd
commit
1ce6411e05
@ -145,12 +145,16 @@ const show = (e?: MouseEvent) => {
|
||||
|
||||
const showSubMenu = (item: MenuButton | MenuComponent, index: number) => {
|
||||
const menuItem = item as MenuButton;
|
||||
if (typeof item !== 'object' || !menuItem.items?.length) {
|
||||
if (typeof item !== 'object') {
|
||||
return;
|
||||
}
|
||||
|
||||
subMenuData.value = menuItem.items || [];
|
||||
setTimeout(() => {
|
||||
if (!visible.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (menu.value) {
|
||||
// 将子菜单放置在按钮右侧,与按钮齐平
|
||||
let y = menu.value.offsetTop;
|
||||
|
Loading…
x
Reference in New Issue
Block a user