u
This commit is contained in:
1 parent
603f938e96
commit
869900f7f0
1 file changed
+6
-1
@@ -1,6 +1,6 @@
|
|||||||
import type { VNode } from 'vue'
|
import type { VNode } from 'vue'
|
||||||
import { arrow, offset, useFloating } from '@floating-ui/vue'
|
import { arrow, offset, useFloating } from '@floating-ui/vue'
|
||||||
import { cloneVNode, defineComponent, ref, Teleport, onMounted } from 'vue'
|
import { cloneVNode, defineComponent, onMounted, ref, Teleport ,watch} from 'vue'
|
||||||
|
|
||||||
import { getPrefixCls } from '../_utils/getPrefixCls'
|
import { getPrefixCls } from '../_utils/getPrefixCls'
|
||||||
|
|
||||||
@@ -40,6 +40,11 @@ export default defineComponent({
|
|||||||
console.log('triggerRef 已挂载:', triggerRef.value) // 正确打印
|
console.log('triggerRef 已挂载:', triggerRef.value) // 正确打印
|
||||||
// 可以在此处调用 useFloating 的更新逻辑(如果有需要)
|
// 可以在此处调用 useFloating 的更新逻辑(如果有需要)
|
||||||
})
|
})
|
||||||
|
watch(triggerRef, (newVal) => {
|
||||||
|
if (newVal !== null) {
|
||||||
|
console.log('triggerRef 已挂载:', newVal) // 正确打印 DOM 元素
|
||||||
|
}
|
||||||
|
}, { immediate: true }) // 立即执行一次(可选)
|
||||||
|
|
||||||
// 显示/隐藏/切换浮动层
|
// 显示/隐藏/切换浮动层
|
||||||
const showPopup = () => (visible.value = true)
|
const showPopup = () => (visible.value = true)
|
||||||
|
|||||||
Reference in new issue
Block a user