fix(components): [tour] floating-ui autoUpdate error (#15972)

This commit is contained in:
赵添 2024-02-27 22:01:51 +08:00 committed by GitHub
parent 33f41f7795
commit 9ef20c6d6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -263,7 +263,11 @@ export const useFloating = (
let cleanup: any
onMounted(() => {
cleanup = autoUpdate(unref(referenceRef)!, unref(contentRef)!, update)
const referenceEl = unref(referenceRef)
const contentEl = unref(contentRef)
if (referenceEl && contentEl) {
cleanup = autoUpdate(referenceEl, contentEl, update)
}
watchEffect(() => {
update()