From 86bbccb7f9c9d66c052408a295cdb00be12ee76d Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 27 Apr 2022 23:04:22 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=A7=80=EB=8F=84=20=EB=A0=8C=EB=8D=94?= =?UTF-8?q?=EB=9F=AC=EC=97=90=EC=84=9C=20tooltip=20width=EA=B0=80=20?= =?UTF-8?q?=EB=8D=9C=20=EB=B3=80=EA=B2=BD=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/components/MapViewer.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hwe/ts/components/MapViewer.vue b/hwe/ts/components/MapViewer.vue index 0866631d..dc8f986a 100644 --- a/hwe/ts/components/MapViewer.vue +++ b/hwe/ts/components/MapViewer.vue @@ -188,7 +188,14 @@ const gameConstStore = unwrap_err( const tooltipDom = ref>(); const map_area = ref>(); const { elementX: cursorX, elementY: cursorY, isOutside } = useMouseInElement(map_area); -const { width: tooltipWidth } = useElementSize(tooltipDom); + +const tooltipWidth = ref(0); +const { width: tooltipCurrWidth } = useElementSize(tooltipDom); +watch(tooltipCurrWidth, (newWidth)=>{ + if(newWidth == 0) return; + tooltipWidth.value = newWidth; +}, {immediate: true}); + const { sourceType: cursorType } = useMouse(); const emit = defineEmits<{ (event: "city-click", city: MapCityParsed, e: MouseEvent | TouchEvent): void;