Browse Source

添加Tailwind支持

master
zhangjiming 6 months ago
parent
commit
8de780234b
  1. 1327
      package-lock.json
  2. 3
      package.json
  3. 6
      postcss.config.js
  4. 6
      src/App.vue
  5. 1
      src/main.ts
  6. 3
      src/style.css
  7. 12
      tailwind.config.js

1327
package-lock.json
File diff suppressed because it is too large
View File

3
package.json

@ -21,7 +21,10 @@
"@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue-jsx": "^4.1.1", "@vitejs/plugin-vue-jsx": "^4.1.1",
"@vue/tsconfig": "^0.7.0", "@vue/tsconfig": "^0.7.0",
"autoprefixer": "^10.4.20",
"npm-run-all2": "^7.0.2", "npm-run-all2": "^7.0.2",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.3", "typescript": "~5.6.3",
"vite": "^6.0.5", "vite": "^6.0.5",
"vite-plugin-vue-devtools": "^7.6.8", "vite-plugin-vue-devtools": "^7.6.8",

6
postcss.config.js

@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

6
src/App.vue

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
import { RouterLink, RouterView } from "vue-router";
import HelloWorld from "./components/HelloWorld.vue";
</script> </script>
<template> <template>
@ -10,6 +10,8 @@ import HelloWorld from './components/HelloWorld.vue'
<div class="wrapper"> <div class="wrapper">
<HelloWorld msg="You did it!" /> <HelloWorld msg="You did it!" />
<h1 class="text-3xl font-bold underline">Hello world!</h1>
<nav> <nav>
<RouterLink to="/">Home</RouterLink> <RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink> <RouterLink to="/about">About</RouterLink>

1
src/main.ts

@ -1,3 +1,4 @@
import './style.css'
import './assets/main.css' import './assets/main.css'
import { createApp } from 'vue' import { createApp } from 'vue'

3
src/style.css

@ -0,0 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

12
tailwind.config.js

@ -0,0 +1,12 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}
Loading…
Cancel
Save