diff --git a/packages/components/tour/src/helper.ts b/packages/components/tour/src/helper.ts index 53d5f1aefb..aa80bbeee7 100644 --- a/packages/components/tour/src/helper.ts +++ b/packages/components/tour/src/helper.ts @@ -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()