集成 tailwind css

This commit is contained in:
徐永兴 2023-03-07 14:56:57 +08:00
parent a1ea37ae21
commit 8bd6f0706f

View File

@ -45,3 +45,29 @@ yarn global add @vue/cli
```bash
vue create hello-world
```
### 安装 TailWind CSS
```bash
# 安装依赖
yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest
# 生成配置文件
npx tailwindcss init -p
# 修改配置文件 tailwind.config.js
module.exports = {
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
theme: {
extend: {},
},
plugins: [],
}
# 创建 index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
# main.js 引入 index.css
```