-
-
Notifications
You must be signed in to change notification settings - Fork 9k
Closed as not planned
Description
Vue version
3.5.13
Link to minimal reproduction
Steps to reproduce
const addonLayout = import.meta.glob('@/addon/iot/views/task/*_task.vue') const taskComponent = ref(null) const taskComponentRef = ref(null) const myStrategy: HydrationStrategy = (hydrate, forEachElement) => { // forEachElement 是一个遍历组件未激活的 DOM 中所有根元素的辅助函数, // 因为根元素可能是一个模板片段而非单个元素 forEachElement(el => { console.log(el) }) // 准备好时调用hydrate`
hydrate()
return () => {
console.log('unmount')
}
}
const handleAddTask = (data: any) => {
for (const addonLayoutKey in addonLayout) {
if (addonLayoutKey.indexOf(data.code) !== -1) {
taskComponent.value = markRaw(defineAsyncComponent({
loader: addonLayout[addonLayoutKey],
hydrate: myStrategy
}))
break
}
}
console.log(taskComponent.value)
}
`
What is expected?
组件已经加载出来了但是hydrate却没执行
What is actually happening?
No response
System Info
No responseAny additional comments?
No response
Metadata
Metadata
Assignees
Labels
No labels