Subscribe on changes!

The andt component in the custom component cannot be parsed using the h function

avatar
Jun 13th 2022

Vue version

3.2.37

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-46elve?file=src%2Fcomponents%2FHelloWorld.vue

Steps to reproduce

Create the child vNode using h function and render it using render function

What is expected?

The function h creates the child component vNode, and the antD component in the child component can be parsed using the render function

What is actually happening?

The antD component in the child vnode is not parsed after the render function is used to create the child vnode

System Info

No response

Any additional comments?

No response

avatar
Jun 13th 2022

Can't look at the repro right now, but I suspect you are missing resolveComponent():

h(resolveComponent('component-name'))
avatar
Jun 14th 2022

Can't look at the repro right now, but I suspect you are missing resolveComponent():

h(resolveComponent('component-name'))

thanks for youer reply ,i use resolveComponent in example,but it stiil not work, Why does this happen? the example site: https://stackblitz.com/edit/vitejs-vite-46elve?file=src%2FApp.vue

avatar
Jun 21st 2022
import HelloWorld from './components/HelloWorld.vue';

import { render, h, onMounted, resolveComponent } from 'vue';

onMounted(() => {
- const vnode = h(resolveComponent('HelloWorld'));
+ const vnode = h(HelloWorld);
  render(vnode, document.getElementById('wrapper'));
});