From 1c429cc4c0a77950d0ac7f9a9027996324ee8d3a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com>
Date: Sat, 20 Apr 2024 20:09:04 +0800
Subject: [PATCH 1/6] chore: type
---
shims-uni.d.ts => src/types/shims-uni.d.ts | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename shims-uni.d.ts => src/types/shims-uni.d.ts (100%)
diff --git a/shims-uni.d.ts b/src/types/shims-uni.d.ts
similarity index 100%
rename from shims-uni.d.ts
rename to src/types/shims-uni.d.ts
From 71f22f24a4f7d7b2707d8e28e9511b6b0be2b80f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com>
Date: Sun, 21 Apr 2024 15:34:13 +0800
Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E5=85=BC=E5=AE=B9js=E7=B1=BB?=
=?UTF-8?q?=E5=9E=8B=E6=96=87=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
tsconfig.json | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/tsconfig.json b/tsconfig.json
index 0094d59..ca41554 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -22,5 +22,13 @@
"nativeTags": ["block", "template", "component", "slot"]
},
"exclude": ["node_modules"],
- "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.json"]
+ "include": [
+ "src/**/*.ts",
+ "src/**/*.js",
+ "src/**/*.d.ts",
+ "src/**/*.tsx",
+ "src/**/*.jsx",
+ "src/**/*.vue",
+ "src/**/*.json"
+ ]
}
From e035830cb7d4022b7a37816476d1cf187f2bfe4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com>
Date: Sun, 21 Apr 2024 20:15:32 +0800
Subject: [PATCH 3/6] refine: unocss
---
uno.config.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/uno.config.ts b/uno.config.ts
index 63ff448..49a1cd1 100644
--- a/uno.config.ts
+++ b/uno.config.ts
@@ -11,7 +11,7 @@ import {
import { presetApplet, presetRemRpx, transformerAttributify } from 'unocss-applet'
// @see https://unocss.dev/presets/legacy-compat
-import presetLegacyCompat from '@unocss/preset-legacy-compat'
+import { presetLegacyCompat } from '@unocss/preset-legacy-compat'
const isH5 = process.env?.UNI_PLATFORM === 'h5'
const isMp = process.env?.UNI_PLATFORM?.startsWith('mp') ?? false
From 7a90f2f57b334262aa8d556eeab09fe9a374d567 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com>
Date: Mon, 22 Apr 2024 11:30:34 +0800
Subject: [PATCH 4/6] refine: delete useless vscode extensions
---
.vscode/extensions.json | 2 --
1 file changed, 2 deletions(-)
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index a7ab418..3324cd2 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -7,13 +7,11 @@
"antfu.unocss",
"antfu.iconify",
"evils.uniapp-vscode",
- "mrmaoddxxaa.create-uniapp-view",
"uni-helper.uni-helper-vscode",
"uni-helper.uni-app-schemas-vscode",
"uni-helper.uni-highlight-vscode",
"uni-helper.uni-ui-snippets-vscode",
"uni-helper.uni-app-snippets-vscode",
- "uni-helper.uni-cloud-snippets-vscode",
"mrmlnc.vscode-json5"
]
}
From 54f1aa3ee2c9837e3d5f9bdf59f4a8d63ba663e1 Mon Sep 17 00:00:00 2001
From: lin yan <1466030775@qq.com>
Date: Tue, 30 Apr 2024 11:32:03 +0800
Subject: [PATCH 5/6] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3uno.css=E5=86=99he?=
=?UTF-8?q?x=E9=A2=9C=E8=89=B2=E7=AD=89=E5=8A=9F=E8=83=BD=E4=B8=8D?=
=?UTF-8?q?=E9=AB=98=E4=BA=AE=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
uno.config.ts | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/uno.config.ts b/uno.config.ts
index 49a1cd1..b7f4d08 100644
--- a/uno.config.ts
+++ b/uno.config.ts
@@ -1,7 +1,8 @@
// uno.config.ts
import {
- Preset,
+ type Preset,
defineConfig,
+ presetUno,
presetAttributify,
presetIcons,
transformerDirectives,
@@ -13,26 +14,23 @@ import { presetApplet, presetRemRpx, transformerAttributify } from 'unocss-apple
// @see https://unocss.dev/presets/legacy-compat
import { presetLegacyCompat } from '@unocss/preset-legacy-compat'
-const isH5 = process.env?.UNI_PLATFORM === 'h5'
const isMp = process.env?.UNI_PLATFORM?.startsWith('mp') ?? false
const presets: Preset[] = []
-if (!isMp) {
- /**
- * you can add `presetAttributify()` here to enable unocss attributify mode prompt
- * although preset is not working for applet, but will generate useless css
- * 为了不生产无用的css,要过滤掉 applet
- */
- // 支持css class属性化,eg: ``
- presets.push(presetAttributify())
-}
-if (!isH5) {
- presets.push(presetRemRpx())
+if (isMp) {
+ // 使用小程序预设
+ presets.push(presetApplet(), presetRemRpx())
+} else {
+ presets.push(
+ // 非小程序用官方预设
+ presetUno(),
+ // 支持css class属性化
+ presetAttributify(),
+ )
}
export default defineConfig({
presets: [
...presets,
- presetApplet(),
// 支持图标,需要搭配图标库,eg: @iconify-json/carbon, 使用 ``
presetIcons({
scale: 1.2,
From a2a78f0c1376e931e7809ef9b3c17e8672b2e2ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8F=B2=E9=B8=BD?= <1020103647@qq.com>
Date: Tue, 30 Apr 2024 14:59:28 +0800
Subject: [PATCH 6/6] =?UTF-8?q?feat:=20issue#73=20=E4=BD=BF=E7=94=A8define?=
=?UTF-8?q?Options=E6=9B=BF=E4=BB=A3vite-plugin-vue-setup-extend?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
package.json | 1 -
src/pages/index/index.vue | 5 +++++
vite.config.ts | 2 --
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index 716654b..8a0b16e 100644
--- a/package.json
+++ b/package.json
@@ -151,7 +151,6 @@
"vite": "4.3.5",
"vite-plugin-restart": "^0.4.0",
"vite-plugin-svg-icons": "^2.0.1",
- "vite-plugin-vue-setup-extend": "^0.4.0",
"vite-svg-loader": "^5.1.0",
"vue-tsc": "^1.8.25"
}
diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index d7ee9db..e2a2d86 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -32,6 +32,11 @@