We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.11.0
No response
在 main.tsx 添加 import "tdesign-react/es/style/index.css";
main.tsx
import "tdesign-react/es/style/index.css";
在 Dev 模式下样式显示均正常,使用 vite build 构建后发现大部分控件样式丢失。
vite build
如果使用 import "tdesign-react/dist/tdesign.css"; 能够正常发布且样式正常,但打包的 CSS 体积非常大。
import "tdesign-react/dist/tdesign.css";
vite.config.ts
import tailwindcss from "@tailwindcss/vite"; import react from "@vitejs/plugin-react-swc"; import { defineConfig } from "vite"; import { patchCssModules } from "vite-css-modules"; // https://vite.dev/config/ export default defineConfig({ plugins: [patchCssModules(), react(), tailwindcss()] });
根据官方文档 import "tdesign-react/es/style/index.css"; 应该能够正常使用
React 18.2.0
133.0.3065.82
Windows 11 24H2
v22.14.0
The text was updated successfully, but these errors were encountered:
👋 @laolarou726,感谢给 TDesign 提出了 issue。 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。
Sorry, something went wrong.
经过检查发现主要是 Menu 控件的样式丢失了,其他控件的样式看起来都是正常的。 是需要引入额外的 CSS 样式吗?
手动将 tdesign-react/es/style/index.css 中 menu 相关样式拷贝到项目目录中能够解决问题
tdesign-react/es/style/index.css
No branches or pull requests
tdesign-react 版本
v1.11.0
重现链接
No response
重现步骤
在
main.tsx
添加import "tdesign-react/es/style/index.css";
在 Dev 模式下样式显示均正常,使用
vite build
构建后发现大部分控件样式丢失。如果使用
import "tdesign-react/dist/tdesign.css";
能够正常发布且样式正常,但打包的 CSS 体积非常大。vite.config.ts
期望结果
根据官方文档
import "tdesign-react/es/style/index.css";
应该能够正常使用实际结果
No response
框架版本
React 18.2.0
浏览器版本
133.0.3065.82
系统版本
Windows 11 24H2
Node版本
v22.14.0
补充说明
No response
The text was updated successfully, but these errors were encountered: