Parent component use child component's render function, the components registered within the child component are not working #9868
Unanswered
MirrorHuang
asked this question in
Help/Questions
Replies: 1 comment
-
import CustomComponent from '...'
export default defineComponent({
components: {
// CustomComponent,
},
setup(props, ctx) {
// UpperCase Component Tags are resolved to variables of the same name directly
// instead of being transformed into a resolveComponent('custom-component') call that requires the currentRenderingInstance
const renderCell = ()=><CustomComponent />
// parent component will get this function
store.state.renderCell = renderCell
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In JSX, if custom-component is registered by Child component,and Parent component use Child component's render function to render custom-component. it will report Failed to resolve component: custom-component
Here is the demo code
Vue version: 3.3.4
child
parent
I noticed in the source code that the issue arises because
currentRenderingInstance
points to the parent component when rendering the custom-component; but how should this be resolved?Beta Was this translation helpful? Give feedback.
All reactions