From 01e29bc4926f133634bf963fde4f595b3a094380 Mon Sep 17 00:00:00 2001 From: lwj <674416404@qq.com> Date: Wed, 20 May 2026 21:07:02 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20Nuxt=20?= =?UTF-8?q?=E5=92=8C=20Next.js=20=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 ++- package.json | 7 +- src/index.ts | 70 ++++++++++++-- src/templates.ts | 22 ++++- templates/react-next/.stackblitzrc | 4 + templates/react-next/_gitignore | 4 + templates/react-next/app/globals.css | 117 +++++++++++++++++++++++ templates/react-next/app/layout.tsx | 11 +++ templates/react-next/app/page.tsx | 61 ++++++++++++ templates/react-next/next-env.d.ts | 4 + templates/react-next/next.config.ts | 7 ++ templates/react-next/package.json | 25 +++++ templates/react-next/pnpm-workspace.yaml | 4 + templates/react-next/tsconfig.json | 34 +++++++ templates/vue-nuxt/.stackblitzrc | 4 + templates/vue-nuxt/_gitignore | 5 + templates/vue-nuxt/app/app.vue | 3 + templates/vue-nuxt/app/assets/style.css | 107 +++++++++++++++++++++ templates/vue-nuxt/app/pages/index.vue | 54 +++++++++++ templates/vue-nuxt/nuxt.config.ts | 11 +++ templates/vue-nuxt/package.json | 26 +++++ templates/vue-nuxt/pnpm-workspace.yaml | 5 + templates/vue-nuxt/tsconfig.json | 17 ++++ 23 files changed, 598 insertions(+), 16 deletions(-) create mode 100644 templates/react-next/.stackblitzrc create mode 100644 templates/react-next/_gitignore create mode 100644 templates/react-next/app/globals.css create mode 100644 templates/react-next/app/layout.tsx create mode 100644 templates/react-next/app/page.tsx create mode 100644 templates/react-next/next-env.d.ts create mode 100644 templates/react-next/next.config.ts create mode 100644 templates/react-next/package.json create mode 100644 templates/react-next/pnpm-workspace.yaml create mode 100644 templates/react-next/tsconfig.json create mode 100644 templates/vue-nuxt/.stackblitzrc create mode 100644 templates/vue-nuxt/_gitignore create mode 100644 templates/vue-nuxt/app/app.vue create mode 100644 templates/vue-nuxt/app/assets/style.css create mode 100644 templates/vue-nuxt/app/pages/index.vue create mode 100644 templates/vue-nuxt/nuxt.config.ts create mode 100644 templates/vue-nuxt/package.json create mode 100644 templates/vue-nuxt/pnpm-workspace.yaml create mode 100644 templates/vue-nuxt/tsconfig.json diff --git a/README.md b/README.md index e070bde..60796d0 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,14 @@ ## Templates -当前已支持 36 个 TypeScript 模板: +当前已支持 38 个 TypeScript 模板: ### Vue SFC - `vue-vite` - `vue-rsbuild` - `vue-vike` +- `vue-nuxt` - `vue-vite-on-demand` - `vue-vike-on-demand` - `vue-rsbuild-on-demand` @@ -56,6 +57,7 @@ - `react-vite` - `react-rsbuild` - `react-vike` +- `react-next` - `mobile-react-vite` - `mobile-react-rsbuild` - `mobile-react-vike` @@ -76,10 +78,12 @@ pnpm create tdesign my-app ```bash pnpm create tdesign my-app --template vue-vite pnpm create tdesign my-app --template vue-vike +pnpm create tdesign my-app --template vue-nuxt pnpm create tdesign my-app --template vue-tsx-rsbuild pnpm create tdesign my-app --template vue-vite-on-demand pnpm create tdesign my-app --template react-chat-rsbuild pnpm create tdesign my-app --template react-vike +pnpm create tdesign my-app --template react-next ``` 按 UI 和打包工具组合指定: @@ -88,6 +92,8 @@ pnpm create tdesign my-app --template react-vike pnpm create tdesign my-app --ui vue --bundler vite pnpm create tdesign my-app --ui react --bundler rsbuild pnpm create tdesign my-app --ui react --bundler vike +pnpm create tdesign my-app --ui vue --bundler nuxt +pnpm create tdesign my-app --ui react --bundler next pnpm create tdesign my-app --ui vue --bundler vite --import-mode on-demand ``` @@ -115,8 +121,10 @@ pnpm create tdesign my-app --template react-chat-rsbuild --pm bun ## Notes - `chat` 模板默认提供一个可运行的聊天前端壳子,真实模型接口需要你在模板页面文件里补充 `chatServiceConfig`。 -- Vue / Mobile Vue / Vue Chat 的 SFC 模板支持 `Full` 和 `On-demand` 两种引入模式。 +- Vue / Mobile Vue / Vue Chat 的 SFC 模板支持 `Full` 和 `On-demand` 两种引入模式,Nuxt 模板通过 `@tdesign-vue-next/nuxt` 默认使用按需引入。 - TSX 模板不支持 `--import-mode on-demand`,`unplugin-vue-components` 仅对 SFC `