fix: use v-show for frequently toggled canvas overlay components

Amp-Thread-ID: https://ampcode.com/threads/T-019cbb69-3404-726a-8888-182193115b88
This commit is contained in:
bymyself
2026-03-04 16:57:38 -08:00
parent 0f8473db35
commit 48ac559d00
2 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<template>
<div
v-if="tooltipText"
v-show="tooltipText"
ref="tooltipRef"
class="node-tooltip"
:style="{ left, top }"
@@ -34,7 +34,8 @@ const left = ref<string>()
const top = ref<string>()
function hideTooltip() {
return (tooltipText.value = '')
if (!tooltipText.value) return
tooltipText.value = ''
}
async function showTooltip(tooltip: string | null | undefined) {

View File

@@ -1,6 +1,6 @@
<template>
<div
v-if="isVisible"
v-show="isVisible"
class="pointer-events-none absolute z-9999 border border-blue-400 bg-blue-500/20"
:style="rectangleStyle"
/>