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

vite+vue3.0 使用tailwindcss

 参考资料: 安装 - TailwindCSS中文文档 | TailwindCSS中文网

npm install -D tailwindcss

npm install postcss

npm install autoprefixer

npx tailwindcss init -p

 生成/src/tailwind.config.js和/src/postcss.config.js配置文件

在/src/tailwind.config.js配置文件中添加所有模板文件路径

新建/src/resources/tailwind.css文件;在文件中添加:

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

在/src/main.ts中进行引用

import "./resources/tailwind.css";

 在vue文件中使用

<template><div class="h-full"><h1 class="text-3xl font-bold underline">Hello world!</h1><div class="flex"><div class="flex-none h-10 w-[80px] bg-red-400" >11</div><div class="flex-1 h-10 bg-orange-400">22</div><div class="flex-1 h-10 bg-lime-400">33</div></div></div>
</template><script setup lang="ts"></script><style lang="scss" scoped></style>

在VScode编辑器中添加扩展

 

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

相关文章:

  • C++QT---QT-day3
  • 小程序如何搭建在服务器上
  • JavaEE初阶学习:Servlet
  • 黑白二维码不好看,那么快学习改色的方法吧
  • coreldraw2024版本有哪些新增功能?
  • 2023最新Office2021专业增强版安装使用教程
  • 实时配送跟踪功能的实现:外卖跑腿小程序的技术挑战
  • react实现一维表格、键值对数据表格key value表格
  • 个人微信CRM客户管理系统怎么选?功能介绍
  • Mac Intellij Idea get/set方法快捷键
  • 并发程序设计
  • openGauss学习笔记-104 openGauss 数据库管理-管理数据库安全-客户端接入之SSL证书管理-证书替换
  • react仿照antd progress实现可自定义颜色的直角矩形进度条
  • 【网络安全】被恶意攻击的IP地址有多可怕?
  • Guava-RateLimiter详解
  • 【C++11】右值引用、移动构造、移动赋值、完美转发 的原理介绍
  • Python【理解标识符的定义】
  • AR智能眼镜主板设计方案_AR眼镜PCB板设计
  • 【SA8295P 源码分析 (三)】79 - AIS Camera Event 事件处理函数 AisEngine::EventHandler() 源码分析
  • Web安全测试详解
  • react配置 axios
  • 【图解RabbitMQ-5】RabbitMQ Web管控台图文介绍
  • GoogleNet论文精读
  • 智能指针shared_ptr简介及小例子
  • 机器人精确移动包
  • 强化学习环境报错解决
  • Ganache本地测试网如何在远程环境中进行访问和操作
  • Kotlin中的函数分类(顶层、成员、局部、递归等)
  • 字符串排序程序
  • 功率放大器在材料测试中的应用有哪些