Skip to content

Commit

Permalink
fix(editor): 右键菜单消失子菜单可能不会跟着消失
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed Sep 26, 2023
1 parent a22e59e commit 1ce6411
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/editor/src/components/ContentMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1ce6411

Please sign in to comment.