🐛 菜单没有就不弹出

This commit is contained in:
Vanessa 2022-10-07 11:56:04 +08:00
parent 05f43779c6
commit f8c1f60fd4

View file

@ -86,6 +86,9 @@ export class Menu {
} }
public popup(options: { x: number, y: number, h?: number }, isLeft = false) { public popup(options: { x: number, y: number, h?: number }, isLeft = false) {
if (this.element.innerHTML === "") {
return;
}
if (isMobile()) { if (isMobile()) {
window.addEventListener("touchmove", this.preventDefault, {passive: false}); window.addEventListener("touchmove", this.preventDefault, {passive: false});
} else { } else {