@mpilk/mp-route 2.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -0
- package/bin/cli.js +1 -1
- package/dist/chunk-6MZ3UWKK.js +262 -238
- package/dist/cli.cjs +331 -260
- package/dist/cli.d.cts +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +18 -18
- package/dist/index.cjs +287 -256
- package/dist/index.d.cts +357 -357
- package/dist/index.d.ts +357 -357
- package/dist/index.js +11 -11
- package/package.json +51 -40
package/dist/index.d.ts
CHANGED
|
@@ -1,357 +1,357 @@
|
|
|
1
|
-
import chokidar from 'chokidar';
|
|
2
|
-
|
|
3
|
-
type RouteConfig = _RouteConfig | _RouteConfig[];
|
|
4
|
-
interface _RouteConfig {
|
|
5
|
-
/**
|
|
6
|
-
* 当前页面显示的标题名称
|
|
7
|
-
* @deprecated replaced by title, will be removed in next minor version
|
|
8
|
-
*/
|
|
9
|
-
name?: string;
|
|
10
|
-
/**
|
|
11
|
-
* 当前页面显示的标题名称
|
|
12
|
-
*/
|
|
13
|
-
title?: string;
|
|
14
|
-
/**
|
|
15
|
-
* 开启分包加载
|
|
16
|
-
* @deprecated replaced by isSubpackage, will be removed in next minor version
|
|
17
|
-
*/
|
|
18
|
-
subPackages?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* 是否拆分为子包,path 转换为 root
|
|
21
|
-
*/
|
|
22
|
-
isSubpackage?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* 是否为首页地址
|
|
25
|
-
*/
|
|
26
|
-
isIndex?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 页面路径
|
|
29
|
-
*/
|
|
30
|
-
path: string;
|
|
31
|
-
/**
|
|
32
|
-
* 页面样式,其他配置
|
|
33
|
-
*/
|
|
34
|
-
style?: PageStyle;
|
|
35
|
-
children?: _RouteConfig[];
|
|
36
|
-
preLoadPath?: string | string[];
|
|
37
|
-
preLoadNetwork?: 'all' | 'wifi';
|
|
38
|
-
conditionActive?: boolean;
|
|
39
|
-
conditionQuery?: string;
|
|
40
|
-
}
|
|
41
|
-
type GlobalStyle = PageStyle;
|
|
42
|
-
interface Route {
|
|
43
|
-
path: string;
|
|
44
|
-
style?: PageStyle;
|
|
45
|
-
}
|
|
46
|
-
type Pages = Route[];
|
|
47
|
-
interface SubPackage {
|
|
48
|
-
root: string;
|
|
49
|
-
pages: Pages;
|
|
50
|
-
}
|
|
51
|
-
interface PreloadRule {
|
|
52
|
-
[key: string]: {
|
|
53
|
-
packages: string[];
|
|
54
|
-
/**
|
|
55
|
-
* @default 'wifi'
|
|
56
|
-
*/
|
|
57
|
-
network?: 'all' | 'wifi';
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
interface Easycom {
|
|
61
|
-
/**
|
|
62
|
-
* @default true
|
|
63
|
-
*/
|
|
64
|
-
autoscan?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* 自定义自动引入规则
|
|
67
|
-
*/
|
|
68
|
-
custom?: Record<string, string>;
|
|
69
|
-
}
|
|
70
|
-
interface TabBar {
|
|
71
|
-
/**
|
|
72
|
-
* tab 上的文字默认颜色
|
|
73
|
-
*/
|
|
74
|
-
color: string;
|
|
75
|
-
/**
|
|
76
|
-
* tab 上的文字选中时的颜色
|
|
77
|
-
*/
|
|
78
|
-
selectedColor: string;
|
|
79
|
-
/**
|
|
80
|
-
* tab 的背景色
|
|
81
|
-
*/
|
|
82
|
-
backgroundColor: string;
|
|
83
|
-
/**
|
|
84
|
-
* tabbar 上边框的颜色,可选值 black/white,也支持其他颜色值
|
|
85
|
-
* @default black
|
|
86
|
-
* @platform App 2.3.4+ 、H5 3.0.0+
|
|
87
|
-
*/
|
|
88
|
-
borderStyle?: string;
|
|
89
|
-
/**
|
|
90
|
-
* iOS 高斯模糊效果,可选值 dark/extralight/light/none(参考:[使用说明](https://ask.dcloud.net.cn/article/36617))
|
|
91
|
-
* @default none
|
|
92
|
-
* @platform App 2.4.0+ 支持、H5 3.0.0+(只有最新版浏览器才支持)
|
|
93
|
-
*/
|
|
94
|
-
blurEffect?: string;
|
|
95
|
-
/**
|
|
96
|
-
* tab 的列表,详见 list 属性说明,最少2个、最多5个 tab
|
|
97
|
-
*/
|
|
98
|
-
list: TabItem[];
|
|
99
|
-
/**
|
|
100
|
-
* 可选值 bottom、top
|
|
101
|
-
* @default bottom
|
|
102
|
-
* @platform top 值仅微信小程序支持
|
|
103
|
-
*/
|
|
104
|
-
position?: 'bottom' | 'top';
|
|
105
|
-
/**
|
|
106
|
-
* 文字默认大小
|
|
107
|
-
* @default 10px
|
|
108
|
-
* @platform App 2.3.4+、H5 3.0.0+
|
|
109
|
-
*/
|
|
110
|
-
fontSize?: string;
|
|
111
|
-
/**
|
|
112
|
-
* 图标默认宽度(高度等比例缩放)
|
|
113
|
-
* @default 24px
|
|
114
|
-
* @platform App 2.3.4+、H5 3.0.0+
|
|
115
|
-
*/
|
|
116
|
-
iconWidth?: string;
|
|
117
|
-
/**
|
|
118
|
-
* 图标和文字的间距
|
|
119
|
-
* @default 3px
|
|
120
|
-
* @platform App 2.3.4+、H5 3.0.0+
|
|
121
|
-
*/
|
|
122
|
-
spacing?: string;
|
|
123
|
-
/**
|
|
124
|
-
* tabBar 默认高度
|
|
125
|
-
* @default 50px
|
|
126
|
-
* @platform App 2.3.4+、H5 3.0.0+
|
|
127
|
-
*/
|
|
128
|
-
height?: string;
|
|
129
|
-
/**
|
|
130
|
-
* 中间按钮 仅在 list 项为偶数时有效
|
|
131
|
-
* @platform App 2.3.4+、H5 3.0.0+
|
|
132
|
-
*/
|
|
133
|
-
midButton?: object;
|
|
134
|
-
/**
|
|
135
|
-
* list设置 iconfont 属性时,需要指定字体文件路径
|
|
136
|
-
* @platform App 3.4.4+、H5 3.5.3+
|
|
137
|
-
*/
|
|
138
|
-
iconfontSrc?: string;
|
|
139
|
-
}
|
|
140
|
-
interface TabItem {
|
|
141
|
-
/**
|
|
142
|
-
* 页面路径,必须在 pages 中先定义
|
|
143
|
-
*/
|
|
144
|
-
pagePath: string;
|
|
145
|
-
/**
|
|
146
|
-
* tab 上按钮文字,在 App 和 H5 平台为非必填。例如中间可放一个没有文字的+号图标
|
|
147
|
-
*/
|
|
148
|
-
text: string;
|
|
149
|
-
/**
|
|
150
|
-
* 图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,当 position 为 top 时,此参数无效,不支持网络图片,不支持字体图标
|
|
151
|
-
*/
|
|
152
|
-
iconPath?: string;
|
|
153
|
-
/**
|
|
154
|
-
* 选中时的图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px ,当 position 为 top 时,此参数无效
|
|
155
|
-
*/
|
|
156
|
-
selectedIconPath?: string;
|
|
157
|
-
/**
|
|
158
|
-
* 该项是否显示,默认显示
|
|
159
|
-
* @platform App (3.2.10+)、H5 (3.2.10+)
|
|
160
|
-
*/
|
|
161
|
-
visible?: boolean;
|
|
162
|
-
/**
|
|
163
|
-
* 字体图标,优先级高于 iconPath
|
|
164
|
-
* @platform App(3.4.4+)、H5 (3.5.3+)
|
|
165
|
-
*/
|
|
166
|
-
iconfont?: object;
|
|
167
|
-
}
|
|
168
|
-
interface Condition {
|
|
169
|
-
current: number;
|
|
170
|
-
list: ConditionItem[];
|
|
171
|
-
}
|
|
172
|
-
interface ConditionItem {
|
|
173
|
-
name: string;
|
|
174
|
-
path: string;
|
|
175
|
-
query?: string;
|
|
176
|
-
}
|
|
177
|
-
interface PageStyle {
|
|
178
|
-
/**
|
|
179
|
-
* 导航栏背景颜色(同状态栏背景色)
|
|
180
|
-
* APP与H5为#F8F8F8,小程序平台请参考相应小程序文档
|
|
181
|
-
* @default #F8F8F8
|
|
182
|
-
*/
|
|
183
|
-
'navigationBarBackgroundColor'?: string;
|
|
184
|
-
/**
|
|
185
|
-
* 导航栏标题颜色及状态栏前景颜色,仅支持 black/white
|
|
186
|
-
* 支付宝小程序不支持,请使用 my.setNavigationBar
|
|
187
|
-
* @default black
|
|
188
|
-
*/
|
|
189
|
-
'navigationBarTextStyle'?: 'black' | 'white';
|
|
190
|
-
/**
|
|
191
|
-
* 导航栏标题文字内容
|
|
192
|
-
* @default ''
|
|
193
|
-
*/
|
|
194
|
-
'navigationBarTitleText'?: string;
|
|
195
|
-
/**
|
|
196
|
-
* 导航栏样式,仅支持 default/custom。custom即取消默认的原生导航栏,需看[使用注意](https://uniapp.dcloud.net.cn/collocation/pages.html#customnav)
|
|
197
|
-
* @default default
|
|
198
|
-
* @platform 微信小程序 7.0+、百度小程序、H5、App(2.0.3+)
|
|
199
|
-
*/
|
|
200
|
-
'navigationStyle'?: 'default' | 'custom';
|
|
201
|
-
/**
|
|
202
|
-
* 下拉显示出来的窗口的背景色
|
|
203
|
-
* @default #ffffff
|
|
204
|
-
* @platform 微信小程序
|
|
205
|
-
*/
|
|
206
|
-
'backgroundColor'?: string;
|
|
207
|
-
/**
|
|
208
|
-
* 下拉 loading 的样式,仅支持 dark / light
|
|
209
|
-
* @default dark
|
|
210
|
-
* @platform 微信小程序
|
|
211
|
-
*/
|
|
212
|
-
'backgroundTextStyle'?: 'dark' | 'light';
|
|
213
|
-
/**
|
|
214
|
-
* 是否开启下拉刷新,详见页面[生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)。
|
|
215
|
-
* @default false
|
|
216
|
-
*/
|
|
217
|
-
'enablePullDownRefresh'?: boolean;
|
|
218
|
-
/**
|
|
219
|
-
* 页面上拉触底事件触发时距页面底部距离,单位只支持px,详见页面[生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
|
220
|
-
* @default 50
|
|
221
|
-
*/
|
|
222
|
-
'onReachBottomDistance'?: number;
|
|
223
|
-
/**
|
|
224
|
-
* 顶部窗口的背景色(bounce回弹区域)
|
|
225
|
-
* @default #ffffff
|
|
226
|
-
* @platform 仅 iOS 平台
|
|
227
|
-
*/
|
|
228
|
-
'backgroundColorTop'?: string;
|
|
229
|
-
/**
|
|
230
|
-
* 底部窗口的背景色(bounce回弹区域)
|
|
231
|
-
* @default #ffffff
|
|
232
|
-
* @platform 仅 iOS 平台
|
|
233
|
-
*/
|
|
234
|
-
'backgroundColorBottom'?: string;
|
|
235
|
-
/**
|
|
236
|
-
* 导航栏图片地址(替换当前文字标题),支付宝小程序内必须使用https的图片链接地址
|
|
237
|
-
* @default ''
|
|
238
|
-
* @platform 支付宝小程序、H5、APP
|
|
239
|
-
*/
|
|
240
|
-
'titleImage'?: string;
|
|
241
|
-
/**
|
|
242
|
-
* 导航栏整体(前景、背景)透明设置。支持 always 一直透明 / auto 滑动自适应 / none 不透明
|
|
243
|
-
* @default none
|
|
244
|
-
* @platform 支付宝小程序、H5、APP
|
|
245
|
-
*/
|
|
246
|
-
'transparentTitle'?: 'always' | 'auto' | 'none';
|
|
247
|
-
/**
|
|
248
|
-
* 导航栏点击穿透
|
|
249
|
-
* @default NO
|
|
250
|
-
* @platform 支付宝小程序、H5
|
|
251
|
-
*/
|
|
252
|
-
'titlePenetrate'?: 'YES' | 'NO';
|
|
253
|
-
/**
|
|
254
|
-
* 横屏配置,屏幕旋转设置,仅支持 auto / portrait / landscape 详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
|
|
255
|
-
* @default portrait
|
|
256
|
-
* @platform App 2.4.7+、微信小程序、QQ小程序
|
|
257
|
-
*/
|
|
258
|
-
'pageOrientation'?: 'auto' | 'portrait' | 'landscape';
|
|
259
|
-
/**
|
|
260
|
-
* 窗口显示的动画效果,详见:[窗口动画](https://uniapp.dcloud.net.cn/api/router.html#animation)
|
|
261
|
-
* @default pop-in
|
|
262
|
-
* @platform App
|
|
263
|
-
*/
|
|
264
|
-
'animationType'?: string;
|
|
265
|
-
/**
|
|
266
|
-
* 窗口显示动画的持续时间,单位为 ms
|
|
267
|
-
* @default 300
|
|
268
|
-
* @platform App
|
|
269
|
-
*/
|
|
270
|
-
'animationDuration'?: number;
|
|
271
|
-
/**
|
|
272
|
-
* 设置为 true 则页面整体不能上下滚动。只在页面配置中有效,无法在 app.json 中设置
|
|
273
|
-
* @default false
|
|
274
|
-
*/
|
|
275
|
-
'disableScroll'?: boolean;
|
|
276
|
-
/**
|
|
277
|
-
* 设置编译到 App 平台的特定样式,配置项参考下方 [app-plus](https://uniapp.dcloud.net.cn/collocation/pages.html#app-plus)
|
|
278
|
-
* @platform App
|
|
279
|
-
*/
|
|
280
|
-
'app-plus'?: Record<string, any>;
|
|
281
|
-
/**
|
|
282
|
-
* 设置编译到 H5 平台的特定样式,配置项参考下方 [H5](https://uniapp.dcloud.net.cn/collocation/pages.html#h5)
|
|
283
|
-
* @platform H5
|
|
284
|
-
*/
|
|
285
|
-
'h5'?: Record<string, any>;
|
|
286
|
-
/**
|
|
287
|
-
* 设置编译到 mp-alipay 平台的特定样式,配置项参考下方 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-alipay)
|
|
288
|
-
* @platform 支付宝小程序
|
|
289
|
-
*/
|
|
290
|
-
'mp-alipay'?: Record<string, any>;
|
|
291
|
-
/**
|
|
292
|
-
* 设置编译到 mp-weixin 平台的特定样式,配置项参考下方 [MP-WEIXIN](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-weixin)
|
|
293
|
-
* @platform 微信小程序
|
|
294
|
-
*/
|
|
295
|
-
'mp-weixin'?: {
|
|
296
|
-
/**
|
|
297
|
-
* 在非首页、非页面栈最底层页面或非tabbar内页面中的导航栏展示home键
|
|
298
|
-
* @default true
|
|
299
|
-
*/
|
|
300
|
-
homeButton?: boolean;
|
|
301
|
-
/**
|
|
302
|
-
* 顶部窗口的背景色,仅 iOS 支持
|
|
303
|
-
* @default #ffffff
|
|
304
|
-
*/
|
|
305
|
-
backgroundColorTop?: string;
|
|
306
|
-
/**
|
|
307
|
-
* 底部窗口的背景色,仅 iOS 支持
|
|
308
|
-
* @default #ffffff
|
|
309
|
-
*/
|
|
310
|
-
backgroundColorBottom?: string;
|
|
311
|
-
/**
|
|
312
|
-
* 重新启动策略配置。支持 homePage / homePageAndLatestPage
|
|
313
|
-
* @default homePage
|
|
314
|
-
*/
|
|
315
|
-
restartStrategy?: 'homePage' | 'homePageAndLatestPage';
|
|
316
|
-
/**
|
|
317
|
-
* 页面初始渲染缓存配置。支持 static / dynamic
|
|
318
|
-
*/
|
|
319
|
-
initialRenderingCache?: 'static' | 'dynamic';
|
|
320
|
-
/**
|
|
321
|
-
* 切入系统后台时,隐藏页面内容,保护用户隐私。支持 hidden / none
|
|
322
|
-
* @default none
|
|
323
|
-
*/
|
|
324
|
-
visualEffectInBackground?: 'hidden' | 'none';
|
|
325
|
-
/**
|
|
326
|
-
* 控制预加载下个页面的时机。支持 static / manual / auto
|
|
327
|
-
* @default static
|
|
328
|
-
*/
|
|
329
|
-
handleWebviewPreload?: 'static' | 'manual' | 'auto';
|
|
330
|
-
};
|
|
331
|
-
/**
|
|
332
|
-
* 引用小程序的组件,参考 [小程序组件](https://uniapp.dcloud.net.cn/tutorial/miniprogram-subject.html#%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BB%84%E4%BB%B6%E6%94%AF%E6%8C%81)
|
|
333
|
-
*/
|
|
334
|
-
'usingComponents'?: Record<string, any>;
|
|
335
|
-
/**
|
|
336
|
-
* 同层渲染,webrtc(实时音视频) 无法正常时尝试配置 seperated 强制关掉同层
|
|
337
|
-
*/
|
|
338
|
-
'renderingMode'?: 'separated';
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
declare function defineMiniRouter(config: RouteConfig): RouteConfig;
|
|
342
|
-
declare function defineMiniTabbar(config: TabBar): TabBar;
|
|
343
|
-
|
|
344
|
-
interface BuilderOptions {
|
|
345
|
-
input?: string;
|
|
346
|
-
routeName?: string;
|
|
347
|
-
tabbarName?: string;
|
|
348
|
-
pagesPath?: string;
|
|
349
|
-
verbose?: boolean;
|
|
350
|
-
}
|
|
351
|
-
interface WatcherOptions {
|
|
352
|
-
delay?: number;
|
|
353
|
-
}
|
|
354
|
-
declare function builderWithWatch(options?: WatcherOptions & BuilderOptions): chokidar.FSWatcher;
|
|
355
|
-
declare function builder(options?: BuilderOptions): Promise<void>;
|
|
356
|
-
|
|
357
|
-
export { type Condition, type ConditionItem, type Easycom, type GlobalStyle, type PageStyle, type Pages, type PreloadRule, type Route, type RouteConfig, type SubPackage, type TabBar, type _RouteConfig, builder, builderWithWatch, defineMiniRouter, defineMiniTabbar };
|
|
1
|
+
import chokidar from 'chokidar';
|
|
2
|
+
|
|
3
|
+
type RouteConfig = _RouteConfig | _RouteConfig[];
|
|
4
|
+
interface _RouteConfig {
|
|
5
|
+
/**
|
|
6
|
+
* 当前页面显示的标题名称
|
|
7
|
+
* @deprecated replaced by title, will be removed in next minor version
|
|
8
|
+
*/
|
|
9
|
+
name?: string;
|
|
10
|
+
/**
|
|
11
|
+
* 当前页面显示的标题名称
|
|
12
|
+
*/
|
|
13
|
+
title?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 开启分包加载
|
|
16
|
+
* @deprecated replaced by isSubpackage, will be removed in next minor version
|
|
17
|
+
*/
|
|
18
|
+
subPackages?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 是否拆分为子包,path 转换为 root
|
|
21
|
+
*/
|
|
22
|
+
isSubpackage?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 是否为首页地址
|
|
25
|
+
*/
|
|
26
|
+
isIndex?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* 页面路径
|
|
29
|
+
*/
|
|
30
|
+
path: string;
|
|
31
|
+
/**
|
|
32
|
+
* 页面样式,其他配置
|
|
33
|
+
*/
|
|
34
|
+
style?: PageStyle;
|
|
35
|
+
children?: _RouteConfig[];
|
|
36
|
+
preLoadPath?: string | string[];
|
|
37
|
+
preLoadNetwork?: 'all' | 'wifi';
|
|
38
|
+
conditionActive?: boolean;
|
|
39
|
+
conditionQuery?: string;
|
|
40
|
+
}
|
|
41
|
+
type GlobalStyle = PageStyle;
|
|
42
|
+
interface Route {
|
|
43
|
+
path: string;
|
|
44
|
+
style?: PageStyle;
|
|
45
|
+
}
|
|
46
|
+
type Pages = Route[];
|
|
47
|
+
interface SubPackage {
|
|
48
|
+
root: string;
|
|
49
|
+
pages: Pages;
|
|
50
|
+
}
|
|
51
|
+
interface PreloadRule {
|
|
52
|
+
[key: string]: {
|
|
53
|
+
packages: string[];
|
|
54
|
+
/**
|
|
55
|
+
* @default 'wifi'
|
|
56
|
+
*/
|
|
57
|
+
network?: 'all' | 'wifi';
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
interface Easycom {
|
|
61
|
+
/**
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
autoscan?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* 自定义自动引入规则
|
|
67
|
+
*/
|
|
68
|
+
custom?: Record<string, string>;
|
|
69
|
+
}
|
|
70
|
+
interface TabBar {
|
|
71
|
+
/**
|
|
72
|
+
* tab 上的文字默认颜色
|
|
73
|
+
*/
|
|
74
|
+
color: string;
|
|
75
|
+
/**
|
|
76
|
+
* tab 上的文字选中时的颜色
|
|
77
|
+
*/
|
|
78
|
+
selectedColor: string;
|
|
79
|
+
/**
|
|
80
|
+
* tab 的背景色
|
|
81
|
+
*/
|
|
82
|
+
backgroundColor: string;
|
|
83
|
+
/**
|
|
84
|
+
* tabbar 上边框的颜色,可选值 black/white,也支持其他颜色值
|
|
85
|
+
* @default black
|
|
86
|
+
* @platform App 2.3.4+ 、H5 3.0.0+
|
|
87
|
+
*/
|
|
88
|
+
borderStyle?: string;
|
|
89
|
+
/**
|
|
90
|
+
* iOS 高斯模糊效果,可选值 dark/extralight/light/none(参考:[使用说明](https://ask.dcloud.net.cn/article/36617))
|
|
91
|
+
* @default none
|
|
92
|
+
* @platform App 2.4.0+ 支持、H5 3.0.0+(只有最新版浏览器才支持)
|
|
93
|
+
*/
|
|
94
|
+
blurEffect?: string;
|
|
95
|
+
/**
|
|
96
|
+
* tab 的列表,详见 list 属性说明,最少2个、最多5个 tab
|
|
97
|
+
*/
|
|
98
|
+
list: TabItem[];
|
|
99
|
+
/**
|
|
100
|
+
* 可选值 bottom、top
|
|
101
|
+
* @default bottom
|
|
102
|
+
* @platform top 值仅微信小程序支持
|
|
103
|
+
*/
|
|
104
|
+
position?: 'bottom' | 'top';
|
|
105
|
+
/**
|
|
106
|
+
* 文字默认大小
|
|
107
|
+
* @default 10px
|
|
108
|
+
* @platform App 2.3.4+、H5 3.0.0+
|
|
109
|
+
*/
|
|
110
|
+
fontSize?: string;
|
|
111
|
+
/**
|
|
112
|
+
* 图标默认宽度(高度等比例缩放)
|
|
113
|
+
* @default 24px
|
|
114
|
+
* @platform App 2.3.4+、H5 3.0.0+
|
|
115
|
+
*/
|
|
116
|
+
iconWidth?: string;
|
|
117
|
+
/**
|
|
118
|
+
* 图标和文字的间距
|
|
119
|
+
* @default 3px
|
|
120
|
+
* @platform App 2.3.4+、H5 3.0.0+
|
|
121
|
+
*/
|
|
122
|
+
spacing?: string;
|
|
123
|
+
/**
|
|
124
|
+
* tabBar 默认高度
|
|
125
|
+
* @default 50px
|
|
126
|
+
* @platform App 2.3.4+、H5 3.0.0+
|
|
127
|
+
*/
|
|
128
|
+
height?: string;
|
|
129
|
+
/**
|
|
130
|
+
* 中间按钮 仅在 list 项为偶数时有效
|
|
131
|
+
* @platform App 2.3.4+、H5 3.0.0+
|
|
132
|
+
*/
|
|
133
|
+
midButton?: object;
|
|
134
|
+
/**
|
|
135
|
+
* list设置 iconfont 属性时,需要指定字体文件路径
|
|
136
|
+
* @platform App 3.4.4+、H5 3.5.3+
|
|
137
|
+
*/
|
|
138
|
+
iconfontSrc?: string;
|
|
139
|
+
}
|
|
140
|
+
interface TabItem {
|
|
141
|
+
/**
|
|
142
|
+
* 页面路径,必须在 pages 中先定义
|
|
143
|
+
*/
|
|
144
|
+
pagePath: string;
|
|
145
|
+
/**
|
|
146
|
+
* tab 上按钮文字,在 App 和 H5 平台为非必填。例如中间可放一个没有文字的+号图标
|
|
147
|
+
*/
|
|
148
|
+
text: string;
|
|
149
|
+
/**
|
|
150
|
+
* 图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,当 position 为 top 时,此参数无效,不支持网络图片,不支持字体图标
|
|
151
|
+
*/
|
|
152
|
+
iconPath?: string;
|
|
153
|
+
/**
|
|
154
|
+
* 选中时的图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px ,当 position 为 top 时,此参数无效
|
|
155
|
+
*/
|
|
156
|
+
selectedIconPath?: string;
|
|
157
|
+
/**
|
|
158
|
+
* 该项是否显示,默认显示
|
|
159
|
+
* @platform App (3.2.10+)、H5 (3.2.10+)
|
|
160
|
+
*/
|
|
161
|
+
visible?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* 字体图标,优先级高于 iconPath
|
|
164
|
+
* @platform App(3.4.4+)、H5 (3.5.3+)
|
|
165
|
+
*/
|
|
166
|
+
iconfont?: object;
|
|
167
|
+
}
|
|
168
|
+
interface Condition {
|
|
169
|
+
current: number;
|
|
170
|
+
list: ConditionItem[];
|
|
171
|
+
}
|
|
172
|
+
interface ConditionItem {
|
|
173
|
+
name: string;
|
|
174
|
+
path: string;
|
|
175
|
+
query?: string;
|
|
176
|
+
}
|
|
177
|
+
interface PageStyle {
|
|
178
|
+
/**
|
|
179
|
+
* 导航栏背景颜色(同状态栏背景色)
|
|
180
|
+
* APP与H5为#F8F8F8,小程序平台请参考相应小程序文档
|
|
181
|
+
* @default #F8F8F8
|
|
182
|
+
*/
|
|
183
|
+
'navigationBarBackgroundColor'?: string;
|
|
184
|
+
/**
|
|
185
|
+
* 导航栏标题颜色及状态栏前景颜色,仅支持 black/white
|
|
186
|
+
* 支付宝小程序不支持,请使用 my.setNavigationBar
|
|
187
|
+
* @default black
|
|
188
|
+
*/
|
|
189
|
+
'navigationBarTextStyle'?: 'black' | 'white';
|
|
190
|
+
/**
|
|
191
|
+
* 导航栏标题文字内容
|
|
192
|
+
* @default ''
|
|
193
|
+
*/
|
|
194
|
+
'navigationBarTitleText'?: string;
|
|
195
|
+
/**
|
|
196
|
+
* 导航栏样式,仅支持 default/custom。custom即取消默认的原生导航栏,需看[使用注意](https://uniapp.dcloud.net.cn/collocation/pages.html#customnav)
|
|
197
|
+
* @default default
|
|
198
|
+
* @platform 微信小程序 7.0+、百度小程序、H5、App(2.0.3+)
|
|
199
|
+
*/
|
|
200
|
+
'navigationStyle'?: 'default' | 'custom';
|
|
201
|
+
/**
|
|
202
|
+
* 下拉显示出来的窗口的背景色
|
|
203
|
+
* @default #ffffff
|
|
204
|
+
* @platform 微信小程序
|
|
205
|
+
*/
|
|
206
|
+
'backgroundColor'?: string;
|
|
207
|
+
/**
|
|
208
|
+
* 下拉 loading 的样式,仅支持 dark / light
|
|
209
|
+
* @default dark
|
|
210
|
+
* @platform 微信小程序
|
|
211
|
+
*/
|
|
212
|
+
'backgroundTextStyle'?: 'dark' | 'light';
|
|
213
|
+
/**
|
|
214
|
+
* 是否开启下拉刷新,详见页面[生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)。
|
|
215
|
+
* @default false
|
|
216
|
+
*/
|
|
217
|
+
'enablePullDownRefresh'?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* 页面上拉触底事件触发时距页面底部距离,单位只支持px,详见页面[生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
|
|
220
|
+
* @default 50
|
|
221
|
+
*/
|
|
222
|
+
'onReachBottomDistance'?: number;
|
|
223
|
+
/**
|
|
224
|
+
* 顶部窗口的背景色(bounce回弹区域)
|
|
225
|
+
* @default #ffffff
|
|
226
|
+
* @platform 仅 iOS 平台
|
|
227
|
+
*/
|
|
228
|
+
'backgroundColorTop'?: string;
|
|
229
|
+
/**
|
|
230
|
+
* 底部窗口的背景色(bounce回弹区域)
|
|
231
|
+
* @default #ffffff
|
|
232
|
+
* @platform 仅 iOS 平台
|
|
233
|
+
*/
|
|
234
|
+
'backgroundColorBottom'?: string;
|
|
235
|
+
/**
|
|
236
|
+
* 导航栏图片地址(替换当前文字标题),支付宝小程序内必须使用https的图片链接地址
|
|
237
|
+
* @default ''
|
|
238
|
+
* @platform 支付宝小程序、H5、APP
|
|
239
|
+
*/
|
|
240
|
+
'titleImage'?: string;
|
|
241
|
+
/**
|
|
242
|
+
* 导航栏整体(前景、背景)透明设置。支持 always 一直透明 / auto 滑动自适应 / none 不透明
|
|
243
|
+
* @default none
|
|
244
|
+
* @platform 支付宝小程序、H5、APP
|
|
245
|
+
*/
|
|
246
|
+
'transparentTitle'?: 'always' | 'auto' | 'none';
|
|
247
|
+
/**
|
|
248
|
+
* 导航栏点击穿透
|
|
249
|
+
* @default NO
|
|
250
|
+
* @platform 支付宝小程序、H5
|
|
251
|
+
*/
|
|
252
|
+
'titlePenetrate'?: 'YES' | 'NO';
|
|
253
|
+
/**
|
|
254
|
+
* 横屏配置,屏幕旋转设置,仅支持 auto / portrait / landscape 详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
|
|
255
|
+
* @default portrait
|
|
256
|
+
* @platform App 2.4.7+、微信小程序、QQ小程序
|
|
257
|
+
*/
|
|
258
|
+
'pageOrientation'?: 'auto' | 'portrait' | 'landscape';
|
|
259
|
+
/**
|
|
260
|
+
* 窗口显示的动画效果,详见:[窗口动画](https://uniapp.dcloud.net.cn/api/router.html#animation)
|
|
261
|
+
* @default pop-in
|
|
262
|
+
* @platform App
|
|
263
|
+
*/
|
|
264
|
+
'animationType'?: string;
|
|
265
|
+
/**
|
|
266
|
+
* 窗口显示动画的持续时间,单位为 ms
|
|
267
|
+
* @default 300
|
|
268
|
+
* @platform App
|
|
269
|
+
*/
|
|
270
|
+
'animationDuration'?: number;
|
|
271
|
+
/**
|
|
272
|
+
* 设置为 true 则页面整体不能上下滚动。只在页面配置中有效,无法在 app.json 中设置
|
|
273
|
+
* @default false
|
|
274
|
+
*/
|
|
275
|
+
'disableScroll'?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* 设置编译到 App 平台的特定样式,配置项参考下方 [app-plus](https://uniapp.dcloud.net.cn/collocation/pages.html#app-plus)
|
|
278
|
+
* @platform App
|
|
279
|
+
*/
|
|
280
|
+
'app-plus'?: Record<string, any>;
|
|
281
|
+
/**
|
|
282
|
+
* 设置编译到 H5 平台的特定样式,配置项参考下方 [H5](https://uniapp.dcloud.net.cn/collocation/pages.html#h5)
|
|
283
|
+
* @platform H5
|
|
284
|
+
*/
|
|
285
|
+
'h5'?: Record<string, any>;
|
|
286
|
+
/**
|
|
287
|
+
* 设置编译到 mp-alipay 平台的特定样式,配置项参考下方 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-alipay)
|
|
288
|
+
* @platform 支付宝小程序
|
|
289
|
+
*/
|
|
290
|
+
'mp-alipay'?: Record<string, any>;
|
|
291
|
+
/**
|
|
292
|
+
* 设置编译到 mp-weixin 平台的特定样式,配置项参考下方 [MP-WEIXIN](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-weixin)
|
|
293
|
+
* @platform 微信小程序
|
|
294
|
+
*/
|
|
295
|
+
'mp-weixin'?: {
|
|
296
|
+
/**
|
|
297
|
+
* 在非首页、非页面栈最底层页面或非tabbar内页面中的导航栏展示home键
|
|
298
|
+
* @default true
|
|
299
|
+
*/
|
|
300
|
+
homeButton?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* 顶部窗口的背景色,仅 iOS 支持
|
|
303
|
+
* @default #ffffff
|
|
304
|
+
*/
|
|
305
|
+
backgroundColorTop?: string;
|
|
306
|
+
/**
|
|
307
|
+
* 底部窗口的背景色,仅 iOS 支持
|
|
308
|
+
* @default #ffffff
|
|
309
|
+
*/
|
|
310
|
+
backgroundColorBottom?: string;
|
|
311
|
+
/**
|
|
312
|
+
* 重新启动策略配置。支持 homePage / homePageAndLatestPage
|
|
313
|
+
* @default homePage
|
|
314
|
+
*/
|
|
315
|
+
restartStrategy?: 'homePage' | 'homePageAndLatestPage';
|
|
316
|
+
/**
|
|
317
|
+
* 页面初始渲染缓存配置。支持 static / dynamic
|
|
318
|
+
*/
|
|
319
|
+
initialRenderingCache?: 'static' | 'dynamic';
|
|
320
|
+
/**
|
|
321
|
+
* 切入系统后台时,隐藏页面内容,保护用户隐私。支持 hidden / none
|
|
322
|
+
* @default none
|
|
323
|
+
*/
|
|
324
|
+
visualEffectInBackground?: 'hidden' | 'none';
|
|
325
|
+
/**
|
|
326
|
+
* 控制预加载下个页面的时机。支持 static / manual / auto
|
|
327
|
+
* @default static
|
|
328
|
+
*/
|
|
329
|
+
handleWebviewPreload?: 'static' | 'manual' | 'auto';
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* 引用小程序的组件,参考 [小程序组件](https://uniapp.dcloud.net.cn/tutorial/miniprogram-subject.html#%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%87%AA%E5%AE%9A%E4%B9%89%E7%BB%84%E4%BB%B6%E6%94%AF%E6%8C%81)
|
|
333
|
+
*/
|
|
334
|
+
'usingComponents'?: Record<string, any>;
|
|
335
|
+
/**
|
|
336
|
+
* 同层渲染,webrtc(实时音视频) 无法正常时尝试配置 seperated 强制关掉同层
|
|
337
|
+
*/
|
|
338
|
+
'renderingMode'?: 'separated';
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
declare function defineMiniRouter(config: RouteConfig): RouteConfig;
|
|
342
|
+
declare function defineMiniTabbar(config: TabBar): TabBar;
|
|
343
|
+
|
|
344
|
+
interface BuilderOptions {
|
|
345
|
+
input?: string;
|
|
346
|
+
routeName?: string;
|
|
347
|
+
tabbarName?: string;
|
|
348
|
+
pagesPath?: string;
|
|
349
|
+
verbose?: boolean;
|
|
350
|
+
}
|
|
351
|
+
interface WatcherOptions {
|
|
352
|
+
delay?: number;
|
|
353
|
+
}
|
|
354
|
+
declare function builderWithWatch(options?: WatcherOptions & BuilderOptions): chokidar.FSWatcher;
|
|
355
|
+
declare function builder(options?: BuilderOptions): Promise<void>;
|
|
356
|
+
|
|
357
|
+
export { type Condition, type ConditionItem, type Easycom, type GlobalStyle, type PageStyle, type Pages, type PreloadRule, type Route, type RouteConfig, type SubPackage, type TabBar, type _RouteConfig, builder, builderWithWatch, defineMiniRouter, defineMiniTabbar };
|