当前位置: 首页 > news >正文

tailwindcss学习02

vue中接入tailwindcss

使用cmd不要使用powershell

npm create vite@latest stu02 -- --template vue
cd stu02npm install --registry http://registry.npm.taobao.org
npm install -D tailwindcss@3.4.17 postcss autoprefixer --registry http://registry.npm.taobao.org
npx tailwindcss init -p
# 展示全部配置
# npx tailwindcss init -p -full

修改tailwindcss.config.js

/** @type {import('tailwindcss').Config} */
export default {content: ["./index.html","./src/**/*.{vue,js,ts,jsx,tsx}",],theme: {extend: {},},plugins: [],
}

修改style.css

@tailwind base;
@tailwind components;
@tailwind utilities;

运行项目

npm run dev

修改App.vue

<script setup>
</script><template><h1 class="text-3xl font-bold underline">Hello world!</h1>
</template><style scoped></style>

结果
在这里插入图片描述

参考

https://www.tailwindcss.cn/docs/guides/vite#vue

http://www.lryc.cn/news/538966.html

相关文章:

  • 千峰React:脚手架准备+JSX基础
  • 【算法】快排
  • 开放签电子签章工具版 2.0 正式发布,构建全场景电子签约能力、满足复杂的签章管理场景
  • python和pycharm 和Anaconda的关系
  • DeepSeek V3和R1
  • JavaScript数组-获取数组中的元素
  • SSE:用于流式传输的协议
  • Aseprite详细使用教程(7)——切片工具
  • 航空公司客户价值分析
  • 基于开源Odoo、SKF Phoenix API与IMAX-8数采网关的圆织机设备智慧运维实施方案 ——以某纺织集团圆织机设备管理场景为例
  • LLM 架构
  • Word Embeddings
  • 相机开发调中广角和焦距有什么不一样
  • krpano学习笔记,端口修改,krpano二次开发文档,krpano三维div信息展示,krpano热点显示文字
  • Jenkins 给任务分配 节点(Node)、设置工作空间目录
  • 深入解析iOS视频录制(二):自定义UI的实现
  • 跳表的C语言实现
  • Java Web开发实战与项目——Spring Security与权限管理实现
  • 单元测试方法的使用
  • VScode内接入deepseek包过程(本地部署版包会)
  • flink写入hdfs数据如何保证幂等的?
  • newgrp docker需要每次刷新问题
  • LM_Funny-2-01 递推算法:从数学基础到跨学科应用
  • WDM_OTN_基础知识_波分站点与组网类型
  • 机器视觉--索贝尔滤波
  • 网络分析仪E5071C的回波损耗测量
  • 力扣-二叉树-98 验证二叉搜索树
  • 【动态规划】详解 0-1背包问题
  • 【Java线程池与线程状态】线程池分类与最佳实践
  • 【小白学AI系列】NLP 核心知识点(八)多头自注意力机制