Nuxt3安装 Tailwindcss

安装

# Using pnpm
pnpm add --save-dev @nuxtjs/tailwindcss

# Using yarn
yarn add --dev @nuxtjs/tailwindcss

# Using npm
npm install --save-dev @nuxtjs/tailwindcss

配置 nuxt.config.ts

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  modules: [
    '@nuxtjs/tailwindcss'
  ]
})

https://nuxt.com/modules/tailwindcss

VsCode安装Tcss 自动提示

安装插件

Tailwind CSS IntelliSense

安装完成添加配置文件(不然不生效)

tailwind.config.js

style=" " 空格一下,可以看到提示

https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss

Tcss有多好用