diff --git a/package.json b/package.json index 55716a9..fe80bb2 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,11 @@ }, "dependencies": { "axios": "^1.7.7", + "clsx": "^2.1.1", "normalize.css": "^8.0.1", "nprogress": "^0.2.0", "pinia": "^2.2.5", + "tailwind-merge": "^2.5.4", "vant": "^4.9.8", "vue": "^3.5.12", "vue-router": "^4.4.5" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f4f8ff5..d16ed81 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: axios: specifier: ^1.7.7 version: 1.7.7 + clsx: + specifier: ^2.1.1 + version: 2.1.1 normalize.css: specifier: ^8.0.1 version: 8.0.1 @@ -20,6 +23,9 @@ importers: pinia: specifier: ^2.2.5 version: 2.2.5(typescript@5.6.3)(vue@3.5.12(typescript@5.6.3)) + tailwind-merge: + specifier: ^2.5.4 + version: 2.5.4 vant: specifier: ^4.9.8 version: 4.9.8(vue@3.5.12(typescript@5.6.3)) @@ -1213,6 +1219,10 @@ packages: resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} engines: {node: '>=0.8'} + clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + cnjm-postcss-px-to-viewport@1.0.1: resolution: {integrity: sha512-0Gi8ECxoHZygnC9IS3J3IbNwP16CdZiS1Sj6JT6Di2qnduz3eNIfZ/zXVSqia5Kw85a4PAUXmOqTQmQY0UYYMQ==} peerDependencies: @@ -3355,6 +3365,9 @@ packages: resolution: {integrity: sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==} engines: {node: ^14.18.0 || >=16.0.0} + tailwind-merge@2.5.4: + resolution: {integrity: sha512-0q8cfZHMu9nuYP/b5Shb7Y7Sh1B7Nnl5GqNr1U+n2p6+mybvRtayrQ+0042Z5byvTA8ihjlP8Odo8/VnHbZu4Q==} + tailwindcss@3.4.14: resolution: {integrity: sha512-IcSvOcTRcUtQQ7ILQL5quRDg7Xs93PdJEk1ZLbhhvJc7uj/OAhYOnruEiwnGgBvUtaUAJ8/mhSw1o8L2jCiENA==} engines: {node: '>=14.0.0'} @@ -4888,6 +4901,8 @@ snapshots: clone@2.1.2: {} + clsx@2.1.1: {} + cnjm-postcss-px-to-viewport@1.0.1(postcss@8.4.47): dependencies: object-assign: 4.1.1 @@ -7203,6 +7218,8 @@ snapshots: '@pkgr/core': 0.1.1 tslib: 2.8.1 + tailwind-merge@2.5.4: {} + tailwindcss@3.4.14: dependencies: '@alloc/quick-lru': 5.2.0 diff --git a/src/components/DotPattern/DotPatternLinearGradient.vue b/src/components/DotPattern/DotPatternLinearGradient.vue new file mode 100644 index 0000000..f8f9e89 --- /dev/null +++ b/src/components/DotPattern/DotPatternLinearGradient.vue @@ -0,0 +1,27 @@ + + + + + + + diff --git a/src/components/DotPattern/index.vue b/src/components/DotPattern/index.vue new file mode 100644 index 0000000..81664b0 --- /dev/null +++ b/src/components/DotPattern/index.vue @@ -0,0 +1,57 @@ + + + + + + + + + + + + diff --git a/src/components/GridPattern/GridPatternDashed.vue b/src/components/GridPattern/GridPatternDashed.vue new file mode 100644 index 0000000..2d415fa --- /dev/null +++ b/src/components/GridPattern/GridPatternDashed.vue @@ -0,0 +1,27 @@ + + + + + + + diff --git a/src/components/GridPattern/GridPatternLinearGradient.vue b/src/components/GridPattern/GridPatternLinearGradient.vue new file mode 100644 index 0000000..f35f9a8 --- /dev/null +++ b/src/components/GridPattern/GridPatternLinearGradient.vue @@ -0,0 +1,26 @@ + + + + + + + diff --git a/src/components/GridPattern/index.vue b/src/components/GridPattern/index.vue new file mode 100644 index 0000000..5a6de0b --- /dev/null +++ b/src/components/GridPattern/index.vue @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + diff --git a/src/hooks/useId.ts b/src/hooks/useId.ts new file mode 100644 index 0000000..61d69e7 --- /dev/null +++ b/src/hooks/useId.ts @@ -0,0 +1,4 @@ +let id = 0; +export function useId() { + return `${id++}`; +} diff --git a/src/styles/variables.less b/src/styles/variables.less index ce2bb0a..8723a83 100644 --- a/src/styles/variables.less +++ b/src/styles/variables.less @@ -1,11 +1,13 @@ :root { --color-text: var(--van-text-color, #323233); - --color-background-2: var(--van-background-2, #fff); - --color-block-background: var(--van-border-color, #ebedf0); + --color-background-2: #fafafa; + --color-block-background: #ffffff; + --color-border: var(--van-border-color, #ebedf0); } html.dark { --color-text: var(--van-text-color, #f5f5f5); --color-background-2: var(--van-background-2, #1c1c1e); --color-block-background: var(--van-border-color, #3a3a3c); + --color-border: var(--van-border-color, #3a3a3c); } diff --git a/src/utils/class-names.ts b/src/utils/class-names.ts new file mode 100644 index 0000000..8098975 --- /dev/null +++ b/src/utils/class-names.ts @@ -0,0 +1,7 @@ +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; + +// Merge class +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/src/views/demo/index.vue b/src/views/demo/index.vue index e2c8876..0d905bd 100644 --- a/src/views/demo/index.vue +++ b/src/views/demo/index.vue @@ -1,58 +1,71 @@ + - - - - Vue3-h5-template - - - - + + + + Vue3-h5-template + + + + 🌱 基于 Vue3 全家桶、TypeScript、Vite 构建工具,开箱即用的 H5 移动端项目基础模板 - - + + + {{ item.text }} +
+
🌱 基于 Vue3 全家桶、TypeScript、Vite 构建工具,开箱即用的 H5 移动端项目基础模板