在我按照他们的网站完成了TailWind的安装过程后,我运行了NPM run dev,但设计仍然没有呈现.
我做的步骤:
1:NPM安装-D尾部
2:npx尾风初始化
在那之后,我更改为Tailwind.config以:
/** @type {import('tailwindcss').Config} */
export default {
content: ["./src/**/*.{html,js}"],
theme: {
extend: {},
},
plugins: [],
}
与My index.css文件一起使用:
@tailwind base;
@tailwind components;
@tailwind utilities;
最后是我的App.jsx:
function App() {
const [count, setCount] = useState(0)
return (
<>
<h1 className="text-3xl bg-red-500 font-bold underline">
Hello world!
</h1>
</>
)
}
在做了所有这些之后,它应该可以工作了,但BG-RED-500的 colored颜色 没有显示,这表明tailwind 不起作用.
下面是我的目录如何设置的图像: