V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
jahnsli
V2EX  ›  Vue.js

vue3,如何在 tsx 中使用动态组件

  •  
  •   jahnsli · 2022-11-04 22:10:02 +08:00 · 1617 次点击
    这是一个创建于 536 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Failed to resolve component: component

    <script lang="tsx">
    
    export default defineComponent({
    
     setup(props) {
         return () => (
          <n-form>
            {list.value.map(item => {
              return (
                <n-form-item>
        
                    <component is="*****" ></component>
    
                </n-form-item>
              );
            })}
          </n-form>
        );
    }
    
    })
    </script>
    
    bojackhorseman
        1
    bojackhorseman  
       2022-11-05 08:30:16 +08:00 via iPhone
    从 vue 里引入 Component
    shakukansp
        2
    shakukansp  
       2022-11-05 15:53:26 +08:00
    用 h 啊
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5648 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 75ms · UTC 03:18 · PVG 11:18 · LAX 20:18 · JFK 23:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.