fix types error of MkContextMenu
This commit is contained in:
parent
909125e519
commit
43aeec32ce
1 changed files with 5 additions and 5 deletions
|
@ -28,7 +28,7 @@ const emit = defineEmits<{
|
|||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
||||
const rootEl = ref<HTMLDivElement>();
|
||||
const rootEl = ref<HTMLDivElement | null>(null);
|
||||
|
||||
const zIndex = ref<number>(os.claimZIndex("high"));
|
||||
|
||||
|
@ -36,8 +36,8 @@ onMounted(() => {
|
|||
let left = props.ev.pageX + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
||||
let top = props.ev.pageY + 1; // 間違って右ダブルクリックした場合に意図せずアイテムがクリックされるのを防ぐため + 1
|
||||
|
||||
const width = rootEl.value.offsetWidth;
|
||||
const height = rootEl.value.offsetHeight;
|
||||
const width = rootEl.value!.offsetWidth;
|
||||
const height = rootEl.value!.offsetHeight;
|
||||
|
||||
if (left + width - window.scrollX > window.innerWidth) {
|
||||
left = window.innerWidth - width + window.scrollX;
|
||||
|
@ -55,8 +55,8 @@ onMounted(() => {
|
|||
left = 0;
|
||||
}
|
||||
|
||||
rootEl.value.style.top = `${top}px`;
|
||||
rootEl.value.style.left = `${left}px`;
|
||||
rootEl.value!.style.top = `${top}px`;
|
||||
rootEl.value!.style.left = `${left}px`;
|
||||
|
||||
document.body.addEventListener("mousedown", onMousedown);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue