create-young-proj 0.3.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -1
- package/dist/index.mjs +8 -8
- package/package.json +1 -1
- package/template-uni-app/.vscode/css.code-snippets +398 -0
- package/template-uni-app/.vscode/extensions.json +9 -0
- package/template-uni-app/.vscode/js.code-snippets +1669 -0
- package/template-uni-app/.vscode/settings.json +7 -0
- package/template-uni-app/.vscode/vue-html.code-snippets +668 -0
- package/template-uni-app/README.md +46 -0
- package/template-uni-app/_env +1 -0
- package/template-uni-app/_env.development +11 -0
- package/template-uni-app/_env.production +11 -0
- package/template-uni-app/_env.test +14 -0
- package/template-uni-app/_gitignore +3 -0
- package/template-uni-app/auto-imports.d.ts +404 -0
- package/template-uni-app/components.d.ts +20 -0
- package/template-uni-app/custom-plugins/index.ts +8 -0
- package/template-uni-app/custom-plugins/multiconf.ts +77 -0
- package/template-uni-app/custom-plugins/polyfill.ts +32 -0
- package/template-uni-app/index.html +23 -0
- package/template-uni-app/package.json +84 -0
- package/template-uni-app/pnpm-lock.yaml +7530 -0
- package/template-uni-app/rome.json +26 -0
- package/template-uni-app/src/App.vue +76 -0
- package/template-uni-app/src/apis/index.ts +36 -0
- package/template-uni-app/src/apis/lib/index.ts +236 -0
- package/template-uni-app/src/apis/requests/get.ts +52 -0
- package/template-uni-app/src/apis/requests/index.ts +8 -0
- package/template-uni-app/src/apis/requests/post.ts +23 -0
- package/template-uni-app/src/components/young-loading/young-loading.vue +38 -0
- package/template-uni-app/src/components/young-navbar/young-navbar.vue +253 -0
- package/template-uni-app/src/components/young-tabbar/young-tabbar.vue +137 -0
- package/template-uni-app/src/components/young-tabbar-layout/young-tabbar-layout.vue +27 -0
- package/template-uni-app/src/config/enum.ts +46 -0
- package/template-uni-app/src/config/index.ts +8 -0
- package/template-uni-app/src/config/map.ts +15 -0
- package/template-uni-app/src/env.d.ts +35 -0
- package/template-uni-app/src/main.ts +20 -0
- package/template-uni-app/src/manifest.json +83 -0
- package/template-uni-app/src/pages/index.vue +52 -0
- package/template-uni-app/src/pages/my.vue +29 -0
- package/template-uni-app/src/pages.json +63 -0
- package/template-uni-app/src/store/index.ts +16 -0
- package/template-uni-app/src/store/local/index.ts +40 -0
- package/template-uni-app/src/store/system.ts +12 -0
- package/template-uni-app/src/uni.scss +76 -0
- package/template-uni-app/src/utils/auth.ts +125 -0
- package/template-uni-app/src/utils/index.ts +11 -0
- package/template-uni-app/src/utils/map.ts +97 -0
- package/template-uni-app/src/utils/modal.ts +98 -0
- package/template-uni-app/src/utils/route.ts +149 -0
- package/template-uni-app/src/utils/system.ts +66 -0
- package/template-uni-app/tsconfig.json +13 -0
- package/template-uni-app/unocss.config.ts +30 -0
- package/template-uni-app/vite.config.ts +68 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
# 基于 uni-app + vue3 + ts + pinia + unocss 的小程序模板
|
2
|
+
|
3
|
+
## Feature
|
4
|
+
|
5
|
+
- 🚀 `Vue3` + `TS` 快速开发,类型友好,将 🐛 扼杀在摇篮之中
|
6
|
+
|
7
|
+
- 💄 `unocss` 样式自动生成, 无需手写样式
|
8
|
+
|
9
|
+
- 🛠️ `pinia` 状态管理, 简单易用
|
10
|
+
|
11
|
+
- 📦 自动按需导入组件和 `API`, 减少冗余代码, 自定义的组件和方法亦可自动导入
|
12
|
+
|
13
|
+
- 方法自动导入,基于 [unplugin-auto-import](https://www.npmjs.com/package/unplugin-auto-import)
|
14
|
+
- 组件自动导入,基于 `uni-app` 的 [easycom](https://uniapp.dcloud.net.cn/collocation/pages.html#easycom) 以及 [unplugin-vue-components](https://www.npmjs.com/package/unplugin-vue-components)
|
15
|
+
|
16
|
+
- 🛠️ 支持通过传递不同的 `mode` 值以使用不同的配置
|
17
|
+
|
18
|
+
## 接口编写
|
19
|
+
|
20
|
+
> 按需注入特定的类型,以实现完美的类型推导和自动完成
|
21
|
+
|
22
|
+
推荐用法,参见:
|
23
|
+
|
24
|
+
- [api 编写](./src/apis/index.ts)
|
25
|
+
- [get 请求](./src/apis/requests/get.ts)
|
26
|
+
- [post 请求](./src/apis/requests/post.ts)
|
27
|
+
|
28
|
+
- [api 使用](./src/pages/index.vue)
|
29
|
+
|
30
|
+
- [原始 npm 包](https://www.npmjs.com/package/@bluesyoung/http)
|
31
|
+
|
32
|
+
## 特定环境的配置读取
|
33
|
+
|
34
|
+
1. 按需修改 `package.json -> scripts`
|
35
|
+
|
36
|
+
```bash
|
37
|
+
# 方式一
|
38
|
+
"test": "npm run dev:mp-weixin -- --mode=test"
|
39
|
+
|
40
|
+
# 方式二
|
41
|
+
"test": "uni -p mp-weixin --mode=test"
|
42
|
+
```
|
43
|
+
|
44
|
+
2. 创建对应的 `.env.{mode}` 文件
|
45
|
+
|
46
|
+
3. 代码中使用 `import.meta.env.{变量名}` 直接读取使用
|
@@ -0,0 +1 @@
|
|
1
|
+
VITE_COMMON = 此处存放公共配置
|
@@ -0,0 +1,14 @@
|
|
1
|
+
###
|
2
|
+
# @Author: zhangyang
|
3
|
+
# @Date: 2023-07-19 15:26:04
|
4
|
+
# @LastEditTime: 2023-07-19 15:52:20
|
5
|
+
# @Description: 测试配置,需要传递 --mode=test 才会启用
|
6
|
+
###
|
7
|
+
|
8
|
+
# 非标准 mode 时需要,可能的取值为 development 或者 production
|
9
|
+
# NODE_ENV = production
|
10
|
+
|
11
|
+
# 下面为应用需要使用的环境变量,需要以 VITE_ 开头
|
12
|
+
VITE_APP_ID = tochangetowxappid
|
13
|
+
|
14
|
+
VITE_API_BASE_URL = https://api.github.com
|
@@ -0,0 +1,404 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
/* prettier-ignore */
|
3
|
+
// @ts-nocheck
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
5
|
+
// Generated by unplugin-auto-import
|
6
|
+
export {}
|
7
|
+
declare global {
|
8
|
+
const AuthLocationEvents: typeof import('./src/config/enum')['AuthLocationEvents']
|
9
|
+
const EffectScope: typeof import('vue')['EffectScope']
|
10
|
+
const Pages: typeof import('./src/config/enum')['Pages']
|
11
|
+
const SubscribeMessage: typeof import('./src/config/enum')['SubscribeMessage']
|
12
|
+
const TabbarArr: typeof import('./src/config/enum')['TabbarArr']
|
13
|
+
const UIEvents: typeof import('./src/config/enum')['UIEvents']
|
14
|
+
const UsefulContentTypes: typeof import('./src/apis/lib/index')['UsefulContentTypes']
|
15
|
+
const YoungStorageKeys: typeof import('./src/config/enum')['YoungStorageKeys']
|
16
|
+
const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
|
17
|
+
const apis: typeof import('./src/apis/index')['apis']
|
18
|
+
const authLocation: typeof import('./src/utils/auth')['authLocation']
|
19
|
+
const back: typeof import('./src/utils/route')['back']
|
20
|
+
const computed: typeof import('vue')['computed']
|
21
|
+
const createApp: typeof import('vue')['createApp']
|
22
|
+
const createPinia: typeof import('pinia')['createPinia']
|
23
|
+
const customRef: typeof import('vue')['customRef']
|
24
|
+
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
25
|
+
const defineComponent: typeof import('vue')['defineComponent']
|
26
|
+
const defineStore: typeof import('pinia')['defineStore']
|
27
|
+
const effectScope: typeof import('vue')['effectScope']
|
28
|
+
const geocoderLocation: typeof import('./src/utils/map')['geocoderLocation']
|
29
|
+
const getActivePinia: typeof import('pinia')['getActivePinia']
|
30
|
+
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
31
|
+
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
32
|
+
const getLocationInfo: typeof import('./src/store/local/index')['getLocationInfo']
|
33
|
+
const getMapApiKey: typeof import('./src/config/map')['getMapApiKey']
|
34
|
+
const getNavbarHeihgt: typeof import('./src/store/local/index')['getNavbarHeihgt']
|
35
|
+
const getSystemInfo: typeof import('./src/utils/system')['getSystemInfo']
|
36
|
+
const getUuid: typeof import('./src/store/local/index')['getUuid']
|
37
|
+
const getWxCode: typeof import('./src/utils/auth')['getWxCode']
|
38
|
+
const h: typeof import('vue')['h']
|
39
|
+
const hideLoading: typeof import('./src/utils/modal')['hideLoading']
|
40
|
+
const inject: typeof import('vue')['inject']
|
41
|
+
const isProxy: typeof import('vue')['isProxy']
|
42
|
+
const isReactive: typeof import('vue')['isReactive']
|
43
|
+
const isReadonly: typeof import('vue')['isReadonly']
|
44
|
+
const isRef: typeof import('vue')['isRef']
|
45
|
+
const locate: typeof import('./src/utils/auth')['locate']
|
46
|
+
const mapActions: typeof import('pinia')['mapActions']
|
47
|
+
const mapGetters: typeof import('pinia')['mapGetters']
|
48
|
+
const mapState: typeof import('pinia')['mapState']
|
49
|
+
const mapStores: typeof import('pinia')['mapStores']
|
50
|
+
const mapWritableState: typeof import('pinia')['mapWritableState']
|
51
|
+
const markRaw: typeof import('vue')['markRaw']
|
52
|
+
const nextTick: typeof import('vue')['nextTick']
|
53
|
+
const onActivated: typeof import('vue')['onActivated']
|
54
|
+
const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites']
|
55
|
+
const onBackPress: typeof import('@dcloudio/uni-app')['onBackPress']
|
56
|
+
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
57
|
+
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
58
|
+
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
59
|
+
const onDeactivated: typeof import('vue')['onDeactivated']
|
60
|
+
const onError: typeof import('@dcloudio/uni-app')['onError']
|
61
|
+
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
62
|
+
const onHide: typeof import('@dcloudio/uni-app')['onHide']
|
63
|
+
const onLaunch: typeof import('@dcloudio/uni-app')['onLaunch']
|
64
|
+
const onLoad: typeof import('@dcloudio/uni-app')['onLoad']
|
65
|
+
const onMounted: typeof import('vue')['onMounted']
|
66
|
+
const onNavigationBarButtonTap: typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']
|
67
|
+
const onNavigationBarSearchInputChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']
|
68
|
+
const onNavigationBarSearchInputClicked: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']
|
69
|
+
const onNavigationBarSearchInputConfirmed: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']
|
70
|
+
const onNavigationBarSearchInputFocusChanged: typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']
|
71
|
+
const onPageNotFound: typeof import('@dcloudio/uni-app')['onPageNotFound']
|
72
|
+
const onPageScroll: typeof import('@dcloudio/uni-app')['onPageScroll']
|
73
|
+
const onPullDownRefresh: typeof import('@dcloudio/uni-app')['onPullDownRefresh']
|
74
|
+
const onReachBottom: typeof import('@dcloudio/uni-app')['onReachBottom']
|
75
|
+
const onReady: typeof import('@dcloudio/uni-app')['onReady']
|
76
|
+
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
77
|
+
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
78
|
+
const onResize: typeof import('@dcloudio/uni-app')['onResize']
|
79
|
+
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
80
|
+
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
81
|
+
const onShareAppMessage: typeof import('@dcloudio/uni-app')['onShareAppMessage']
|
82
|
+
const onShareTimeline: typeof import('@dcloudio/uni-app')['onShareTimeline']
|
83
|
+
const onShow: typeof import('@dcloudio/uni-app')['onShow']
|
84
|
+
const onTabItemTap: typeof import('@dcloudio/uni-app')['onTabItemTap']
|
85
|
+
const onThemeChange: typeof import('@dcloudio/uni-app')['onThemeChange']
|
86
|
+
const onUnhandledRejection: typeof import('@dcloudio/uni-app')['onUnhandledRejection']
|
87
|
+
const onUnload: typeof import('@dcloudio/uni-app')['onUnload']
|
88
|
+
const onUnmounted: typeof import('vue')['onUnmounted']
|
89
|
+
const onUpdated: typeof import('vue')['onUpdated']
|
90
|
+
const provide: typeof import('vue')['provide']
|
91
|
+
const reactive: typeof import('vue')['reactive']
|
92
|
+
const readonly: typeof import('vue')['readonly']
|
93
|
+
const redirect: typeof import('./src/utils/route')['redirect']
|
94
|
+
const ref: typeof import('vue')['ref']
|
95
|
+
const relaunch: typeof import('./src/utils/route')['relaunch']
|
96
|
+
const removeLocationInfo: typeof import('./src/store/local/index')['removeLocationInfo']
|
97
|
+
const resolveComponent: typeof import('vue')['resolveComponent']
|
98
|
+
const route: typeof import('./src/utils/route')['route']
|
99
|
+
const searchLoaction: typeof import('./src/utils/map')['searchLoaction']
|
100
|
+
const setActivePinia: typeof import('pinia')['setActivePinia']
|
101
|
+
const setLocationInfo: typeof import('./src/store/local/index')['setLocationInfo']
|
102
|
+
const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix']
|
103
|
+
const setNavbarHeihgt: typeof import('./src/store/local/index')['setNavbarHeihgt']
|
104
|
+
const setUuid: typeof import('./src/store/local/index')['setUuid']
|
105
|
+
const setupStore: typeof import('./src/store/index')['setupStore']
|
106
|
+
const shallowReactive: typeof import('vue')['shallowReactive']
|
107
|
+
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
108
|
+
const shallowRef: typeof import('vue')['shallowRef']
|
109
|
+
const showErrorModal: typeof import('./src/utils/modal')['showErrorModal']
|
110
|
+
const showLoading: typeof import('./src/utils/modal')['showLoading']
|
111
|
+
const showModal: typeof import('./src/utils/modal')['showModal']
|
112
|
+
const showToast: typeof import('./src/utils/modal')['showToast']
|
113
|
+
const storeToRefs: typeof import('pinia')['storeToRefs']
|
114
|
+
const subscribeMessage: typeof import('./src/utils/system')['subscribeMessage']
|
115
|
+
const tabbar: typeof import('./src/utils/route')['tabbar']
|
116
|
+
const to: typeof import('./src/utils/route')['to']
|
117
|
+
const toRaw: typeof import('vue')['toRaw']
|
118
|
+
const toRef: typeof import('vue')['toRef']
|
119
|
+
const toRefs: typeof import('vue')['toRefs']
|
120
|
+
const toValue: typeof import('vue')['toValue']
|
121
|
+
const triggerRef: typeof import('vue')['triggerRef']
|
122
|
+
const unref: typeof import('vue')['unref']
|
123
|
+
const useAttrs: typeof import('vue')['useAttrs']
|
124
|
+
const useCssModule: typeof import('vue')['useCssModule']
|
125
|
+
const useCssVars: typeof import('vue')['useCssVars']
|
126
|
+
const useGet: typeof import('./src/apis/requests/get')['useGet']
|
127
|
+
const useHttp: typeof import('./src/apis/lib/index')['useHttp']
|
128
|
+
const usePost: typeof import('./src/apis/requests/post')['usePost']
|
129
|
+
const useSlots: typeof import('vue')['useSlots']
|
130
|
+
const useSystemInfo: typeof import('./src/store/system')['useSystemInfo']
|
131
|
+
const watch: typeof import('vue')['watch']
|
132
|
+
const watchEffect: typeof import('vue')['watchEffect']
|
133
|
+
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
134
|
+
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
135
|
+
}
|
136
|
+
// for type re-export
|
137
|
+
declare global {
|
138
|
+
// @ts-ignore
|
139
|
+
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue'
|
140
|
+
}
|
141
|
+
// for vue template auto import
|
142
|
+
import { UnwrapRef } from 'vue'
|
143
|
+
declare module 'vue' {
|
144
|
+
interface ComponentCustomProperties {
|
145
|
+
readonly AuthLocationEvents: UnwrapRef<typeof import('./src/config/enum')['AuthLocationEvents']>
|
146
|
+
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
147
|
+
readonly Pages: UnwrapRef<typeof import('./src/config/enum')['Pages']>
|
148
|
+
readonly SubscribeMessage: UnwrapRef<typeof import('./src/config/enum')['SubscribeMessage']>
|
149
|
+
readonly TabbarArr: UnwrapRef<typeof import('./src/config/enum')['TabbarArr']>
|
150
|
+
readonly UIEvents: UnwrapRef<typeof import('./src/config/enum')['UIEvents']>
|
151
|
+
readonly UsefulContentTypes: UnwrapRef<typeof import('./src/apis/lib/index')['UsefulContentTypes']>
|
152
|
+
readonly YoungStorageKeys: UnwrapRef<typeof import('./src/config/enum')['YoungStorageKeys']>
|
153
|
+
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
|
154
|
+
readonly apis: UnwrapRef<typeof import('./src/apis/index')['apis']>
|
155
|
+
readonly authLocation: UnwrapRef<typeof import('./src/utils/auth')['authLocation']>
|
156
|
+
readonly back: UnwrapRef<typeof import('./src/utils/route')['back']>
|
157
|
+
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
158
|
+
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
159
|
+
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
|
160
|
+
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
|
161
|
+
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
|
162
|
+
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
|
163
|
+
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
|
164
|
+
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
165
|
+
readonly geocoderLocation: UnwrapRef<typeof import('./src/utils/map')['geocoderLocation']>
|
166
|
+
readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
|
167
|
+
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
168
|
+
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
169
|
+
readonly getLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['getLocationInfo']>
|
170
|
+
readonly getMapApiKey: UnwrapRef<typeof import('./src/config/map')['getMapApiKey']>
|
171
|
+
readonly getNavbarHeihgt: UnwrapRef<typeof import('./src/store/local/index')['getNavbarHeihgt']>
|
172
|
+
readonly getSystemInfo: UnwrapRef<typeof import('./src/utils/system')['getSystemInfo']>
|
173
|
+
readonly getUuid: UnwrapRef<typeof import('./src/store/local/index')['getUuid']>
|
174
|
+
readonly getWxCode: UnwrapRef<typeof import('./src/utils/auth')['getWxCode']>
|
175
|
+
readonly h: UnwrapRef<typeof import('vue')['h']>
|
176
|
+
readonly hideLoading: UnwrapRef<typeof import('./src/utils/modal')['hideLoading']>
|
177
|
+
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
178
|
+
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
|
179
|
+
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
180
|
+
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
181
|
+
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
182
|
+
readonly locate: UnwrapRef<typeof import('./src/utils/auth')['locate']>
|
183
|
+
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
|
184
|
+
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
|
185
|
+
readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
|
186
|
+
readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
|
187
|
+
readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
|
188
|
+
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
189
|
+
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
190
|
+
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
|
191
|
+
readonly onAddToFavorites: UnwrapRef<typeof import('@dcloudio/uni-app')['onAddToFavorites']>
|
192
|
+
readonly onBackPress: UnwrapRef<typeof import('@dcloudio/uni-app')['onBackPress']>
|
193
|
+
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
|
194
|
+
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
|
195
|
+
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
196
|
+
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
197
|
+
readonly onError: UnwrapRef<typeof import('@dcloudio/uni-app')['onError']>
|
198
|
+
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
199
|
+
readonly onHide: UnwrapRef<typeof import('@dcloudio/uni-app')['onHide']>
|
200
|
+
readonly onLaunch: UnwrapRef<typeof import('@dcloudio/uni-app')['onLaunch']>
|
201
|
+
readonly onLoad: UnwrapRef<typeof import('@dcloudio/uni-app')['onLoad']>
|
202
|
+
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
|
203
|
+
readonly onNavigationBarButtonTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']>
|
204
|
+
readonly onNavigationBarSearchInputChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']>
|
205
|
+
readonly onNavigationBarSearchInputClicked: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']>
|
206
|
+
readonly onNavigationBarSearchInputConfirmed: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']>
|
207
|
+
readonly onNavigationBarSearchInputFocusChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']>
|
208
|
+
readonly onPageNotFound: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageNotFound']>
|
209
|
+
readonly onPageScroll: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageScroll']>
|
210
|
+
readonly onPullDownRefresh: UnwrapRef<typeof import('@dcloudio/uni-app')['onPullDownRefresh']>
|
211
|
+
readonly onReachBottom: UnwrapRef<typeof import('@dcloudio/uni-app')['onReachBottom']>
|
212
|
+
readonly onReady: UnwrapRef<typeof import('@dcloudio/uni-app')['onReady']>
|
213
|
+
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
|
214
|
+
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
|
215
|
+
readonly onResize: UnwrapRef<typeof import('@dcloudio/uni-app')['onResize']>
|
216
|
+
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
|
217
|
+
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
|
218
|
+
readonly onShareAppMessage: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareAppMessage']>
|
219
|
+
readonly onShareTimeline: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareTimeline']>
|
220
|
+
readonly onShow: UnwrapRef<typeof import('@dcloudio/uni-app')['onShow']>
|
221
|
+
readonly onTabItemTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onTabItemTap']>
|
222
|
+
readonly onThemeChange: UnwrapRef<typeof import('@dcloudio/uni-app')['onThemeChange']>
|
223
|
+
readonly onUnhandledRejection: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnhandledRejection']>
|
224
|
+
readonly onUnload: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnload']>
|
225
|
+
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
226
|
+
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
227
|
+
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
228
|
+
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
|
229
|
+
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
230
|
+
readonly redirect: UnwrapRef<typeof import('./src/utils/route')['redirect']>
|
231
|
+
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
232
|
+
readonly relaunch: UnwrapRef<typeof import('./src/utils/route')['relaunch']>
|
233
|
+
readonly removeLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['removeLocationInfo']>
|
234
|
+
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
235
|
+
readonly route: UnwrapRef<typeof import('./src/utils/route')['route']>
|
236
|
+
readonly searchLoaction: UnwrapRef<typeof import('./src/utils/map')['searchLoaction']>
|
237
|
+
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
|
238
|
+
readonly setLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['setLocationInfo']>
|
239
|
+
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
|
240
|
+
readonly setNavbarHeihgt: UnwrapRef<typeof import('./src/store/local/index')['setNavbarHeihgt']>
|
241
|
+
readonly setUuid: UnwrapRef<typeof import('./src/store/local/index')['setUuid']>
|
242
|
+
readonly setupStore: UnwrapRef<typeof import('./src/store/index')['setupStore']>
|
243
|
+
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
244
|
+
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
|
245
|
+
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
|
246
|
+
readonly showErrorModal: UnwrapRef<typeof import('./src/utils/modal')['showErrorModal']>
|
247
|
+
readonly showLoading: UnwrapRef<typeof import('./src/utils/modal')['showLoading']>
|
248
|
+
readonly showModal: UnwrapRef<typeof import('./src/utils/modal')['showModal']>
|
249
|
+
readonly showToast: UnwrapRef<typeof import('./src/utils/modal')['showToast']>
|
250
|
+
readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
|
251
|
+
readonly subscribeMessage: UnwrapRef<typeof import('./src/utils/system')['subscribeMessage']>
|
252
|
+
readonly tabbar: UnwrapRef<typeof import('./src/utils/route')['tabbar']>
|
253
|
+
readonly to: UnwrapRef<typeof import('./src/utils/route')['to']>
|
254
|
+
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
|
255
|
+
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
|
256
|
+
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
|
257
|
+
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
|
258
|
+
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
|
259
|
+
readonly unref: UnwrapRef<typeof import('vue')['unref']>
|
260
|
+
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
|
261
|
+
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
262
|
+
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
263
|
+
readonly useGet: UnwrapRef<typeof import('./src/apis/requests/get')['useGet']>
|
264
|
+
readonly useHttp: UnwrapRef<typeof import('./src/apis/lib/index')['useHttp']>
|
265
|
+
readonly usePost: UnwrapRef<typeof import('./src/apis/requests/post')['usePost']>
|
266
|
+
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
267
|
+
readonly useSystemInfo: UnwrapRef<typeof import('./src/store/system')['useSystemInfo']>
|
268
|
+
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
269
|
+
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
270
|
+
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
271
|
+
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
272
|
+
}
|
273
|
+
}
|
274
|
+
declare module '@vue/runtime-core' {
|
275
|
+
interface ComponentCustomProperties {
|
276
|
+
readonly AuthLocationEvents: UnwrapRef<typeof import('./src/config/enum')['AuthLocationEvents']>
|
277
|
+
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
|
278
|
+
readonly Pages: UnwrapRef<typeof import('./src/config/enum')['Pages']>
|
279
|
+
readonly SubscribeMessage: UnwrapRef<typeof import('./src/config/enum')['SubscribeMessage']>
|
280
|
+
readonly TabbarArr: UnwrapRef<typeof import('./src/config/enum')['TabbarArr']>
|
281
|
+
readonly UIEvents: UnwrapRef<typeof import('./src/config/enum')['UIEvents']>
|
282
|
+
readonly UsefulContentTypes: UnwrapRef<typeof import('./src/apis/lib/index')['UsefulContentTypes']>
|
283
|
+
readonly YoungStorageKeys: UnwrapRef<typeof import('./src/config/enum')['YoungStorageKeys']>
|
284
|
+
readonly acceptHMRUpdate: UnwrapRef<typeof import('pinia')['acceptHMRUpdate']>
|
285
|
+
readonly apis: UnwrapRef<typeof import('./src/apis/index')['apis']>
|
286
|
+
readonly authLocation: UnwrapRef<typeof import('./src/utils/auth')['authLocation']>
|
287
|
+
readonly back: UnwrapRef<typeof import('./src/utils/route')['back']>
|
288
|
+
readonly computed: UnwrapRef<typeof import('vue')['computed']>
|
289
|
+
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
|
290
|
+
readonly createPinia: UnwrapRef<typeof import('pinia')['createPinia']>
|
291
|
+
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
|
292
|
+
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
|
293
|
+
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
|
294
|
+
readonly defineStore: UnwrapRef<typeof import('pinia')['defineStore']>
|
295
|
+
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
|
296
|
+
readonly geocoderLocation: UnwrapRef<typeof import('./src/utils/map')['geocoderLocation']>
|
297
|
+
readonly getActivePinia: UnwrapRef<typeof import('pinia')['getActivePinia']>
|
298
|
+
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
|
299
|
+
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
|
300
|
+
readonly getLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['getLocationInfo']>
|
301
|
+
readonly getMapApiKey: UnwrapRef<typeof import('./src/config/map')['getMapApiKey']>
|
302
|
+
readonly getNavbarHeihgt: UnwrapRef<typeof import('./src/store/local/index')['getNavbarHeihgt']>
|
303
|
+
readonly getSystemInfo: UnwrapRef<typeof import('./src/utils/system')['getSystemInfo']>
|
304
|
+
readonly getUuid: UnwrapRef<typeof import('./src/store/local/index')['getUuid']>
|
305
|
+
readonly getWxCode: UnwrapRef<typeof import('./src/utils/auth')['getWxCode']>
|
306
|
+
readonly h: UnwrapRef<typeof import('vue')['h']>
|
307
|
+
readonly hideLoading: UnwrapRef<typeof import('./src/utils/modal')['hideLoading']>
|
308
|
+
readonly inject: UnwrapRef<typeof import('vue')['inject']>
|
309
|
+
readonly isProxy: UnwrapRef<typeof import('vue')['isProxy']>
|
310
|
+
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
|
311
|
+
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
|
312
|
+
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
|
313
|
+
readonly locate: UnwrapRef<typeof import('./src/utils/auth')['locate']>
|
314
|
+
readonly mapActions: UnwrapRef<typeof import('pinia')['mapActions']>
|
315
|
+
readonly mapGetters: UnwrapRef<typeof import('pinia')['mapGetters']>
|
316
|
+
readonly mapState: UnwrapRef<typeof import('pinia')['mapState']>
|
317
|
+
readonly mapStores: UnwrapRef<typeof import('pinia')['mapStores']>
|
318
|
+
readonly mapWritableState: UnwrapRef<typeof import('pinia')['mapWritableState']>
|
319
|
+
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
|
320
|
+
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
|
321
|
+
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
|
322
|
+
readonly onAddToFavorites: UnwrapRef<typeof import('@dcloudio/uni-app')['onAddToFavorites']>
|
323
|
+
readonly onBackPress: UnwrapRef<typeof import('@dcloudio/uni-app')['onBackPress']>
|
324
|
+
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
|
325
|
+
readonly onBeforeUnmount: UnwrapRef<typeof import('vue')['onBeforeUnmount']>
|
326
|
+
readonly onBeforeUpdate: UnwrapRef<typeof import('vue')['onBeforeUpdate']>
|
327
|
+
readonly onDeactivated: UnwrapRef<typeof import('vue')['onDeactivated']>
|
328
|
+
readonly onError: UnwrapRef<typeof import('@dcloudio/uni-app')['onError']>
|
329
|
+
readonly onErrorCaptured: UnwrapRef<typeof import('vue')['onErrorCaptured']>
|
330
|
+
readonly onHide: UnwrapRef<typeof import('@dcloudio/uni-app')['onHide']>
|
331
|
+
readonly onLaunch: UnwrapRef<typeof import('@dcloudio/uni-app')['onLaunch']>
|
332
|
+
readonly onLoad: UnwrapRef<typeof import('@dcloudio/uni-app')['onLoad']>
|
333
|
+
readonly onMounted: UnwrapRef<typeof import('vue')['onMounted']>
|
334
|
+
readonly onNavigationBarButtonTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarButtonTap']>
|
335
|
+
readonly onNavigationBarSearchInputChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputChanged']>
|
336
|
+
readonly onNavigationBarSearchInputClicked: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputClicked']>
|
337
|
+
readonly onNavigationBarSearchInputConfirmed: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputConfirmed']>
|
338
|
+
readonly onNavigationBarSearchInputFocusChanged: UnwrapRef<typeof import('@dcloudio/uni-app')['onNavigationBarSearchInputFocusChanged']>
|
339
|
+
readonly onPageNotFound: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageNotFound']>
|
340
|
+
readonly onPageScroll: UnwrapRef<typeof import('@dcloudio/uni-app')['onPageScroll']>
|
341
|
+
readonly onPullDownRefresh: UnwrapRef<typeof import('@dcloudio/uni-app')['onPullDownRefresh']>
|
342
|
+
readonly onReachBottom: UnwrapRef<typeof import('@dcloudio/uni-app')['onReachBottom']>
|
343
|
+
readonly onReady: UnwrapRef<typeof import('@dcloudio/uni-app')['onReady']>
|
344
|
+
readonly onRenderTracked: UnwrapRef<typeof import('vue')['onRenderTracked']>
|
345
|
+
readonly onRenderTriggered: UnwrapRef<typeof import('vue')['onRenderTriggered']>
|
346
|
+
readonly onResize: UnwrapRef<typeof import('@dcloudio/uni-app')['onResize']>
|
347
|
+
readonly onScopeDispose: UnwrapRef<typeof import('vue')['onScopeDispose']>
|
348
|
+
readonly onServerPrefetch: UnwrapRef<typeof import('vue')['onServerPrefetch']>
|
349
|
+
readonly onShareAppMessage: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareAppMessage']>
|
350
|
+
readonly onShareTimeline: UnwrapRef<typeof import('@dcloudio/uni-app')['onShareTimeline']>
|
351
|
+
readonly onShow: UnwrapRef<typeof import('@dcloudio/uni-app')['onShow']>
|
352
|
+
readonly onTabItemTap: UnwrapRef<typeof import('@dcloudio/uni-app')['onTabItemTap']>
|
353
|
+
readonly onThemeChange: UnwrapRef<typeof import('@dcloudio/uni-app')['onThemeChange']>
|
354
|
+
readonly onUnhandledRejection: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnhandledRejection']>
|
355
|
+
readonly onUnload: UnwrapRef<typeof import('@dcloudio/uni-app')['onUnload']>
|
356
|
+
readonly onUnmounted: UnwrapRef<typeof import('vue')['onUnmounted']>
|
357
|
+
readonly onUpdated: UnwrapRef<typeof import('vue')['onUpdated']>
|
358
|
+
readonly provide: UnwrapRef<typeof import('vue')['provide']>
|
359
|
+
readonly reactive: UnwrapRef<typeof import('vue')['reactive']>
|
360
|
+
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
|
361
|
+
readonly redirect: UnwrapRef<typeof import('./src/utils/route')['redirect']>
|
362
|
+
readonly ref: UnwrapRef<typeof import('vue')['ref']>
|
363
|
+
readonly relaunch: UnwrapRef<typeof import('./src/utils/route')['relaunch']>
|
364
|
+
readonly removeLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['removeLocationInfo']>
|
365
|
+
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
|
366
|
+
readonly route: UnwrapRef<typeof import('./src/utils/route')['route']>
|
367
|
+
readonly searchLoaction: UnwrapRef<typeof import('./src/utils/map')['searchLoaction']>
|
368
|
+
readonly setActivePinia: UnwrapRef<typeof import('pinia')['setActivePinia']>
|
369
|
+
readonly setLocationInfo: UnwrapRef<typeof import('./src/store/local/index')['setLocationInfo']>
|
370
|
+
readonly setMapStoreSuffix: UnwrapRef<typeof import('pinia')['setMapStoreSuffix']>
|
371
|
+
readonly setNavbarHeihgt: UnwrapRef<typeof import('./src/store/local/index')['setNavbarHeihgt']>
|
372
|
+
readonly setUuid: UnwrapRef<typeof import('./src/store/local/index')['setUuid']>
|
373
|
+
readonly setupStore: UnwrapRef<typeof import('./src/store/index')['setupStore']>
|
374
|
+
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
|
375
|
+
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
|
376
|
+
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
|
377
|
+
readonly showErrorModal: UnwrapRef<typeof import('./src/utils/modal')['showErrorModal']>
|
378
|
+
readonly showLoading: UnwrapRef<typeof import('./src/utils/modal')['showLoading']>
|
379
|
+
readonly showModal: UnwrapRef<typeof import('./src/utils/modal')['showModal']>
|
380
|
+
readonly showToast: UnwrapRef<typeof import('./src/utils/modal')['showToast']>
|
381
|
+
readonly storeToRefs: UnwrapRef<typeof import('pinia')['storeToRefs']>
|
382
|
+
readonly subscribeMessage: UnwrapRef<typeof import('./src/utils/system')['subscribeMessage']>
|
383
|
+
readonly tabbar: UnwrapRef<typeof import('./src/utils/route')['tabbar']>
|
384
|
+
readonly to: UnwrapRef<typeof import('./src/utils/route')['to']>
|
385
|
+
readonly toRaw: UnwrapRef<typeof import('vue')['toRaw']>
|
386
|
+
readonly toRef: UnwrapRef<typeof import('vue')['toRef']>
|
387
|
+
readonly toRefs: UnwrapRef<typeof import('vue')['toRefs']>
|
388
|
+
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
|
389
|
+
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
|
390
|
+
readonly unref: UnwrapRef<typeof import('vue')['unref']>
|
391
|
+
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
|
392
|
+
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
|
393
|
+
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
|
394
|
+
readonly useGet: UnwrapRef<typeof import('./src/apis/requests/get')['useGet']>
|
395
|
+
readonly useHttp: UnwrapRef<typeof import('./src/apis/lib/index')['useHttp']>
|
396
|
+
readonly usePost: UnwrapRef<typeof import('./src/apis/requests/post')['usePost']>
|
397
|
+
readonly useSlots: UnwrapRef<typeof import('vue')['useSlots']>
|
398
|
+
readonly useSystemInfo: UnwrapRef<typeof import('./src/store/system')['useSystemInfo']>
|
399
|
+
readonly watch: UnwrapRef<typeof import('vue')['watch']>
|
400
|
+
readonly watchEffect: UnwrapRef<typeof import('vue')['watchEffect']>
|
401
|
+
readonly watchPostEffect: UnwrapRef<typeof import('vue')['watchPostEffect']>
|
402
|
+
readonly watchSyncEffect: UnwrapRef<typeof import('vue')['watchSyncEffect']>
|
403
|
+
}
|
404
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
/* prettier-ignore */
|
3
|
+
// @ts-nocheck
|
4
|
+
// Generated by unplugin-vue-components
|
5
|
+
// Read more: https://github.com/vuejs/core/pull/3399
|
6
|
+
export {}
|
7
|
+
|
8
|
+
declare module 'vue' {
|
9
|
+
export interface GlobalComponents {
|
10
|
+
RouterLink: typeof import('vue-router')['RouterLink']
|
11
|
+
RouterView: typeof import('vue-router')['RouterView']
|
12
|
+
UniCard: typeof import('@dcloudio/uni-ui/lib/uni-card/uni-card.vue')['default']
|
13
|
+
UniIcons: typeof import('@dcloudio/uni-ui/lib/uni-icons/uni-icons.vue')['default']
|
14
|
+
UniNavBar: typeof import('@dcloudio/uni-ui/lib/uni-nav-bar/uni-nav-bar.vue')['default']
|
15
|
+
YoungLoading: typeof import('./src/components/young-loading/young-loading.vue')['default']
|
16
|
+
YoungNavbar: typeof import('./src/components/young-navbar/young-navbar.vue')['default']
|
17
|
+
YoungTabbar: typeof import('./src/components/young-tabbar/young-tabbar.vue')['default']
|
18
|
+
YoungTabbarLayout: typeof import('./src/components/young-tabbar-layout/young-tabbar-layout.vue')['default']
|
19
|
+
}
|
20
|
+
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
/*
|
2
|
+
* @Author: zhangyang
|
3
|
+
* @Date: 2023-07-19 14:32:45
|
4
|
+
* @LastEditTime: 2023-07-19 15:48:53
|
5
|
+
* @Description:
|
6
|
+
*/
|
7
|
+
import type { Plugin } from 'vite';
|
8
|
+
import type { OutputAsset } from 'rollup';
|
9
|
+
|
10
|
+
/**
|
11
|
+
* 通过传递 mode 以读取不同的环境变量
|
12
|
+
*/
|
13
|
+
export const multiConf = (env: string) => {
|
14
|
+
let configEnv: ImportMetaEnv;
|
15
|
+
let targetDir;
|
16
|
+
return {
|
17
|
+
name: 'young-multi-conf',
|
18
|
+
enforce: 'post',
|
19
|
+
configResolved: async (config) => {
|
20
|
+
console.log('当前使用的环境变量来自于:.env.' + env, config.env);
|
21
|
+
|
22
|
+
configEnv = config.env as ImportMetaEnv;
|
23
|
+
targetDir = config.build.outDir;
|
24
|
+
},
|
25
|
+
generateBundle(options, bundle) {
|
26
|
+
const appid = configEnv.VITE_APPID;
|
27
|
+
const json = bundle['project.config.json'] as OutputAsset;
|
28
|
+
if (json?.source && typeof json.source === 'string') {
|
29
|
+
const jsonConf = JSON.parse(json.source);
|
30
|
+
// console.log("🚀 ~ file: multiconf.ts:27 ~ generateBundle ~ jsonConf:", jsonConf);
|
31
|
+
|
32
|
+
jsonConf.setting = {
|
33
|
+
urlCheck: true,
|
34
|
+
coverView: true,
|
35
|
+
es6: true,
|
36
|
+
postcss: true,
|
37
|
+
lazyloadPlaceholderEnable: false,
|
38
|
+
preloadBackgroundData: false,
|
39
|
+
minified: true,
|
40
|
+
autoAudits: false,
|
41
|
+
uglifyFileName: false,
|
42
|
+
uploadWithSourceMap: true,
|
43
|
+
enhance: true,
|
44
|
+
showShadowRootInWxmlPanel: true,
|
45
|
+
packNpmManually: false,
|
46
|
+
packNpmRelationList: [],
|
47
|
+
minifyWXSS: true,
|
48
|
+
useStaticServer: true,
|
49
|
+
showES6CompileOption: false,
|
50
|
+
checkInvalidKey: true,
|
51
|
+
babelSetting: {
|
52
|
+
ignore: [],
|
53
|
+
disablePlugins: [],
|
54
|
+
outputPath: '',
|
55
|
+
},
|
56
|
+
disableUseStrict: false,
|
57
|
+
useCompilerPlugins: false,
|
58
|
+
minifyWXML: true,
|
59
|
+
useMultiFrameRuntime: true,
|
60
|
+
ignoreUploadUnusedFiles: false,
|
61
|
+
ignoreDevUnusedFiles: false,
|
62
|
+
};
|
63
|
+
jsonConf.appid = appid;
|
64
|
+
jsonConf.requiredPrivateInfos = ['getLocation'];
|
65
|
+
jsonConf.permission = {
|
66
|
+
'scope.userLocation': {
|
67
|
+
desc: '你的位置信息将用于获取附近的门店信息',
|
68
|
+
},
|
69
|
+
};
|
70
|
+
|
71
|
+
json.source = JSON.stringify(jsonConf, null, 2);
|
72
|
+
}
|
73
|
+
// console.log("🚀 ~ file: vite.config.ts:18 ~ generateBundle ~ bundle:", json)
|
74
|
+
// 处理生成的输出文件
|
75
|
+
},
|
76
|
+
} as Plugin;
|
77
|
+
};
|