ReuseTemplate error
hminghe opened this issue · 2 comments
hminghe commented
Describe the bug
ReuseTemplate
is slot
<template>
<Comp >
<!-- ERROR -->
<!-- getCurrentInstance().parent === <Comp /> -->
<ReuseTemplate />
</Comp>
<!-- getCurrentInstance().parent === CurrentComp -->
<ReuseTemplate />
</template>
Reproduction
System Info
G
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- The provided reproduction is a minimal reproducible of the bug.
hminghe commented
我暂时想到的只有, 删除 DefineTemplate
和 ReuseTemplate
两个组件, 只用 createReusableTemplate
定义,createReusableTemplate 时,内部自己维护 TemplateRegistry
antfu commented
Nice catch. I thought .parent
would be the component creating it.
And yeah, I have to remove the default component to fix it for now. I will try to explore other solutions in the mean time