Skip to content

Commit b892d59

Browse files
committed
fix: 🐛 修复 APP 环境下依赖不兼容白屏问题
1 parent ad24b8b commit b892d59

File tree

8 files changed

+23
-26
lines changed

8 files changed

+23
-26
lines changed

.eslintrc-auto-import.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818
"VNode": true,
1919
"WritableComputedRef": true,
2020
"acceptHMRUpdate": true,
21+
"addRouterMethodAlias": true,
2122
"computed": true,
2223
"createApp": true,
2324
"createPinia": true,
25+
"createRouter": true,
2426
"customRef": true,
2527
"defineAsyncComponent": true,
2628
"defineComponent": true,
29+
"defineMiddleware": true,
2730
"defineStore": true,
2831
"effectScope": true,
2932
"getActivePinia": true,
@@ -90,37 +93,32 @@
9093
"shallowReactive": true,
9194
"shallowReadonly": true,
9295
"shallowRef": true,
96+
"store": true,
9397
"storeToRefs": true,
9498
"toRaw": true,
9599
"toRef": true,
96100
"toRefs": true,
97101
"toValue": true,
98102
"triggerRef": true,
99103
"unref": true,
104+
"useAppStore": true,
100105
"useAttrs": true,
101106
"useCssModule": true,
102107
"useCssVars": true,
103108
"useId": true,
104109
"useModel": true,
110+
"useRichView": true,
111+
"useRichViewStore": true,
105112
"useRoute": true,
106113
"useRouter": true,
107114
"useSlots": true,
108115
"useTemplateRef": true,
116+
"useUserStore": true,
117+
"useWebView": true,
118+
"useWebview": true,
109119
"watch": true,
110120
"watchEffect": true,
111121
"watchPostEffect": true,
112-
"watchSyncEffect": true,
113-
"useWebview": true,
114-
"useParse": true,
115-
"store": true,
116-
"useUserStore": true,
117-
"useParseStore": true,
118-
"createRouter": true,
119-
"addRouterMethodAlias": true,
120-
"defineMiddleware": true,
121-
"useRichViewStore": true,
122-
"useRichView": true,
123-
"useWebView": true,
124-
"useAppStore": true
122+
"watchSyncEffect": true
125123
}
126124
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
22
dist
33
*.ts
4-
*.local
4+
*.local
5+
.hbuilderx

.hbuilderx/launch.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

jsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"paths": {
55
"@/*": ["src/*"],
66
"@root/*": ["./*"],
7-
"$uni-router": ["helpers/uni-router/index.js"]
7+
"$uni-router": ["helpers/uni-router/index.js"],
8+
"$unocss-preset-shades": ["helpers/unocss-preset-shades/index.js"]
89
},
910
"resolveJsonModule": true,
1011
"esModuleInterop": true

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
"simple-git-hooks": "~2.13.0",
106106
"uni-parse-pages": "~0.0.1",
107107
"unocss": "~0.65.4",
108+
"unocss-applet": "~0.9.0",
108109
"unplugin-auto-import": "~19.2.0",
109110
"unplugin-uni-router": "~1.2.7",
110111
"vite": "~6.3.5"

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<script setup>
2+
// #ifdef WEB
23
import { updateShades } from '$unocss-preset-shades'
4+
// #endif
35
46
onLaunch(() => {
57
console.log('App Launch')
@@ -13,7 +15,7 @@ onHide(() => {
1315
1416
const appStore = useAppStore()
1517
16-
// #ifndef MP
18+
// #ifdef WEB
1719
watchEffect(() => {
1820
updateShades(appStore.primaryColor)
1921
})

src/store/app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const useAppStore = defineStore(
66
() => {
77
const themeModel = {
88
primary: { color: defaultPrimaryColor, name: '默认' },
9-
// #ifndef MP
9+
// #ifdef WEB
1010
blue: { color: '#3b82f6', name: '经典蓝' },
1111
purple: { color: '#8b5cf6', name: '紫罗兰' },
1212
red: { color: '#ef4444', name: '活力红' },

0 commit comments

Comments
 (0)