fix: remove click event after unmounted

This commit is contained in:
rjzhou3 2024-02-21 15:42:45 +08:00
parent 7342036646
commit d20c22c3e9

View File

@ -120,7 +120,7 @@ limitations under the License. -->
</div>
</template>
<script lang="ts">
import { ref, watch, defineComponent, toRefs } from "vue";
import { ref, watch, defineComponent, toRefs, onUnmounted } from "vue";
import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router";
import type { PropType } from "vue";
@ -282,6 +282,10 @@ limitations under the License. -->
}
}
onUnmounted(() => {
document.body.removeEventListener("click", handleClick, false);
});
watch(
() => (props.data.children || []).map((d: any) => d.expression),
(old: string[], data: string[]) => {