Open ibubbo opened 3 years ago
试下 resolveComponent
@Amour1688 试过,不行
Hello @ibubbo. In order to facilitate location and troubleshooting, we need you to provide a realistic example. Please forking these link codesandbox or provide your GitHub repository.
Hello @ibubbo. In order to facilitate location and troubleshooting, we need you to provide a realistic example. Please forking these link codesandbox or provide your GitHub repository.
import { defineComponent } from "vue";
const B = defineComponent({
setup() {
return () => (<div>BBBBB</div>)
}
});
const A = defineComponent({
setup() {
return () => (<div>AAAAA</div>)
}
})
export default defineComponent({
setup() {
const WHO = Math.random() > 0.5 ? A : B; // 是组件,不是字符串。
return () => (
<div>
<B />
<WHO />
11111
</div>
);
}
});
🧐 Problem Description
在使用了
unplugin-vue-components
按需加载了 antd ui 组件库,我想写一个动态表单,但是渲染之后,就是我传入的值,而不是解析了那个组件。💻 Sample code
没有如期解析成 input。