tailwindcss类在 /user /1之类的路线中不起作用

发布于 2025-02-11 07:39:07 字数 194 浏览 1 评论 0原文

当我提供 /home之类的路线时,我已经配置了tailwind CSS及其正常工作 <路由路径='/home'元素= {}> <路由路径='/of of'element = {}>

但是当我制作 /用户 /1之类的路线时 <路由路径='/user/1'元素= {}>
然后在同一项目中无法在该路线组件中工作的尾风类

i have configure tailwind css and its properly working when i give routes like /home ,/about
<Route path='/home' element={}>
<Route path='/about' element={}>

but when i make routes like /user/1
<Route path='/user/1' element={}>
then tailwind classes not working in that Route component in same project

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆蝶 2025-02-18 07:39:07

如逆风文档中清楚地提到的那样。 ./ src/**/*。{js,jsx,ts,tsx}路径可用于尾风,因此请尝试查看是否匹配路径是否匹配

tailwind.config.js file

module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

如果不是根据要求编辑。

As clearly mentioned in tailwind docs. ./src/**/*.{js,jsx,ts,tsx} path is available for tailwind, so try to see whether you path matches

tailwind.config.js file

module.exports = {
  content: [
    "./src/**/*.{js,jsx,ts,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
}

If not edit as per requirement.

满身野味 2025-02-18 07:39:07

如果您正在使用下一个13,并且APP文件夹中没有Layout.tsx,请确保在其他Layout.jsx文件中手动导入Globals.css。例如下面类似结构的结构:

-app
  --(marketing)
    --layout.jsx
    --page.jsx
  --dashboard
    --layout.jsx
    --page.jsx
  --globals.css
  --favicon.ico

If you're using Next 13 and there isn't a layout.tsx in the app folder, then make sure to import globals.css manually in other layout.jsx files. For instance a structure like the one below:

-app
  --(marketing)
    --layout.jsx
    --page.jsx
  --dashboard
    --layout.jsx
    --page.jsx
  --globals.css
  --favicon.ico
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文