fix: remove click event after unmounted (#372)

This commit is contained in:
周小杰 2024-02-21 16:42:56 +08:00 committed by GitHub
parent 7342036646
commit d0ebdefcee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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[]) => {