tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
16.24k stars 1.68k forks source link

动态渲染 Tabs 组件不生效 #6334

Closed eivmosn closed 2 months ago

eivmosn commented 2 months ago

Describe the bug

使用 component 动态渲染 tabs 组件不生效

Steps to reproduce

可以直接查看最小复现 https://stackblitz.com/edit/vitejs-vite-roe9y8?file=src%2FApp.vue

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-roe9y8?file=src%2FApp.vue

System Info

System:
    OS: macOS 14.3.1
    CPU: (12) arm64 Apple M3 Pro
    Memory: 486.56 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/.local/state/fnm_multishells/78005_1725871713632/bin/node
    npm: 10.2.3 - ~/.local/state/fnm_multishells/78005_1725871713632/bin/npm
    pnpm: 9.9.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 128.0.6613.120
    Safari: 17.3.1
  npmPackages:
    naive-ui: ^2.39.0 => 2.39.0 
    vue: ^3.5.3 => 3.5.3

Used Package Manager

pnpm

Validations

Zheng-Changfu commented 2 months ago

貌似设计时就是不能被二次封装,https://github.com/tusen-ai/naive-ui/blob/main/src/tabs/src/Tabs.tsx#L811

eivmosn commented 2 months ago

貌似设计时就是不能被二次封装,https://github.com/tusen-ai/naive-ui/blob/main/src/tabs/src/Tabs.tsx#L811

使用TSX封装或者h函数又可以了

Zheng-Changfu commented 2 months ago

貌似设计时就是不能被二次封装,https://github.com/tusen-ai/naive-ui/blob/main/src/tabs/src/Tabs.tsx#L811

使用TSX封装或者h函数又可以了

tsx 可以的,不会多一层组件