fix(widgets): isolate autocomplete text cleanup

This commit is contained in:
Will Miao
2026-04-23 20:07:11 +08:00
parent c6e5467907
commit b31fae4e51
5 changed files with 92 additions and 20 deletions

View File

@@ -0,0 +1,15 @@
import type { App as VueApp } from 'vue'
export function createVueWidgetCleanup(vueApp: VueApp, onCleanup?: () => void) {
let didUnmount = false
return () => {
if (didUnmount) {
return
}
vueApp.unmount()
didUnmount = true
onCleanup?.()
}
}