uni-router-enhance 1.0.0

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.
@@ -0,0 +1,2977 @@
1
+ interface EasyCom {
2
+ /**
3
+ * 是否开启自动扫描,开启后将会自动扫描符合 `components/组件名称/组件名称.vue` 目录结构的组件
4
+ *
5
+ * @default true
6
+ */
7
+ autoscan?: boolean;
8
+ /**
9
+ * 以正则方式自定义组件匹配规则
10
+ *
11
+ * 如果 `autoscan` 不能满足需求,可以使用 `custom` 自定义匹配规则
12
+ *
13
+ * @example
14
+ * "custom": {
15
+ * "^uni-(.*)": "@/components/uni-$1.vue", // 匹配 components 目录内的 vue 文件
16
+ * "^vue-file-(.*)": "packageName/path/to/vue-file-$1.vue" // 匹配 node_modules 内的 vue 文件
17
+ * }
18
+ }
19
+ */
20
+ custom?: Record<string, string>;
21
+ }
22
+
23
+ /**
24
+ * 窗口动画,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router.html#animation)
25
+ */
26
+ type AnimationType =
27
+ | "slide-in-right"
28
+ | "slide-in-left"
29
+ | "slide-in-top"
30
+ | "slide-in-bottom"
31
+ | "pop-in"
32
+ | "fade-in"
33
+ | "zoom-out"
34
+ | "zoom-fade-out"
35
+ | "none";
36
+ interface TitleNViewButton {
37
+ /**
38
+ * 自定义按钮样式,详见 [自定义按钮样式](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons-type)
39
+ *
40
+ * "forward" 前进按钮
41
+ *
42
+ * "back" 后退按钮
43
+ *
44
+ * "share" 分享按钮
45
+ *
46
+ * "favorite" 收藏按钮
47
+ *
48
+ * "home" 主页按钮
49
+ *
50
+ * "menu" 菜单按钮
51
+ *
52
+ * "close" 关闭按钮
53
+ *
54
+ * "none" 无样式,需通过 text 属性设置按钮上显示的内容、通过 fontSrc 属性设置使用的字体库
55
+ *
56
+ * @default "none"
57
+ */
58
+ type?: "forward" | "back" | "share" | "favorite" | "home" | "menu" | "close" | "none";
59
+ /**
60
+ * 自定义按钮文字颜色,支持 HEX 颜色
61
+ *
62
+ * @default 与标题文字样式一样
63
+ *
64
+ * @format color
65
+ */
66
+ color?: string;
67
+ /**
68
+ * 自定义按钮背景色,仅在标题栏 type 为 "transparent" 时生效,支持 HEX 和 RGBA 颜色
69
+ *
70
+ * @default 灰色半透明
71
+ *
72
+ * @format color
73
+ */
74
+ background?: string;
75
+ /**
76
+ * 自定义按钮按下状态文字颜色,支持 HEX 和 RGBA 颜色
77
+ *
78
+ * @default color 属性值自动调整透明度为 0.3
79
+ *
80
+ * @format color
81
+ */
82
+ colorPressed?: string;
83
+ /**
84
+ * 自定义按钮在标题栏的显示位置,仅支持 "right" / "left"
85
+ *
86
+ * "right" 右侧
87
+ *
88
+ * "left" 左侧
89
+ *
90
+ * @default "right"
91
+ */
92
+ float?: "right" | "left";
93
+ /**
94
+ * 自定义按钮文字粗细,仅支持 "normal" | "bold"
95
+ *
96
+ * "normal" 标准
97
+ *
98
+ * "bold" 加粗
99
+ *
100
+ * @default "normal"
101
+ */
102
+ fontWeight?: "normal" | "bold";
103
+ /**
104
+ * 自定义按钮文字大小
105
+ */
106
+ fontSize?: string;
107
+ /**
108
+ * 自定义按钮字体文件路径,只支持本地地址
109
+ */
110
+ fontSrc?: string;
111
+ /**
112
+ * 自定义按钮是否显示选择指示图标(向下箭头),常用于城市选择
113
+ *
114
+ * @default false
115
+ */
116
+ select?: boolean;
117
+ /**
118
+ * 自定义按钮文字内容。使用字体图标时 unicode 字符表示必须以"\\u" 开头,如 "\\ue123"
119
+ */
120
+ text?: string;
121
+ /**
122
+ * 自定义按钮文字宽度,支持单位为 px 的逻辑像素值或 "auto",按钮内容居中显示
123
+ *
124
+ * @default "44px"
125
+ */
126
+ width?: string | "auto";
127
+ }
128
+ interface PageMetaDatum {
129
+ /**
130
+ * 配置页面路径
131
+ */
132
+ path: string;
133
+ type?: string;
134
+ /**
135
+ * 配置页面窗口表现,配置项参考下方 pageStyle
136
+ */
137
+ style?: GlobalStyle;
138
+ /**
139
+ * 当前页面是否需要登录才可以访问,此配置优先级高于 uniIdRouter 下的 needLogin
140
+ */
141
+ needLogin?: boolean;
142
+ [x: string]: any;
143
+ }
144
+ interface AppPlus {
145
+ /**
146
+ * 窗体背景色,支持 HEX 颜色
147
+ *
148
+ * 无论 vue 页面还是 nvue 页面,在 App 上都有一个父级原生窗体,该窗体的背景色生效时间快于页面里的 css 生效时间
149
+ *
150
+ * @default "#FFFFFF"
151
+ *
152
+ * @desc App (vue 页面需要将 body 背景色设为透明)
153
+ *
154
+ * @format color
155
+ */
156
+ background?: string;
157
+ /**
158
+ * 导航栏,详见 [导航栏](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview)
159
+ *
160
+ * 当 navigationStyle 设为 "custom" 或 titleNView 设为 false时,原生导航栏不显示,详见 [自定义导航栏使用注意](https://uniapp.dcloud.net.cn/collocation/pages#customnav)
161
+ */
162
+ titleNView?:
163
+ | false
164
+ | {
165
+ /**
166
+ * 背景颜色,支持 HEX 和 RGBA 颜色,App 端仅悬浮导航栏支持 RGBA 颜色
167
+ *
168
+ * @default "#F7F7F7"
169
+ *
170
+ * @format color
171
+ */
172
+ backgroundColor?: string;
173
+ /**
174
+ * 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons)
175
+ *
176
+ * @desc 纯 nvue 即 render:native 时暂不支持
177
+ */
178
+ buttons?: TitleNViewButton[];
179
+ /**
180
+ * 标题文字颜色,支持 HEX 颜色
181
+ *
182
+ * @default "#000000"
183
+ *
184
+ * @format color
185
+ */
186
+ titleColor?: string;
187
+ /**
188
+ * 标题文字超出显示区域时处理方式
189
+ *
190
+ * "ellipsis" 超出显示区域时尾部显示省略标记(...)
191
+ *
192
+ * "clip" 超出显示区域时内容裁剪
193
+ *
194
+ * @default "ellipsis"
195
+ */
196
+ titleOverflow?: "ellipsis" | "clip";
197
+ /**
198
+ * 标题文字内容
199
+ */
200
+ titleText?: string;
201
+ /**
202
+ * 标题文字大小
203
+ */
204
+ titleSize?: string;
205
+ /**
206
+ * 导航栏样式
207
+ *
208
+ * "default" 默认样式
209
+ *
210
+ * "transparent" 滚动透明渐变
211
+ *
212
+ * "float" 悬浮导航栏
213
+ *
214
+ * @default "default"
215
+ */
216
+ type?: "default" | "transparent" | "float";
217
+ /**
218
+ * 原生 View 增强,详见 [5+ View 控件](http://www.html5plus.org/doc/zh_cn/nativeobj.html#plus.nativeObj.ViewDrawTagStyles)
219
+ */
220
+ tags?: {
221
+ /**
222
+ * 绘制操作标识
223
+ *
224
+ * 可通过 view 对象的 drawBitmap / drawRect / drawText / clearRect 方法进行更新
225
+ */
226
+ id?: string;
227
+ /**
228
+ * 绘制操作类型
229
+ *
230
+ * "img" 绘制图片,与 drawBitmap 操作一致,此时 id、src、position、sprite 属性值有效
231
+ *
232
+ * "rect" 绘制矩形区域,与 drawRect 操作一致,此时 id、color、position、rectStyles 属性值有效
233
+ *
234
+ * "font" 绘制文本内容,与 drawText 操作一致,此时 id、position、text、textStyles 属性值有效
235
+ *
236
+ * "richtext" 绘制富文本内容,与 drawRichText 操作一致,此时 id、position、text、richTextStyles 属性值有效
237
+ *
238
+ * "input" 绘制输入框内容,此时 id、position、inputStyles 属性值有效
239
+ */
240
+ tag?: "img" | "rect" | "font" | "richtext" | "input";
241
+ /**
242
+ * 矩形区域颜色,支持 HEX 和 RGBA 颜色
243
+ *
244
+ * 不推荐使用,推荐使用 rectStyles
245
+ *
246
+ * 当 tag 属性值为 "rect" 时有效,用于指定矩形区域颜色
247
+ *
248
+ * @default "#FFFFFF"
249
+ *
250
+ * @format color
251
+ */
252
+ color?: string;
253
+ /**
254
+ * 绘制输入框的样式
255
+ *
256
+ * 当 tag 属性值为 "input" 时有效,用于指定绘制输入框的样式、大小位置等信息
257
+ */
258
+ inputStyles?: {
259
+ /**
260
+ * 输入框类型
261
+ *
262
+ * "email" 邮箱地址输入框
263
+ *
264
+ * "number" 数字输入框
265
+ *
266
+ * "search" 搜索文本输入框
267
+ *
268
+ * "tel" 电话号码输入框
269
+ *
270
+ * "text" 普通文本输入框
271
+ *
272
+ * "url" URL地址输入框
273
+ *
274
+ * @default "text"
275
+ */
276
+ type?: "email" | "number" | "search" | "tel" | "text" | "url";
277
+ /**
278
+ * 输入框的提示文本
279
+ *
280
+ * 当用户未输入内容时显示在编辑框中(灰色文字)。
281
+ */
282
+ placeholder?: string;
283
+ /**
284
+ * 输入框的字体大小,单位为 px
285
+ *
286
+ * @default "16px"
287
+ */
288
+ fontSize?: string;
289
+ /**
290
+ * 输入框的边框颜色,支持 HEX 颜色
291
+ *
292
+ * @default "#000000"
293
+ *
294
+ * @format color
295
+ */
296
+ borderColor?: string;
297
+ /**
298
+ * 输入框的边框圆角半径,单位为 px
299
+ *
300
+ * @default "0px"
301
+ */
302
+ borderRadius?: string;
303
+ /**
304
+ * 输入框的边框宽度,单位为 px
305
+ *
306
+ * @default "1px"
307
+ */
308
+ borderWidth?: string;
309
+ [x: string]: any;
310
+ };
311
+ /**
312
+ * 绘制内容区域,相对于 View 控件的区域信息
313
+ *
314
+ * 当 tag 属性值为 "img" 时,用于指定绘制图片的目标区域
315
+ *
316
+ * 当 tag 属性值为 "rect" 时,用于指定绘制的矩形区域
317
+ *
318
+ * 当 tag 属性值为 "font" 时,用于指定绘制文本的目标区域,此时 height 属性值支持设置为 "wrap_content",表示文本高度根据内容自动计算,此时通过 top 来定位文本绘制的起始位置
319
+ *
320
+ * @default { top: '0px', left: '0px', width: '100%', height: '100%' }
321
+ */
322
+ position?: {
323
+ /**
324
+ * 区域顶部相对于作用对象或容器向下的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
325
+ *
326
+ * @default "0px"
327
+ */
328
+ top?: string | string | "auto";
329
+ /**
330
+ * 区域顶部相对于作用对象或容器向右的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
331
+ *
332
+ * @default "0px"
333
+ */
334
+ left?: string | string | "auto";
335
+ /**
336
+ * 区域宽度,相对于作用对象或容器的宽度,支持单位为 px 的逻辑像素值或百分比
337
+ *
338
+ * @default "100%"
339
+ */
340
+ width?: string | string;
341
+ /**
342
+ * 区域高度,相对于作用对象或容器的高度,支持单位为 px 的逻辑像素值或百分比
343
+ *
344
+ * @default "100%"
345
+ */
346
+ height?: string | string;
347
+ /**
348
+ * 区域顶部相对于作用对象或容器向上的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
349
+ *
350
+ * 当设置了 top 和 height 值时,忽略此属性值
351
+ *
352
+ * 当未设置 top 值时,可通过 bottom 属性值来确定区域的垂直位置
353
+ *
354
+ * 当未设置 height 值时,可通过 top 和 bottom 属性值来确定区域的高度
355
+ */
356
+ bottom?: string | string | "auto";
357
+ /**
358
+ * 区域顶部相对于作用对象或容器向左的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
359
+ *
360
+ * 当设置了 left 和 width 值时,忽略此属性值
361
+ *
362
+ * 当未设置 left 值时,可通过 right 属性值来确定区域的水平位置
363
+ *
364
+ * 当未设置 width 值时,可通过 left 和 right 属性值来确定区域的宽度
365
+ */
366
+ right?: string | string | "auto";
367
+ [x: string]: any;
368
+ };
369
+ /**
370
+ * 绘制区域的样式
371
+ *
372
+ * 当 tag 属性值为 "rect" 时有效,用于指定绘制区域的样式、填充颜色、圆角大小等信息
373
+ */
374
+ rectStyles?: {
375
+ /**
376
+ * 绘制颜色,矩形填充区域的颜色,支持 HEX 和 RGBA 颜色
377
+ *
378
+ * @default "#FFFFFF"
379
+ *
380
+ * @format color
381
+ */
382
+ color?: string;
383
+ /**
384
+ * 矩形区域的圆角半径,单位为 px
385
+ *
386
+ * @default "0px"
387
+ */
388
+ radius?: string;
389
+ /**
390
+ * 矩形边框颜色,绘制矩形边框的颜色,支持 HEX 和 RGBA 颜色
391
+ *
392
+ * @default color 属性值
393
+ *
394
+ * @format color
395
+ */
396
+ borderColor?: string;
397
+ /**
398
+ * 矩形边框宽度,单位为 px
399
+ *
400
+ * @default "0px"
401
+ */
402
+ borderWidth?: string;
403
+ [x: string]: any;
404
+ };
405
+ /**
406
+ * 绘制的图片资源
407
+ *
408
+ * 当 tag 属性值为 "img" 时有效,可以是图片资源路径(字符串类型)或者图片对象(plus.nativeObj.Bitmap对象)
409
+ *
410
+ * src 路径支持 gif 图片,设置的图片路径文件使用 ".gif" 后缀时则认为是 gif 图片,如"_www/loading.gif"
411
+ */
412
+ src?: string;
413
+ /**
414
+ * 图片源的绘制区域
415
+ *
416
+ * 当 tag 属性值为 "img" 时有效,用于指定图片源的绘制区域,相对于图片的区域信息
417
+ *
418
+ * @default { top: '0px', left: '0px', width: '100%', height: '100%' }
419
+ */
420
+ sprite?: {
421
+ /**
422
+ * 区域顶部相对于作用对象或容器向下的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
423
+ *
424
+ * @default "0px"
425
+ */
426
+ top?: string | string | "auto";
427
+ /**
428
+ * 区域顶部相对于作用对象或容器向右的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
429
+ *
430
+ * @default "0px"
431
+ */
432
+ left?: string | string | "auto";
433
+ /**
434
+ * 区域宽度,相对于作用对象或容器的宽度,支持单位为 px 的逻辑像素值或百分比
435
+ *
436
+ * @default "100%"
437
+ */
438
+ width?: string | string;
439
+ /**
440
+ * 区域高度,相对于作用对象或容器的高度,支持单位为 px 的逻辑像素值或百分比
441
+ *
442
+ * @default "100%"
443
+ */
444
+ height?: string | string;
445
+ /**
446
+ * 区域顶部相对于作用对象或容器向上的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
447
+ *
448
+ * 当设置了 top 和 height 值时,忽略此属性值
449
+ *
450
+ * 当未设置 top 值时,可通过 bottom 属性值来确定区域的垂直位置
451
+ *
452
+ * 当未设置 height 值时,可通过 top 和 bottom 属性值来确定区域的高度
453
+ */
454
+ bottom?: string | string | "auto";
455
+ /**
456
+ * 区域顶部相对于作用对象或容器向左的偏移量,支持单位为 px 的逻辑像素值、百分比(相对于作用对象或容器的高度)或 "auto"
457
+ *
458
+ * 当设置了 left 和 width 值时,忽略此属性值
459
+ *
460
+ * 当未设置 left 值时,可通过 right 属性值来确定区域的水平位置
461
+ *
462
+ * 当未设置 width 值时,可通过 left 和 right 属性值来确定区域的宽度
463
+ */
464
+ right?: string | string | "auto";
465
+ [x: string]: any;
466
+ };
467
+ /**
468
+ * 绘制的文本内容
469
+ *
470
+ * 当 tag 属性值为 "font" 时有效,用于保存绘制的文本内容
471
+ */
472
+ text?: string;
473
+ /**
474
+ * 绘制文本的样式
475
+ *
476
+ * 当 tag 属性值为 "font" 时有效,用于指定绘制文本内容的字体大小、字体颜色、字体类型等信息
477
+ */
478
+ textStyles?: {
479
+ /**
480
+ * 水平对齐方式
481
+ *
482
+ * "left" 字体在指定的区域中水平居左对齐
483
+ *
484
+ * "center" 字体在指定的区域中水平居中对齐
485
+ *
486
+ * "right" 字体在指定的区域中水平居右对齐
487
+ *
488
+ * @default "center"
489
+ */
490
+ align?: "left" | "right" | "center";
491
+ /**
492
+ * 字体颜色,支持 HEX 和 RGBA 颜色
493
+ *
494
+ * @default "#000000"
495
+ *
496
+ * @format color
497
+ */
498
+ color?: string;
499
+ /**
500
+ * 文本装饰
501
+ *
502
+ * "none" 无装饰效果
503
+ *
504
+ * "underline" 文本带下划线效果
505
+ *
506
+ * "line-through" 文本带贯穿线(删除线)效果
507
+ *
508
+ * @default "none"
509
+ */
510
+ decoration?: "none" | "underline" | "line-through";
511
+ /**
512
+ * 字体名称,如果指定名称的字体不存在,则使用默认字体
513
+ */
514
+ family?: string;
515
+ /**
516
+ * 字体文件路径
517
+ */
518
+ fontSrc?: string;
519
+ /**
520
+ * 文本行间距,支持单位为 px 的逻辑像素值或百分比
521
+ *
522
+ * @default "20%"
523
+ */
524
+ lineSpacing?: string | string;
525
+ /**
526
+ * 文本间距,用于设置字体在绘制目标区域四个方向(top / right / bottom / left)的边距,支持单位为 px 的逻辑像素值或百分比(相对于绘制目标区域)
527
+ *
528
+ * @default "0px"
529
+ */
530
+ margin?: string;
531
+ /**
532
+ * 文本内容超出显示区域时处理方式
533
+ *
534
+ * "clip" 超出显示区域时内容裁剪
535
+ *
536
+ * "ellipsis" 超出显示区域时尾部显示省略标记(...)
537
+ *
538
+ * @default "clip"
539
+ */
540
+ overflow?: "clip" | "ellipsis";
541
+ /**
542
+ * 字体大小,单位为 px
543
+ *
544
+ * @default "16px"
545
+ */
546
+ size?: string;
547
+ /**
548
+ * 字体样式
549
+ *
550
+ * "normal" 正常样式
551
+ *
552
+ * "italic" 斜体样式
553
+ *
554
+ * @default "normal"
555
+ */
556
+ style?: "normal" | "italic";
557
+ /**
558
+ * 垂直对齐方式,文本内容在指定绘制区域中的垂直对齐方式
559
+ *
560
+ * "top" 垂直居顶对齐
561
+ *
562
+ * "middle" 垂直居中对齐
563
+ *
564
+ * "bottom" - 垂直居底对齐
565
+ *
566
+ * @default "middle"
567
+ */
568
+ verticalAlign?: "top" | "middle" | "bottom";
569
+ /**
570
+ * 字体粗细
571
+ *
572
+ * "normal" 正常
573
+ *
574
+ * "bold" 粗体
575
+ *
576
+ * @default "normal"
577
+ */
578
+ weight?: "normal" | "bold";
579
+ /**
580
+ * 文本换行模式
581
+ *
582
+ * "nowrap" 不换行,将所有文本在一行中绘制,忽略换行符("\n")
583
+ *
584
+ * "normal" 自动换行,当指定的宽度无法绘制所有文本时自动换行绘制,碰到 "\n" 字符时强制换行
585
+ *
586
+ * @default "nowrap"
587
+ */
588
+ whiteSpace?: "normal" | "nowrap";
589
+ [x: string]: any;
590
+ };
591
+ /**
592
+ * 绘制富文本的样式
593
+ *
594
+ * 当 tag 属性值为 "richtext" 时有效,用于指定绘制富文本内容的默认字体颜色、字体类型等信息
595
+ */
596
+ richTextStyles?: {
597
+ /**
598
+ * 富文本内容的水平对齐方式,对整体内容有效,无法单独控制每行的内容
599
+ *
600
+ * "left" 字体在指定的区域中水平居左对齐
601
+ *
602
+ * "center" 字体在指定的区域中水平居中对齐
603
+ *
604
+ * "right" 字体在指定的区域中水平居右对齐
605
+ *
606
+ * @default "left"
607
+ */
608
+ align?: "left" | "right" | "center";
609
+ /**
610
+ * 富文本默认使用的字体名称,如果指定名称的字体不存在,则使用默认字体
611
+ */
612
+ family?: string;
613
+ /**
614
+ * 富文本默认使用的字体文件路径,必须为本地路径,如果指定的文件路径无效,则使用系统默认字体
615
+ */
616
+ fontSrc?: string;
617
+ [x: string]: any;
618
+ };
619
+ [x: string]: any;
620
+ }[];
621
+ /**
622
+ * 原生导航栏上的搜索框配置,详见 [searchInput](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-searchinput)
623
+ *
624
+ * @desc 1.6.0
625
+ */
626
+ searchInput?: {
627
+ /**
628
+ * 是否自动获取焦点
629
+ *
630
+ * @default false
631
+ */
632
+ autoFocus?: boolean;
633
+ /**
634
+ * 非输入状态下文本的对齐方式
635
+ *
636
+ * "left" 居左对齐
637
+ *
638
+ * "right" 居右对齐
639
+ *
640
+ * "center" 居中对齐
641
+ *
642
+ * @default "center"
643
+ */
644
+ align?: "center" | "left" | "right";
645
+ /**
646
+ * 背景颜色,支持 HEX 和 RGBA 颜色
647
+ *
648
+ * @default "rgba(255,255,255,0.5)"
649
+ *
650
+ * @format color
651
+ */
652
+ backgroundColor?: string;
653
+ /**
654
+ * 输入框的圆角半径,单位为 px
655
+ *
656
+ * @default "0px"
657
+ */
658
+ borderRadius?: string;
659
+ /**
660
+ * 提示文本
661
+ */
662
+ placeholder?: string;
663
+ /**
664
+ * 提示文本颜色,支持 HEX 颜色
665
+ *
666
+ * @default "#CCCCCC"
667
+ *
668
+ * @format color
669
+ */
670
+ placeholderColor?: string;
671
+ /**
672
+ * 是否禁止输入
673
+ *
674
+ * @default false
675
+ */
676
+ disabled?: boolean;
677
+ [x: string]: any;
678
+ };
679
+ /**
680
+ * 标题栏控件是否显示 Home 按钮
681
+ *
682
+ * @default false
683
+ */
684
+ homeButton?: boolean;
685
+ /**
686
+ * 标题栏控件是否显示左侧返回按钮
687
+ *
688
+ * @desc App 2.6.3+
689
+ *
690
+ * @default true
691
+ */
692
+ autoBackButton?: boolean;
693
+ /**
694
+ * 返回按钮的样式,详见 [backButton](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-backbuttonstyles)
695
+ *
696
+ * @desc App 2.6.3
697
+ */
698
+ backButton?: {
699
+ /**
700
+ * 背景颜色,仅在标题栏 type 为 "transparent" 时生效,当标题栏透明时按钮显示的背景颜色,支持 HEX 和 RGBA 颜色
701
+ *
702
+ * @default 灰色半透明
703
+ *
704
+ * @format color
705
+ */
706
+ background?: string;
707
+ /**
708
+ * 角标文本,最多显示3个字符,超过则显示为 ...
709
+ */
710
+ badgeText?: string;
711
+ /**
712
+ * 图标和标题颜色,支持 HEX 和 RGBA 颜色
713
+ *
714
+ * @default 窗口标题栏控件的标题文字颜色
715
+ *
716
+ * @format color
717
+ */
718
+ color?: string;
719
+ /**
720
+ * 按下状态按钮文字颜色,支持 HEX 和 RGBA 颜色
721
+ *
722
+ * @default color 属性值自动调整透明度为 0.3
723
+ *
724
+ * @format color
725
+ */
726
+ colorPressed?: string;
727
+ /**
728
+ * 返回图标的粗细
729
+ *
730
+ * "normal" 正常
731
+ *
732
+ * "bold" 粗体
733
+ *
734
+ * @default "normal"
735
+ */
736
+ fontWeight?: "normal" | "bold";
737
+ /**
738
+ * 返回图标文字大小,单位为 px
739
+ *
740
+ * 窗口标题栏为透明样式 type 为 "transparent" 时,默认值为 "22px"
741
+ *
742
+ * 窗口标题栏为默认样式 type 为 "default" 时,默认值为 "27px"
743
+ */
744
+ fontSize?: string;
745
+ /**
746
+ * 是否显示红点,当设置了角标文本时红点不显示
747
+ *
748
+ * @default false
749
+ */
750
+ redDot?: boolean;
751
+ /**
752
+ * 返回按钮上的标题,显示在返回图标(字体图标)后
753
+ *
754
+ * @default ""
755
+ */
756
+ title?: string;
757
+ /**
758
+ * 返回按钮上标题的粗细
759
+ *
760
+ * "normal" 正常
761
+ *
762
+ * "bold" 粗体
763
+ */
764
+ titleWeight?: "normal" | "bold";
765
+ [x: string]: any;
766
+ };
767
+ /**
768
+ * 背景图片
769
+ *
770
+ * 背景图片路径,如 "/static/img.png",仅支持本地文件绝对路径,根据实际标题栏宽高拉伸绘制
771
+ *
772
+ * 渐变色,仅支持线性渐变,两种颜色的渐变,如 "linear-gradient(to top, #a80077, #66ff00)",其中第一个参数为渐变方向,可选 "to right"(从左向右渐变)/ "to left"(从右向左渐变)/ "to bottom"(从上到下渐变)/ "to top"(从下到上渐变)/ "to bottom right"(从左上到右下渐变)/"to top left"(从左上到右下渐变)
773
+ */
774
+ backgroundImage?: string;
775
+ /**
776
+ * 仅在 backgroundImage 设置为图片路径时有效
777
+ *
778
+ * "repeat" 背景图片在垂直方向和水平方向平铺
779
+ *
780
+ * "repeat-x" 背景图片在水平方向平铺,垂直方向拉伸
781
+ *
782
+ * "repeat-y" 背景图片在垂直方向平铺,水平方向拉伸
783
+ *
784
+ * "no-repeat" 背景图片在垂直方向和水平方向都拉伸
785
+ *
786
+ * @default "no-repeat"
787
+ */
788
+ backgroundRepeat?: "repeat" | "repeat-x" | "repeat-y" | "no-repeat";
789
+ /**
790
+ * 文本对齐方式
791
+ *
792
+ * "center" 居中对齐
793
+ *
794
+ * "left" 居左对齐
795
+ *
796
+ * "auto" 根据平台自动选择(Android 平台居左对齐,iOS 平台居中对齐)
797
+ *
798
+ * @default "auto"
799
+ */
800
+ titleAlign?: "auto" | "center" | "left";
801
+ /**
802
+ * 高斯模糊效果,仅在 type 为 "transparent" 或 "float" 时有效
803
+ *
804
+ * 使用模糊效果时应避免设置背景颜色,设置背景颜色可能覆盖模糊效果
805
+ *
806
+ * "dark" 暗风格模糊,对应 iOS 原生 UIBlurEffectStyleDark 效果
807
+ *
808
+ * "extralight" 高亮风格模糊,对应 iOS 原生 UIBlurEffectStyleExtraLight 效果
809
+ *
810
+ * "light" 亮风格模糊,对应 iOS 原生 UIBlurEffectStyleLight 效果
811
+ *
812
+ * "none" 无模糊效果
813
+ *
814
+ * @default "none"
815
+ */
816
+ blurEffect?: "dark" | "extralight" | "light" | "none";
817
+ /**
818
+ * 标题栏控件变化作用范围,仅在 type 为 "transparent" 时有效,页面滚动时标题栏背景透明度将发生变化
819
+ *
820
+ * 当页面滚动到指定偏移量时标题栏背景变为完全不透明
821
+ *
822
+ * 支持单位为 px 的逻辑像素值、百分比
823
+ *
824
+ * @default "132px"
825
+ */
826
+ coverage?: string | string;
827
+ /**
828
+ * 是否显示标题栏的底部分割线
829
+ *
830
+ * @desc 2.6.6
831
+ *
832
+ * @default false
833
+ */
834
+ splitLine?:
835
+ | boolean
836
+ | {
837
+ /**
838
+ * 底部分割线颜色,支持 HEX 和 RGBA 颜色
839
+ *
840
+ * @default "#CCCCCC"
841
+ *
842
+ * @format color
843
+ */
844
+ color?: string;
845
+ /**
846
+ * 底部分割线高度,支持单位为 px 的逻辑像素值、百分比
847
+ *
848
+ * @default "1px"
849
+ */
850
+ height?: string | string;
851
+ [x: string]: any;
852
+ };
853
+ /**
854
+ * 副标题文字颜色,支持 HEX 和 RGBA 颜色
855
+ *
856
+ * @desc 2.6.6
857
+ *
858
+ * @default 与主标题文字颜色一致
859
+ *
860
+ * @format color
861
+ */
862
+ subtitleColor?: string;
863
+ /**
864
+ * 副标题文字字体大小,单位为 px
865
+ *
866
+ * "auto" 自动计算,约为 12px
867
+ *
868
+ * @desc 2.6.6
869
+ *
870
+ * @default "auto"
871
+ */
872
+ subtitleSize?: string | "auto";
873
+ /**
874
+ * 标题文字超出显示区域时处理方式
875
+ *
876
+ * "clip" 超出显示区域时内容裁剪
877
+ *
878
+ * "ellipsis" 超出显示区域时尾部显示省略标记(...)
879
+ *
880
+ * @desc 2.6.6
881
+ *
882
+ * @default "ellipsis"
883
+ */
884
+ subtitleOverflow?: "clip" | "ellipsis";
885
+ /**
886
+ * 副标题文字内容,设置副标题后将显示两行标题,副标题显示在主标题(titleText)下方
887
+ *
888
+ * 设置副标题后将居左显示
889
+ *
890
+ * @desc 2.6.6
891
+ */
892
+ subtitleText?: string;
893
+ /**
894
+ * 标题图标,图标路径如 "./img/t.png",仅支持本地文件路径,相对路径,相对于当前页面的 host 位置,固定宽高为逻辑像素值 "34px"
895
+ *
896
+ * 图片的宽高需要相同
897
+ *
898
+ * 设置标题图标后标题将居左显示
899
+ *
900
+ * @desc 2.6.6
901
+ */
902
+ titleIcon?: string;
903
+ /**
904
+ * 标题图标圆角,单位为 px
905
+ *
906
+ * @default "0px"
907
+ */
908
+ titleIconRadius?: string;
909
+ [x: string]: any;
910
+ };
911
+ /**
912
+ * 原生子窗体,详见 [原生子窗体](https://uniapp.dcloud.net.cn/collocation/pages#app-subNVues)
913
+ *
914
+ * @desc App 1.9.10+
915
+ */
916
+ subNVues?: {
917
+ /**
918
+ * 原生子窗体的标识
919
+ */
920
+ id?: string;
921
+ /**
922
+ * 配置 nvue 文件路径,nvue 文件需放置到使用 subNVue 的页面文件目录下,cli 项目需要去掉 .nvue 后缀,只保留文件名
923
+ */
924
+ path?: string;
925
+ /**
926
+ * 原生子窗口内置样式
927
+ *
928
+ * "popup" 弹出层
929
+ *
930
+ * "navigationBar" 导航栏
931
+ */
932
+ type?: string;
933
+ /**
934
+ * 原生子窗体的样式
935
+ */
936
+ style?: {
937
+ /**
938
+ * 原生子窗体的排版位置,排版位置决定原生子窗体在父窗口中的定位方式
939
+ *
940
+ * "static" 原生子窗体在页面中正常定位,如果页面存在滚动条则随窗口内容滚动
941
+ *
942
+ * "absolute" 原生子窗体在页面中绝对定位,如果页面存在滚动条不随窗口内容滚动
943
+ *
944
+ * "dock" 原生子窗体在页面中停靠,停靠位置由 dock 属性值决定
945
+ *
946
+ * @default "absolute"
947
+ */
948
+ position?: "static" | "absolute" | "dock";
949
+ /**
950
+ * 原生子窗体停靠位置,仅 position 为 "dock" 时生效
951
+ *
952
+ * "top" 原生子窗体停靠在页面顶部
953
+ *
954
+ * "bottom" 原生子窗体停靠在页面底部
955
+ *
956
+ * "right" 原生子窗体停靠在页面右侧
957
+ *
958
+ * "left" 原生子窗体停靠在页面左侧
959
+ *
960
+ * @default "bottom"
961
+ */
962
+ dock?: "top" | "bottom" | "right" | "left";
963
+ /**
964
+ * 原生子窗体的遮罩层,仅当原生子窗体 type 为 "popup" 时生效,支持 RGBA 颜色
965
+ *
966
+ * @default "rgba(0,0,0,0.5)"
967
+ *
968
+ * @format color
969
+ */
970
+ mask?: string;
971
+ /**
972
+ * 原生子窗体的宽度,支持以 px 为单位的逻辑像素值或百分比
973
+ *
974
+ * 未设置时,可同时设置 left 和 right 属性值改变窗口的默认宽度
975
+ *
976
+ * @default "100%"
977
+ */
978
+ width?: string | string;
979
+ /**
980
+ * 原生子窗体的高度,支持以 px 为单位的逻辑像素值或百分比
981
+ *
982
+ * 未设置时,可同时设置 top 和 bottom 属性值改变窗口的默认高度
983
+ *
984
+ * @default "100%"
985
+ */
986
+ height?: string | string;
987
+ /**
988
+ * 原生子窗体垂直向下的偏移量,支持以 px 为单位的逻辑像素值或百分比
989
+ *
990
+ * 未设置 top 属性值时,优先通过 bottom 和 height 属性值来计算原生子窗体的 top 位置
991
+ *
992
+ * @default "0px"
993
+ */
994
+ top?: string | string;
995
+ /**
996
+ * 原生子窗体垂直向上的偏移量,支持以 px 为单位的逻辑像素值或百分比
997
+ *
998
+ * 同时设置了 top 和 height 值时,忽略此属性值
999
+ *
1000
+ * 未设置 height 时,通过 top 和 bottom 属性值来确定原生子窗体的高度
1001
+ *
1002
+ * @default 根据 top 和 height 属性值自动计算
1003
+ */
1004
+ bottom?: string | string;
1005
+ /**
1006
+ * 原生子窗体水平向左的偏移量,支持以 px 为单位的逻辑像素值或百分比
1007
+ *
1008
+ * 未设置 left 属性值时,优先通过 right 和 width 属性值来计算原生子窗体的 left 位置
1009
+ *
1010
+ * @default "0px"
1011
+ */
1012
+ left?: string | string;
1013
+ /**
1014
+ * 原生子窗体水平向右的偏移量,支持以 px 为单位的逻辑像素值或百分比
1015
+ *
1016
+ * 同时设置了 left 和 height 值时,忽略此属性值
1017
+ *
1018
+ * 未设置 width 时,通过 left 和 bottom 属性值来确定原生子窗体的宽度
1019
+ *
1020
+ * @default 根据 left 和 width 属性值来自动计算
1021
+ */
1022
+ right?: string | string;
1023
+ /**
1024
+ * 原生子窗体的边距,用于定位原生子窗体的位置,若设置了 left、right、top、bottom 则对应的边距值失效
1025
+ *
1026
+ * "auto" 居中
1027
+ */
1028
+ margin?: string;
1029
+ /**
1030
+ * 原生子窗体的窗口的堆叠顺序值,拥有更高堆叠顺序的窗口总是会处于堆叠顺序较低的窗口的前面,拥有相同堆叠顺序的窗口后调用 show 方法则在前面
1031
+ */
1032
+ zindex?: number;
1033
+ /**
1034
+ * 窗口的背景颜色,支持 Hex 颜色
1035
+ *
1036
+ * Android 平台 4.0 以上系统支持 "transparent" 背景透明样式,比如 subNVue 为圆角时需要设置为 "transparent" 才能看到正确的效果
1037
+ *
1038
+ * @default "#FFFFFF"
1039
+ *
1040
+ * @format color
1041
+ */
1042
+ background?: string | "transparent";
1043
+ [x: string]: any;
1044
+ };
1045
+ [x: string]: any;
1046
+ }[];
1047
+ /**
1048
+ * 页面回弹效果,设置为 "none" 时关闭效果
1049
+ *
1050
+ * @desc App-vue(nvue Android 无页面级bounce效果,仅 list、recycle-list、waterfall 等滚动组件有 bounce 效果)
1051
+ */
1052
+ bounce?: string;
1053
+ /**
1054
+ * 侧滑返回功能,仅支持 "close" / "none"
1055
+ *
1056
+ * "close" 启用侧滑返回
1057
+ *
1058
+ * "none" 禁用侧滑返回
1059
+ *
1060
+ * @default "close"
1061
+ *
1062
+ * @desc App-iOS
1063
+ */
1064
+ popGesture?: "close" | "none";
1065
+ /**
1066
+ * iOS 软键盘上完成工具栏的显示模式,设置为 "none" 时关闭工具栏
1067
+ *
1068
+ * @default "auto"
1069
+ *
1070
+ * @desc App-iOS
1071
+ */
1072
+ softInputNavBar?: "auto" | "none";
1073
+ /**
1074
+ * 软键盘弹出模式,仅支持 "adjustResize" / "adjustPan"
1075
+ *
1076
+ * @default "adjustPan"
1077
+ *
1078
+ * @desc App
1079
+ */
1080
+ softInputMode?: "adjustResize" | "adjustPan";
1081
+ /**
1082
+ * 下拉刷新
1083
+ *
1084
+ * @desc App
1085
+ */
1086
+ pullToRefresh?: {
1087
+ /**
1088
+ * 是否开启窗口下拉刷新
1089
+ *
1090
+ * @default false
1091
+ */
1092
+ support?: boolean;
1093
+ /**
1094
+ * 下拉刷新控件颜色,仅 style 为 "circle" 时有效,支持 HEX 颜色
1095
+ *
1096
+ * @default "#2BD009"
1097
+ *
1098
+ * @format color
1099
+ */
1100
+ color?: string;
1101
+ /**
1102
+ * 下拉刷新控件样式
1103
+ *
1104
+ * "default" 下拉拖动时页面内容跟随
1105
+ *
1106
+ * "circle" 下拉拖动时仅刷新控件跟随
1107
+ *
1108
+ * @default Android 为 "circle",iOS 为 "default"
1109
+ */
1110
+ style?: "default" | "circle";
1111
+ /**
1112
+ * 下拉刷新控件进入刷新状态的拉拽高度,支持以 px 为单位的逻辑像素值或百分比
1113
+ */
1114
+ height?: string | string;
1115
+ /**
1116
+ * 窗口可下拉拖拽的范围,支持以 px 为单位的逻辑像素值或百分比
1117
+ */
1118
+ range?: string | string;
1119
+ /**
1120
+ * 下拉刷新控件的起始位置,仅 style 为 "circle" 时有效,用于定义刷新控件下拉时的起始位置,支持以 px 为单位的逻辑像素值或百分比
1121
+ *
1122
+ * 如使用了非原生 title 且需要原生下拉刷新,一般都设置 style 为 "circle" 并将 offset 设置为自定义 title 的高度
1123
+ */
1124
+ offset?: string | string;
1125
+ /**
1126
+ * 下拉可刷新状态时配置,仅 style 为 "default" 时有效
1127
+ */
1128
+ contentdown?: {
1129
+ /**
1130
+ * 下拉可刷新状态时下拉刷新控件标题内容
1131
+ */
1132
+ caption?: string;
1133
+ [x: string]: any;
1134
+ };
1135
+ /**
1136
+ * 释放可刷新状态时配置,仅 style 为 "default" 时有效
1137
+ */
1138
+ contentover?: {
1139
+ /**
1140
+ * 释放可刷新状态时下拉刷新控件标题内容
1141
+ */
1142
+ caption?: string;
1143
+ [x: string]: any;
1144
+ };
1145
+ /**
1146
+ * 正在刷新状态时配置,仅 style 为 "default" 时有效
1147
+ */
1148
+ contentrefresh?: {
1149
+ /**
1150
+ * 正在刷新状态时下拉刷新控件标题内容
1151
+ */
1152
+ caption?: string;
1153
+ [x: string]: any;
1154
+ };
1155
+ [x: string]: any;
1156
+ };
1157
+ /**
1158
+ * 滚动条显示策略,设置为 "none" 时不显示滚动条
1159
+ *
1160
+ * @desc App
1161
+ */
1162
+ scrollIndicator?: string;
1163
+ /**
1164
+ * 窗口显示的动画效果,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router#animation)
1165
+ *
1166
+ * @default "pop-in"
1167
+ *
1168
+ * @desc App
1169
+ */
1170
+ animationType?: AnimationType;
1171
+ /**
1172
+ * 窗口显示动画的持续时间,单位为 ms
1173
+ *
1174
+ * @default 300
1175
+ *
1176
+ * @desc App
1177
+ */
1178
+ animationDuration?: number;
1179
+ [x: string]: any;
1180
+ }
1181
+
1182
+ interface H5 {
1183
+ /**
1184
+ * 导航栏,详见 [导航栏](https://uniapp.dcloud.net.cn/collocation/pages#h5-titlenview)
1185
+ */
1186
+ titleNView?:
1187
+ | false
1188
+ | {
1189
+ /**
1190
+ * 背景颜色,支持 HEX 颜色
1191
+ *
1192
+ * @default "#F7F7F7"
1193
+ *
1194
+ * @format color
1195
+ */
1196
+ backgroundColor?: string;
1197
+ /**
1198
+ * 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons)
1199
+ */
1200
+ buttons?: TitleNViewButton[];
1201
+ /**
1202
+ * 标题文字颜色,支持 HEX 颜色
1203
+ *
1204
+ * @default "#000000"
1205
+ *
1206
+ * @format color
1207
+ */
1208
+ titleColor?: string;
1209
+ /**
1210
+ * 标题文字内容
1211
+ */
1212
+ titleText?: string;
1213
+ /**
1214
+ * 标题文字大小
1215
+ */
1216
+ titleSize?: string;
1217
+ /**
1218
+ * 导航栏样式
1219
+ *
1220
+ * "default" 默认样式
1221
+ *
1222
+ * "transparent" 滚动透明渐变
1223
+ *
1224
+ * @default "default"
1225
+ */
1226
+ type?: "default" | "transparent";
1227
+ /**
1228
+ * 导航栏上的搜索框配置,详见 [searchInput](https://uniapp.dcloud.net.cn/collocation/pages#h5-searchinput)
1229
+ *
1230
+ * @desc 1.6.5
1231
+ */
1232
+ searchInput?: {
1233
+ /**
1234
+ * 是否自动获取焦点
1235
+ *
1236
+ * @default false
1237
+ */
1238
+ autoFocus?: boolean;
1239
+ /**
1240
+ * 非输入状态下文本的对齐方式
1241
+ *
1242
+ * "left" 居左对齐
1243
+ *
1244
+ * "right" 居右对齐
1245
+ *
1246
+ * "center" 居中对齐
1247
+ *
1248
+ * @default "center"
1249
+ */
1250
+ align?: "center" | "left" | "right";
1251
+ /**
1252
+ * 背景颜色,支持 HEX 和 RGBA 颜色
1253
+ *
1254
+ * @default "rgba(255,255,255,0.5)"
1255
+ *
1256
+ * @format color
1257
+ */
1258
+ backgroundColor?: string;
1259
+ /**
1260
+ * 输入框的圆角半径,单位为 px
1261
+ *
1262
+ * @default "0px"
1263
+ */
1264
+ borderRadius?: string;
1265
+ /**
1266
+ * 提示文本
1267
+ */
1268
+ placeholder?: string;
1269
+ /**
1270
+ * 提示文本颜色,支持 HEX 颜色
1271
+ *
1272
+ * @default "#CCCCCC"
1273
+ *
1274
+ * @format color
1275
+ */
1276
+ placeholderColor?: string;
1277
+ /**
1278
+ * 是否禁止输入
1279
+ *
1280
+ * @default false
1281
+ */
1282
+ disabled?: boolean;
1283
+ [x: string]: any;
1284
+ };
1285
+ [x: string]: any;
1286
+ };
1287
+ /**
1288
+ * 下拉刷新,详见 [下拉刷新](https://uniapp.dcloud.net.cn/collocation/pages#h5-pulltorefresh)
1289
+ */
1290
+ pullToRefresh?: {
1291
+ /**
1292
+ * 下拉刷新控件颜色,支持 HEX 颜色
1293
+ *
1294
+ * @default "#2BD009"
1295
+ */
1296
+ color?: string;
1297
+ /**
1298
+ * 下拉刷新控件起始位置,支持支持单位为 px 的逻辑像素值或百分比
1299
+ *
1300
+ * @default "0px"
1301
+ */
1302
+ offset?: string | string;
1303
+ [x: string]: any;
1304
+ };
1305
+ [x: string]: any;
1306
+ }
1307
+
1308
+ /**
1309
+ * 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay) 和 <https://opendocs.alipay.com/mini/framework/app-json#window>
1310
+ *
1311
+ * 相应的类型是 MpAlipay
1312
+ *
1313
+ * @desc 支付宝小程序
1314
+ */
1315
+ interface MpAlipay {
1316
+ /**
1317
+ * 是否允许向下拉拽
1318
+ *
1319
+ * @default "YES"
1320
+ */
1321
+ allowsBounceVertical?: "YES" | "NO";
1322
+ /**
1323
+ * 窗口的背景色,支持 HEX 颜色
1324
+ *
1325
+ * @format color
1326
+ */
1327
+ backgroundColor?: string | string;
1328
+ /**
1329
+ * 下拉露出显示背景图的底色,仅 Android 有效,iOS 下页面背景图底色会使用 backgroundColor 的值
1330
+ *
1331
+ * @format color
1332
+ */
1333
+ backgroundImageColor?: string;
1334
+ /**
1335
+ * 下拉露出显示背景图的链接,支持网络地址和本地地址,尽量使用绝对地址
1336
+ */
1337
+ backgroundImageUrl?: string;
1338
+ /**
1339
+ * 页面默认标题
1340
+ */
1341
+ defaultTitle?: string;
1342
+ /**
1343
+ * 仅支持 Android,是否显示 WebView 滚动条
1344
+ *
1345
+ * @default "YES"
1346
+ */
1347
+ enableScrollBar?: "YES" | "NO";
1348
+ /**
1349
+ * 仅支持 iOS,是否支持手势返回
1350
+ *
1351
+ * @default "YES"
1352
+ */
1353
+ gestureBack?: "YES" | "NO";
1354
+ /**
1355
+ * 页面上拉触底时触发时距离页面底部的距离,单位为 px,详情可查看 [页面事件处理函数](https://opendocs.alipay.com/mini/framework/page-detail#%E9%A1%B5%E9%9D%A2%E4%BA%8B%E4%BB%B6%E5%A4%84%E7%90%86%E5%87%BD%E6%95%B0)
1356
+ *
1357
+ * @desc [1.19.0](https://opendocs.alipay.com/mini/framework/compatibility),目前 iOS 在 page.json 下设置无效,只能全局设置
1358
+ */
1359
+ onReachBottomDistance?: number;
1360
+ /**
1361
+ * 是否允许下拉刷新,allowsBounceVertical 值需要为 "YES",全局配置后全局生效,但是如果单个页面配置了该参数,以页面的配置为准
1362
+ *
1363
+ * @default false
1364
+ */
1365
+ pullRefresh?: boolean;
1366
+ /**
1367
+ * rpx 单位是否宽度自适应
1368
+ *
1369
+ * 当设置为 false 时,2 rpx 将恒等于 1 px,不再根据屏幕宽度进行自适应,此时 750 rpx 将不再等于 100% 宽度
1370
+ *
1371
+ * @desc [1.23.0](https://opendocs.alipay.com/mini/framework/compatibility)
1372
+ *
1373
+ * @default true
1374
+ */
1375
+ responsive?: boolean;
1376
+ /**
1377
+ * 是否进入时显示导航栏的 loading
1378
+ *
1379
+ * @default "NO"
1380
+ */
1381
+ showTitleLoading?: "YES" | "NO";
1382
+ /**
1383
+ * 导航栏透明设置
1384
+ *
1385
+ * always 一直透明
1386
+ *
1387
+ * auto 滑动自适应
1388
+ *
1389
+ * none 不透明
1390
+ *
1391
+ * @default "none"
1392
+ */
1393
+ transparentTitle?: "always" | "auto" | "none";
1394
+ /**
1395
+ * 导航栏点击穿透
1396
+ *
1397
+ * @default "NO"
1398
+ */
1399
+ titlePenetrate?: "YES" | "NO";
1400
+ /**
1401
+ * 导航栏图片地址,会替换当前文字标题,只支持 https 图片链接
1402
+ */
1403
+ titleImage?: string;
1404
+ /**
1405
+ * 导航栏背景色,支持 HEX 颜色
1406
+ */
1407
+ titleBarColor?: string;
1408
+ /**
1409
+ * 导航栏前景色
1410
+ *
1411
+ * @desc [支付宝客户端 10.5.30](https://opendocs.alipay.com/mini/framework/compatibility)
1412
+ */
1413
+ navigationBarFrontColor?: "black" | "white";
1414
+ [x: string]: any;
1415
+ }
1416
+
1417
+ /**
1418
+ * 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu) 和 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
1419
+ *
1420
+ * 相应的类型是 MpBaidu
1421
+ *
1422
+ * @desc 百度小程序
1423
+ */
1424
+ interface MpBaidu {
1425
+ /**
1426
+ * 导航栏背景颜色,支持 HEX 颜色
1427
+ *
1428
+ * @default "#000000"
1429
+ *
1430
+ * @format color
1431
+ */
1432
+ navigationBarBackgroundColor?: string | string;
1433
+ /**
1434
+ * 导航栏标题、状态栏颜色
1435
+ *
1436
+ * @default "white"
1437
+ */
1438
+ navigationBarTextStyle?: "black" | "white" | string;
1439
+ /**
1440
+ * 导航栏标题文字内容
1441
+ */
1442
+ navigationBarTitleText?: string;
1443
+ /**
1444
+ * 导航栏样式
1445
+ *
1446
+ * "default" 默认样式
1447
+ *
1448
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1449
+ *
1450
+ * @desc 2.10.34
1451
+ *
1452
+ * @default "default"
1453
+ */
1454
+ navigationStyle?: "default" | "custom";
1455
+ /**
1456
+ * 窗口的背景色,支持 HEX 颜色
1457
+ *
1458
+ * @default "#FFFFFF"
1459
+ */
1460
+ backgroundColor?: string | string;
1461
+ /**
1462
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1463
+ *
1464
+ * @default "dark"
1465
+ */
1466
+ backgroundTextStyle?: "dark" | "light" | string;
1467
+ /**
1468
+ * 顶部窗口的背景色,仅 iOS 支持
1469
+ *
1470
+ * @default "#FFFFFF"
1471
+ */
1472
+ backgroundColorTop?: string | string;
1473
+ /**
1474
+ * 底部窗口的背景色,仅 iOS 支持
1475
+ *
1476
+ * @default "#FFFFFF"
1477
+ */
1478
+ backgroundColorBottom?: string | string;
1479
+ /**
1480
+ * 是否开启全局的下拉刷新
1481
+ *
1482
+ * @default false
1483
+ */
1484
+ enablePullDownRefresh?: boolean;
1485
+ /**
1486
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px
1487
+ *
1488
+ * @default 50
1489
+ */
1490
+ onReachBottomDistance?: number;
1491
+ /**
1492
+ * 小程序页面是否禁止响应字体大小的设置
1493
+ *
1494
+ * "auto" 默认响应
1495
+ *
1496
+ * "none" 不响应
1497
+ *
1498
+ * @desc 基础库版本 3.200.1
1499
+ *
1500
+ * @default "auto"
1501
+ */
1502
+ textSizeAdjust?: "auto" | "none";
1503
+ /**
1504
+ * 屏幕旋转设置,支持 auto / portrait / landscape
1505
+ *
1506
+ * "auto" 自动
1507
+ *
1508
+ * "portrait" 竖屏
1509
+ *
1510
+ * "landscape" 横屏
1511
+ *
1512
+ * @desc 基础库版本 3.450.8,web 化暂不支持
1513
+ *
1514
+ * @default "portrait"
1515
+ */
1516
+ pageOrientation?: "auto" | "portrait" | "landscape";
1517
+ [x: string]: any;
1518
+ }
1519
+
1520
+ /**
1521
+ * 设置编译到 mp-jd 平台的特定样式,配置项参考 <https://mp-docs.jd.com/doc/dev/framework/504#heading-3>
1522
+ *
1523
+ * 相应的类型是 MpJd
1524
+ *
1525
+ * @desc 京东小程序
1526
+ */
1527
+ interface MpJd {
1528
+ /**
1529
+ * 导航栏背景颜色,支持 HEX 颜色
1530
+ *
1531
+ * @default "#000000"
1532
+ *
1533
+ * @format color
1534
+ */
1535
+ navigationBarBackgroundColor?: string | string;
1536
+ /**
1537
+ * 导航栏标题、状态栏颜色
1538
+ *
1539
+ * @default "white"
1540
+ */
1541
+ navigationBarTextStyle?: "black" | "white" | string;
1542
+ /**
1543
+ * 导航栏标题文字内容
1544
+ */
1545
+ navigationBarTitleText?: string;
1546
+ /**
1547
+ * 导航栏样式
1548
+ *
1549
+ * "default" 默认样式
1550
+ *
1551
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1552
+ *
1553
+ * @default "default"
1554
+ */
1555
+ navigationStyle?: "default" | "custom";
1556
+ /**
1557
+ * 下拉窗口的背景色,不是页面的背景颜色
1558
+ *
1559
+ * @default "#FFFFFF"
1560
+ */
1561
+ backgroundColor?: string | string;
1562
+ /**
1563
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1564
+ *
1565
+ * @default "dark"
1566
+ */
1567
+ backgroundTextStyle?: "dark" | "light" | string;
1568
+ /**
1569
+ * 顶部窗口的背景色,仅 iOS 支持
1570
+ *
1571
+ * @default "#FFFFFF"
1572
+ */
1573
+ backgroundColorTop?: string | string;
1574
+ /**
1575
+ * 底部窗口的背景色,仅 iOS 支持
1576
+ *
1577
+ * @default "#FFFFFF"
1578
+ */
1579
+ backgroundColorBottom?: string | string;
1580
+ /**
1581
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://mp-docs.jd.com/doc/dev/framework/520#heading-10)
1582
+ *
1583
+ * @default false
1584
+ */
1585
+ enablePullDownRefresh?: boolean;
1586
+ [x: string]: any;
1587
+ }
1588
+
1589
+ /**
1590
+ * 设置编译到 mp-kuaishou 平台的特定样式,配置项参考 <https://mp.kuaishou.com/docs/develop/frame/config/conf_appjson.html#window>
1591
+ *
1592
+ * 相应的类型是 MpKuaishou
1593
+ *
1594
+ * @desc 快手小程序
1595
+ */
1596
+ interface MpKuaishou {
1597
+ /**
1598
+ * 导航栏背景颜色,支持 HEX 颜色
1599
+ *
1600
+ * @default "#000000"
1601
+ *
1602
+ * @format color
1603
+ */
1604
+ navigationBarBackgroundColor?: string | string;
1605
+ /**
1606
+ * 导航栏标题、状态栏颜色
1607
+ *
1608
+ * @default "white"
1609
+ */
1610
+ navigationBarTextStyle?: "black" | "white" | string;
1611
+ /**
1612
+ * 导航栏标题文字内容
1613
+ */
1614
+ navigationBarTitleText?: string;
1615
+ /**
1616
+ * 导航栏样式
1617
+ *
1618
+ * "default" 默认样式
1619
+ *
1620
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1621
+ *
1622
+ * @default "default"
1623
+ */
1624
+ navigationStyle?: "default" | "custom";
1625
+ /**
1626
+ * 窗口的背景色,支持 HEX 颜色
1627
+ *
1628
+ * @default "#FFFFFF"
1629
+ */
1630
+ backgroundColor?: string | string;
1631
+ /**
1632
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1633
+ *
1634
+ * @default "dark"
1635
+ */
1636
+ backgroundTextStyle?: "dark" | "light" | string;
1637
+ /**
1638
+ * 顶部窗口的背景色,仅 iOS 支持
1639
+ *
1640
+ * @default "#FFFFFF"
1641
+ */
1642
+ backgroundColorTop?: string | string;
1643
+ /**
1644
+ * 底部窗口的背景色,仅 iOS 支持
1645
+ *
1646
+ * @default "#FFFFFF"
1647
+ */
1648
+ backgroundColorBottom?: string | string;
1649
+ /**
1650
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://mp.kuaishou.com/docs/develop/frame/page/page_page.html#onpulldownrefresh)
1651
+ *
1652
+ * @default false
1653
+ */
1654
+ enablePullDownRefresh?: boolean;
1655
+ /**
1656
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [Page.onReachBottom](https://mp.kuaishou.com/docs/develop/frame/page/page_page.html#onreachbottom)
1657
+ *
1658
+ * @default 50
1659
+ */
1660
+ onReachBottomDistance?: number;
1661
+ /**
1662
+ * 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
1663
+ *
1664
+ * "auto" 自动
1665
+ *
1666
+ * "portrait" 竖屏
1667
+ *
1668
+ * "landscape" 横屏
1669
+ *
1670
+ * @default "portrait"
1671
+ */
1672
+ pageOrientation?: "auto" | "portrait" | "landscape";
1673
+ [x: string]: any;
1674
+ }
1675
+
1676
+ /**
1677
+ * 设置编译到 mp-lark 平台的特定样式,配置项参考 <https://open.feishu.cn/document/client-docs/gadget/introduction/global-settings#a172b7dd>
1678
+ *
1679
+ * 相应的类型是 MpLark
1680
+ *
1681
+ * @desc 飞书小程序
1682
+ */
1683
+ interface MpLark {
1684
+ /**
1685
+ * 导航栏背景颜色,支持 HEX 颜色
1686
+ *
1687
+ * @desc iOS, Android
1688
+ *
1689
+ * @default "#000000"
1690
+ *
1691
+ * @format color
1692
+ */
1693
+ navigationBarBackgroundColor?: string | string;
1694
+ /**
1695
+ * 导航栏标题、状态栏颜色
1696
+ *
1697
+ * @desc iOS, Android
1698
+ *
1699
+ * @default "white"
1700
+ */
1701
+ navigationBarTextStyle?: "black" | "white" | string;
1702
+ /**
1703
+ * 导航栏标题文字内容
1704
+ *
1705
+ * @desc iOS, Android, PC
1706
+ */
1707
+ navigationBarTitleText?: string;
1708
+ /**
1709
+ * 导航栏透明设置
1710
+ *
1711
+ * "always" 一直透明
1712
+ *
1713
+ * "auto" 滑动自适应
1714
+ *
1715
+ * "none" 不透明
1716
+ *
1717
+ * @desc iOS, Android
1718
+ *
1719
+ * @default "none"
1720
+ */
1721
+ transparentTitle?: "always" | "auto" | "none";
1722
+ /**
1723
+ * 导航栏样式
1724
+ *
1725
+ * "default" 默认样式
1726
+ *
1727
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1728
+ *
1729
+ * @desc iOS, Android, PC
1730
+ *
1731
+ * @default "default"
1732
+ */
1733
+ navigationStyle?: "default" | "custom";
1734
+ /**
1735
+ * 窗口的背景色,支持 HEX 颜色
1736
+ *
1737
+ * @desc iOS, Android, PC(3.14.0+)
1738
+ *
1739
+ * @default "#FFFFFF"
1740
+ */
1741
+ backgroundColor?: string | string;
1742
+ /**
1743
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1744
+ *
1745
+ * @desc iOS, Android
1746
+ *
1747
+ * @default "dark"
1748
+ */
1749
+ backgroundTextStyle?: "dark" | "light" | string;
1750
+ /**
1751
+ * 顶部窗口的背景色
1752
+ *
1753
+ * @desc iOS
1754
+ *
1755
+ * @default "#FFFFFF"
1756
+ */
1757
+ backgroundColorTop?: string | string;
1758
+ /**
1759
+ * 底部窗口的背景色
1760
+ *
1761
+ * @desc iOS
1762
+ *
1763
+ * @default "#FFFFFF"
1764
+ */
1765
+ backgroundColorBottom?: string | string;
1766
+ /**
1767
+ * 是否开启全局的下拉刷新
1768
+ *
1769
+ * @desc iOS, Android
1770
+ *
1771
+ * @default false
1772
+ */
1773
+ enablePullDownRefresh?: boolean;
1774
+ /**
1775
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px
1776
+ *
1777
+ * @desc iOS, Android
1778
+ *
1779
+ * @default 50
1780
+ */
1781
+ onReachBottomDistance?: number;
1782
+ /**
1783
+ * PCMode 模式下特定的窗口配置,支持的属性与通用 window 配置属性一致,仅当在 ext 内配置了 defaultPages.PCMode 时生效
1784
+ */
1785
+ PCMode?: Omit<MpLark, "PCMode">;
1786
+ [x: string]: any;
1787
+ }
1788
+
1789
+ /**
1790
+ * 设置编译到 mp-qq 平台的特定样式,配置项参考 <https://q.qq.com/wiki/develop/miniprogram/frame/dispose.html#window>
1791
+ *
1792
+ * 相应的类型是 MpQq
1793
+ *
1794
+ * @desc QQ 小程序
1795
+ */
1796
+ interface MpQq {
1797
+ /**
1798
+ * 导航栏背景颜色,支持 HEX 颜色
1799
+ *
1800
+ * @default "#000000"
1801
+ *
1802
+ * @format color
1803
+ */
1804
+ navigationBarBackgroundColor?: string | string;
1805
+ /**
1806
+ * 导航栏标题、状态栏颜色
1807
+ *
1808
+ * @default "white"
1809
+ */
1810
+ navigationBarTextStyle?: "black" | "white" | string;
1811
+ /**
1812
+ * 导航栏标题文字内容
1813
+ */
1814
+ navigationBarTitleText?: string;
1815
+ /**
1816
+ * 导航栏样式
1817
+ *
1818
+ * "default" 默认样式
1819
+ *
1820
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1821
+ *
1822
+ * @default "default"
1823
+ */
1824
+ navigationStyle?: "default" | "custom";
1825
+ /**
1826
+ * 窗口的背景色,支持 HEX 颜色
1827
+ *
1828
+ * @default "#FFFFFF"
1829
+ */
1830
+ backgroundColor?: string | string;
1831
+ /**
1832
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1833
+ *
1834
+ * @default "dark"
1835
+ */
1836
+ backgroundTextStyle?: "dark" | "light" | string;
1837
+ /**
1838
+ * 顶部窗口的背景色,仅 iOS 支持
1839
+ *
1840
+ * @default "#FFFFFF"
1841
+ */
1842
+ backgroundColorTop?: string | string;
1843
+ /**
1844
+ * 底部窗口的背景色,仅 iOS 支持
1845
+ *
1846
+ * @default "#FFFFFF"
1847
+ */
1848
+ backgroundColorBottom?: string | string;
1849
+ /**
1850
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://q.qq.com/wiki/develop/miniprogram/frame/logic/logic_register_page.html#onPullDownRefresh)
1851
+ *
1852
+ * @default false
1853
+ */
1854
+ enablePullDownRefresh?: boolean;
1855
+ /**
1856
+ * 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://q.qq.com/wiki/develop/miniprogram/frame/view/view_section_change.html)
1857
+ *
1858
+ * "auto" 自动
1859
+ *
1860
+ * "portrait" 竖屏
1861
+ *
1862
+ * "landscape" 横屏
1863
+ *
1864
+ * @default "portrait"
1865
+ */
1866
+ pageOrientation?: "auto" | "portrait" | "landscape";
1867
+ [x: string]: any;
1868
+ }
1869
+
1870
+ /**
1871
+ * 设置编译到 mp-toutiao 平台的特定样式,配置项参考 <https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/general-configuration#window>
1872
+ *
1873
+ * 相应的类型是 MpToutiao
1874
+ *
1875
+ * @desc 抖音小程序
1876
+ */
1877
+ interface MpToutiao {
1878
+ /**
1879
+ * 导航栏背景颜色,支持 HEX 颜色
1880
+ *
1881
+ * @default "#000000"
1882
+ *
1883
+ * @format color
1884
+ */
1885
+ navigationBarBackgroundColor?: string | string;
1886
+ /**
1887
+ * 导航栏标题颜色,同时影响标题颜色、右胶囊颜色、左返回箭头颜色
1888
+ *
1889
+ * @default "white"
1890
+ */
1891
+ navigationBarTextStyle?: "black" | "white" | string;
1892
+ /**
1893
+ * 导航栏标题文字内容
1894
+ */
1895
+ navigationBarTitleText?: string;
1896
+ /**
1897
+ * 导航栏样式
1898
+ *
1899
+ * "default" 默认样式
1900
+ *
1901
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
1902
+ *
1903
+ * @default "default"
1904
+ */
1905
+ navigationStyle?: "default" | "custom";
1906
+ /**
1907
+ * 窗口的背景色,支持 HEX 颜色
1908
+ *
1909
+ * @default "#FFFFFF"
1910
+ */
1911
+ backgroundColor?: string | string;
1912
+ /**
1913
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
1914
+ *
1915
+ * @default "dark"
1916
+ */
1917
+ backgroundTextStyle?: "dark" | "light" | string;
1918
+ /**
1919
+ * 顶部窗口的背景色,仅 iOS 支持
1920
+ *
1921
+ * @default 同 backgroundColor
1922
+ */
1923
+ backgroundColorTop?: string | string;
1924
+ /**
1925
+ * 底部窗口的背景色,仅 iOS 支持
1926
+ *
1927
+ * @default 同 backgroundColor
1928
+ */
1929
+ backgroundColorBottom?: string | string;
1930
+ /**
1931
+ * 是否开启全局的下拉刷新
1932
+ *
1933
+ * @default false
1934
+ */
1935
+ enablePullDownRefresh?: boolean;
1936
+ /**
1937
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px
1938
+ *
1939
+ * @default 50
1940
+ */
1941
+ onReachBottomDistance?: number;
1942
+ /**
1943
+ * 仅在 navigationStyle 为 "default" 时生效,用来控制导航栏透明设置
1944
+ *
1945
+ * "always" 一直透明
1946
+ *
1947
+ * "auto" 滑动自适应
1948
+ *
1949
+ * "none" 不透明
1950
+ *
1951
+ * @default "none"
1952
+ */
1953
+ transparentTitle?: "always" | "auto" | "none";
1954
+ /**
1955
+ * 框架骨架屏配置,仅支持配置 config 属性,优先级高于 app.json,详见 [小程序框架骨架屏](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/guide/experience-optimization/list/skeleton)
1956
+ *
1957
+ * @desc 2.47.0
1958
+ */
1959
+ skeleton?: {
1960
+ /**
1961
+ * 包含超时移除及自动生成配置等
1962
+ */
1963
+ config?: {
1964
+ /**
1965
+ * 设置骨架屏超时移除时间,单位为 ms,为 0 时关闭超时移除
1966
+ *
1967
+ * @default 2000
1968
+ */
1969
+ timeout?: number;
1970
+ /**
1971
+ * 骨架屏显示时的动画
1972
+ *
1973
+ * @default 'spin'
1974
+ */
1975
+ loading?: "spin" | "chiaroscuro" | "shine";
1976
+ /**
1977
+ * 骨架页面中图片块配置
1978
+ *
1979
+ * @default { shape: 'rect', color: '#efefef' }
1980
+ */
1981
+ image?: {
1982
+ /**
1983
+ * 骨架页面中图片块形状
1984
+ *
1985
+ * circle 圆形
1986
+ *
1987
+ * rect 矩形
1988
+ *
1989
+ * @default "rect"
1990
+ */
1991
+ shape?: "circle" | "rect";
1992
+ /**
1993
+ * 骨架页面中图片块颜色,支持 HEX 颜色
1994
+ *
1995
+ * @default "#efefef"
1996
+ *
1997
+ * @format color
1998
+ */
1999
+ color?: string;
2000
+ [x: string]: any;
2001
+ };
2002
+ /**
2003
+ * 骨架页面中被视为按钮块的配置
2004
+ *
2005
+ * @default { color: '#efefef }
2006
+ */
2007
+ button?: {
2008
+ /**
2009
+ * 骨架页面中被视为按钮块的颜色,支持 HEX 颜色
2010
+ *
2011
+ * @default "#efefef"
2012
+ *
2013
+ * @format color
2014
+ */
2015
+ color?: string;
2016
+ [x: string]: any;
2017
+ };
2018
+ /**
2019
+ * 骨架屏背景色,支持 HEX 颜色
2020
+ *
2021
+ * @default "#fff"
2022
+ *
2023
+ * @format color
2024
+ */
2025
+ backgroundColor?: string;
2026
+ /**
2027
+ * 默认为使用绝对定位占满全屏
2028
+ *
2029
+ * 当对自定义组件使用,作为局部加载的样式时,可设置为 "auto",高度随内容高度撑开
2030
+ *
2031
+ * @default "fullscreen"
2032
+ */
2033
+ mode?: "fullscreen" | "auto";
2034
+ /**
2035
+ * CSS单位,元素绝对定位都使用 "vw" 与 "vh"
2036
+ *
2037
+ * @default "vw"
2038
+ */
2039
+ cssUnit?: "px" | "rem" | "vw" | "vh" | "vmin" | "vmax";
2040
+ /**
2041
+ * 生成骨架屏页面中 css 值保留的小数点位数,默认为 4
2042
+ *
2043
+ * @default 4
2044
+ */
2045
+ decimal?: number;
2046
+ [x: string]: any;
2047
+ };
2048
+ /**
2049
+ * 页面路径同骨架屏文件的对应关系
2050
+ */
2051
+ page?: Record<string, string>;
2052
+ [x: string]: any;
2053
+ };
2054
+ [x: string]: any;
2055
+ }
2056
+
2057
+ /**
2058
+ * 设置编译到 mp-weixin 平台的特定样式,配置项参考 [MP-WEIXIN](https://uniapp.dcloud.net.cn/collocation/pages#mp-weixin) 和 <https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#window>
2059
+ *
2060
+ * 相应的类型是 MpWeixin
2061
+ *
2062
+ * @desc 微信小程序
2063
+ */
2064
+ interface MpWeixin {
2065
+ /**
2066
+ * 导航栏背景颜色,支持 HEX 颜色
2067
+ *
2068
+ * @default "#000000"
2069
+ *
2070
+ * @format color
2071
+ */
2072
+ navigationBarBackgroundColor?: string | string;
2073
+ /**
2074
+ * 导航栏标题、状态栏颜色
2075
+ *
2076
+ * @default "white"
2077
+ */
2078
+ navigationBarTextStyle?: "black" | "white" | string;
2079
+ /**
2080
+ * 导航栏标题文字内容
2081
+ */
2082
+ navigationBarTitleText?: string;
2083
+ /**
2084
+ * 导航栏样式
2085
+ *
2086
+ * "default" 默认样式
2087
+ *
2088
+ * "custom" 自定义导航栏,只保留右上角胶囊按钮
2089
+ *
2090
+ * @desc iOS / Android 微信客户端 6.6.0,Windows 微信客户端不支持
2091
+ *
2092
+ * @default "default"
2093
+ */
2094
+ navigationStyle?: "default" | "custom";
2095
+ /**
2096
+ * 在非首页、非页面栈最底层页面或非 tabbar 内页面中的导航栏展示 home 键
2097
+ *
2098
+ * @desc 微信客户端 8.0.24
2099
+ *
2100
+ * @default false
2101
+ */
2102
+ homeButton?: boolean;
2103
+ /**
2104
+ * 窗口的背景色,支持 HEX 颜色
2105
+ *
2106
+ * @default "#FFFFFF"
2107
+ */
2108
+ backgroundColor?: string | string;
2109
+ /**
2110
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
2111
+ *
2112
+ * @default "dark"
2113
+ */
2114
+ backgroundTextStyle?: "dark" | "light" | string;
2115
+ /**
2116
+ * 顶部窗口的背景色,仅 iOS 支持
2117
+ *
2118
+ * @desc 微信客户端 6.5.16
2119
+ *
2120
+ * @default "#FFFFFF"
2121
+ */
2122
+ backgroundColorTop?: string | string;
2123
+ /**
2124
+ * 底部窗口的背景色,仅 iOS 支持
2125
+ *
2126
+ * @desc 微信客户端 6.5.16
2127
+ *
2128
+ * @default "#FFFFFF"
2129
+ */
2130
+ backgroundColorBottom?: string | string;
2131
+ /**
2132
+ * 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onpulldownrefresh)
2133
+ *
2134
+ * @default false
2135
+ */
2136
+ enablePullDownRefresh?: boolean;
2137
+ /**
2138
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [Page.onReachBottom](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onreachbottom)
2139
+ *
2140
+ * @default 50
2141
+ */
2142
+ onReachBottomDistance?: number;
2143
+ /**
2144
+ * 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
2145
+ *
2146
+ * "auto" 自动
2147
+ *
2148
+ * "portrait" 竖屏
2149
+ *
2150
+ * "landscape" 横屏
2151
+ *
2152
+ * @desc [2.4.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) (auto) / [2.5.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) (landscape)
2153
+ *
2154
+ * @default "portrait"
2155
+ */
2156
+ pageOrientation?: "auto" | "portrait" | "landscape";
2157
+ /**
2158
+ * 重新启动策略配置
2159
+ *
2160
+ * "homePage" 如果从这个页面退出小程序,下次将从首页冷启动
2161
+ *
2162
+ * "homePageAndLatestPage" 如果从这个页面退出小程序,下次冷启动后立刻加载这个页面,页面的参数保持不变(不可用于 tab 页)
2163
+ *
2164
+ * @desc [2.8.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
2165
+ */
2166
+ restartStrategy?: "homePage" | "homePageAndLatestPage";
2167
+ /**
2168
+ * 页面初始渲染缓存配置,详见 [初始渲染缓存](https://developers.weixin.qq.com/miniprogram/dev/framework/view/initial-rendering-cache.html)
2169
+ *
2170
+ * @desc [2.11.1](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
2171
+ */
2172
+ initialRenderingCache?: "static" | "dynamic";
2173
+ /**
2174
+ * 切入系统后台时,隐藏页面内容,保护用户隐私
2175
+ *
2176
+ * @desc [2.15.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
2177
+ *
2178
+ * @default "none"
2179
+ */
2180
+ visualEffectInBackground?: "hidden" | "none";
2181
+ /**
2182
+ * 控制预加载下个页面的时机,详见 [控制预加载下个页面的时机](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/tips/runtime_nav.html#_2-4-%E6%8E%A7%E5%88%B6%E9%A2%84%E5%8A%A0%E8%BD%BD%E4%B8%8B%E4%B8%AA%E9%A1%B5%E9%9D%A2%E7%9A%84%E6%97%B6%E6%9C%BA)
2183
+ *
2184
+ * "static" 在当前页面 onReady 触发 200ms 后触发预加载
2185
+ *
2186
+ * "auto" 渲染线程空闲时进行预加载,由基础库根据一段时间内 requestAnimationFrame 的触发频率算法判断
2187
+ *
2188
+ * "manual" 由开发者通过调用 [wx.preloadWebview](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.preloadWebview.html) 触发,开发者可以在页面主要内容的 setData 结束后手动触发
2189
+ *
2190
+ * @desc [2.15.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
2191
+ *
2192
+ * @default "static"
2193
+ */
2194
+ handleWebviewPreload?: "static" | "manual" | "auto";
2195
+ [x: string]: any;
2196
+ }
2197
+
2198
+ interface GlobalStyle {
2199
+ /**
2200
+ * 导航栏背景颜色(同状态栏背景色),支持 HEX 颜色
2201
+ *
2202
+ * @desc APP 与 H5 为 #F8F8F8,小程序平台请参考相应小程序文档
2203
+ *
2204
+ * @format color
2205
+ */
2206
+ "navigationBarBackgroundColor"?: string | string;
2207
+ /**
2208
+ * 导航栏标题颜色及状态栏前景颜色,仅支持 "black" / "white"
2209
+ *
2210
+ * @default "black"
2211
+ *
2212
+ * @desc 支付宝小程序不支持,请使用 my.setNavigationBar
2213
+ */
2214
+ "navigationBarTextStyle"?: "black" | "white" | string;
2215
+ /**
2216
+ * 导航栏标题文字内容
2217
+ */
2218
+ "navigationBarTitleText"?: string;
2219
+ /**
2220
+ * 导航栏阴影
2221
+ */
2222
+ "navigationBarShadow"?: {
2223
+ /**
2224
+ * 阴影颜色
2225
+ */
2226
+ colorType?: "grey" | "blue" | "green" | "orange" | "red" | "yellow";
2227
+ };
2228
+ /**
2229
+ * 导航栏样式,仅支持 "default" / "custom"
2230
+ *
2231
+ * "custom" 即取消默认的原生导航栏,详看 [使用注意](https://uniapp.dcloud.net.cn/collocation/pages#customnav)
2232
+ *
2233
+ * @default "default"
2234
+ *
2235
+ * @desc 微信小程序 7.0+、百度小程序、H5、App(2.0.3+)
2236
+ */
2237
+ "navigationStyle"?: "default" | "custom";
2238
+ /**
2239
+ * 下拉显示出来的窗口的背景色,支持 HEX 颜色
2240
+ *
2241
+ * @default "#ffffff"
2242
+ *
2243
+ * @desc 微信小程序
2244
+ *
2245
+ * @format color
2246
+ */
2247
+ "backgroundColor"?: string | string;
2248
+ /**
2249
+ * 下拉 loading 的样式,仅支持 "dark" / "light"
2250
+ *
2251
+ * @default "dark"
2252
+ *
2253
+ * @desc 微信小程序
2254
+ */
2255
+ "backgroundTextStyle"?: "dark" | "light" | string;
2256
+ /**
2257
+ * 是否开启下拉刷新,详见 [页面生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
2258
+ *
2259
+ * @default false
2260
+ */
2261
+ "enablePullDownRefresh"?: boolean;
2262
+ /**
2263
+ * 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [页面生命周期](https://uniapp.dcloud.net.cn/tutorial/page.html#lifecycle)
2264
+ *
2265
+ * @default 50
2266
+ */
2267
+ "onReachBottomDistance"?: number;
2268
+ /**
2269
+ * 顶部窗口的背景色(bounce回弹区域)
2270
+ *
2271
+ * @default "#ffffff"
2272
+ *
2273
+ * @desc iOS
2274
+ *
2275
+ * @format color
2276
+ */
2277
+ "backgroundColorTop"?: string | string;
2278
+ /**
2279
+ * 底部窗口的背景色(bounce回弹区域)
2280
+ *
2281
+ * @default "#ffffff"
2282
+ *
2283
+ * @desc iOS
2284
+ *
2285
+ * @format color
2286
+ */
2287
+ "backgroundColorBottom"?: string | string;
2288
+ /**
2289
+ * 导航栏图片地址(替换当前文字标题)
2290
+ *
2291
+ * 支付宝小程序内必须使用 https 图片链接地址
2292
+ *
2293
+ * @desc 支付宝小程序、H5、APP
2294
+ */
2295
+ "titleImage"?: string;
2296
+ /**
2297
+ * 导航栏整体(前景、背景)透明设置,仅支持 "always" / "auto" / "none
2298
+ *
2299
+ * "always" 一直透明
2300
+ *
2301
+ * "auto" 滑动自适应
2302
+ *
2303
+ * "none" 不透明
2304
+ *
2305
+ * @default "none"
2306
+ *
2307
+ * @desc 支付宝小程序、H5、APP
2308
+ */
2309
+ "transparentTitle"?: "always" | "auto" | "none";
2310
+ /**
2311
+ * 导航栏点击穿透
2312
+ *
2313
+ * @default "NO"
2314
+ *
2315
+ * @desc 支付宝小程序、H5
2316
+ */
2317
+ "titlePenetrate"?: "YES" | "NO";
2318
+ /**
2319
+ * 横屏配置,屏幕旋转设置,仅支持 "auto" / "portrait" / "landscape",详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
2320
+ *
2321
+ * "auto" 自动
2322
+ *
2323
+ * "portrait" 竖屏
2324
+ *
2325
+ * "landscape" 横屏
2326
+ *
2327
+ * @default "portrait"
2328
+ *
2329
+ * @desc App 2.4.7+、微信小程序、QQ小程序
2330
+ */
2331
+ "pageOrientation"?: string;
2332
+ /**
2333
+ * 窗口显示的动画效果,详见 [窗口动画](https://uniapp.dcloud.net.cn/api/router#animation)
2334
+ *
2335
+ * @default "pop-in"
2336
+ *
2337
+ * @desc App
2338
+ */
2339
+ "animationType"?: AnimationType;
2340
+ /**
2341
+ * 窗口显示动画的持续时间,单位为 ms
2342
+ *
2343
+ * @default 300
2344
+ *
2345
+ * @desc App
2346
+ */
2347
+ "animationDuration"?: number;
2348
+ /**
2349
+ * 设置编译到 App 平台的特定样式,配置项参考 [app-plus](https://uniapp.dcloud.net.cn/collocation/pages#app-plus)
2350
+ *
2351
+ * 相应的类型是 AppPlus
2352
+ *
2353
+ * @desc App
2354
+ */
2355
+ "app-plus"?: AppPlus;
2356
+ /**
2357
+ * 设置编译到 H5 平台的特定样式,配置项参考 [H5](https://uniapp.dcloud.net.cn/collocation/pages#h5)
2358
+ *
2359
+ * 相应的类型是 H5
2360
+ *
2361
+ * @desc H5
2362
+ */
2363
+ "h5"?: H5;
2364
+ /**
2365
+ * 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay) 和 <https://opendocs.alipay.com/mini/framework/app-json#window>
2366
+ *
2367
+ * 相应的类型是 MpAlipay
2368
+ *
2369
+ * @desc 支付宝小程序
2370
+ */
2371
+ "mp-alipay"?: MpAlipay;
2372
+ /**
2373
+ * 设置编译到 mp-weixin 平台的特定样式,配置项参考 [MP-WEIXIN](https://uniapp.dcloud.net.cn/collocation/pages#mp-weixin) 和 <https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#window>
2374
+ *
2375
+ * 相应的类型是 MpWeixin
2376
+ *
2377
+ * @desc 微信小程序
2378
+ */
2379
+ "mp-weixin"?: MpWeixin;
2380
+ /**
2381
+ * 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu) 和 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
2382
+ *
2383
+ * 相应的类型是 MpBaidu
2384
+ *
2385
+ * @desc 百度小程序
2386
+ */
2387
+ "mp-baidu"?: MpBaidu;
2388
+ /**
2389
+ * 设置编译到 mp-toutiao 平台的特定样式,配置项参考 <https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/general-configuration#window>
2390
+ *
2391
+ * 相应的类型是 MpToutiao
2392
+ *
2393
+ * @desc 抖音小程序
2394
+ */
2395
+ "mp-toutiao"?: MpToutiao;
2396
+ /**
2397
+ * 设置编译到 mp-lark 平台的特定样式
2398
+ *
2399
+ * 相应的类型是 MpLark
2400
+ *
2401
+ * @desc 飞书小程序
2402
+ */
2403
+ "mp-lark"?: MpLark;
2404
+ /**
2405
+ * 设置编译到 mp-qq 平台的特定样式
2406
+ *
2407
+ * 相应的类型是 MpQq
2408
+ *
2409
+ * @desc QQ 小程序
2410
+ */
2411
+ "mp-qq"?: MpQq;
2412
+ /**
2413
+ * 设置编译到 mp-kuaishou 平台的特定样式
2414
+ *
2415
+ * 相应的类型是 MpKuaishou
2416
+ *
2417
+ * @desc 快手小程序
2418
+ */
2419
+ "mp-kuaishou"?: MpKuaishou;
2420
+ /**
2421
+ * 设置编译到 mp-jd 平台的特定样式
2422
+ *
2423
+ * 相应的类型是 MpJd
2424
+ *
2425
+ * @desc 京东小程序
2426
+ */
2427
+ "mp-jd"?: MpJd;
2428
+ /**
2429
+ * 引用小程序组件,详见 [小程序组件](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)
2430
+ *
2431
+ * @desc App、微信小程序、支付宝小程序、百度小程序、京东小程序
2432
+ */
2433
+ "usingComponents"?: Record<string, string>;
2434
+ /**
2435
+ * 同层渲染,webrtc(实时音视频)无法正常时尝试配置为 "seperated" 强制关掉同层渲染
2436
+ *
2437
+ * @desc 微信小程序
2438
+ */
2439
+ "renderingMode"?: string;
2440
+ /**
2441
+ * 当存在 leftWindow 时,默认是否显示 leftWindow,详见 [topWindow](https://uniapp.dcloud.net.cn/collocation/pages.html#topwindow)
2442
+ *
2443
+ * @default true
2444
+ *
2445
+ * @desc H5
2446
+ */
2447
+ "leftWindow"?: boolean;
2448
+ /**
2449
+ * 当存在 topWindow 时,默认是否显示 topWindow,详见 [topWindow](https://uniapp.dcloud.net.cn/collocation/pages.html#topwindow)
2450
+ *
2451
+ * @default true
2452
+ *
2453
+ * @desc H5
2454
+ */
2455
+ "topWindow"?: boolean;
2456
+ /**
2457
+ * 当存在 rightWindow 时,默认是否显示 rightWindow,详见 [topWindow](https://uniapp.dcloud.net.cn/collocation/pages.html#topwindow)
2458
+ *
2459
+ * @default true
2460
+ *
2461
+ * @desc H5
2462
+ */
2463
+ "rightWindow"?: boolean;
2464
+ /**
2465
+ * rpx 计算所支持的最大设备宽度,单位为 px
2466
+ *
2467
+ * @default 960
2468
+ *
2469
+ * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
2470
+ */
2471
+ "rpxCalcMaxDeviceWidth"?: number;
2472
+ /**
2473
+ * rpx 计算使用的基准设备宽度,设备实际宽度超出 rpx 计算所支持的最大设备宽度时将按基准宽度计算,单位为 px
2474
+ *
2475
+ * @default 375
2476
+ *
2477
+ * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
2478
+ */
2479
+ "rpxCalcBaseDeviceWidth"?: number;
2480
+ /**
2481
+ * rpx 计算特殊处理的值,始终按实际的设备宽度计算,单位为 rpx
2482
+ *
2483
+ * @default 750
2484
+ *
2485
+ * @desc App(vue2 且不含 nvue)、H5(2.8.12+)
2486
+ */
2487
+ "rpxCalcIncludeWidth"?: number;
2488
+ /**
2489
+ * 是否使用动态 rpx,屏幕大小变化会重新渲染 rpx
2490
+ *
2491
+ * @default false
2492
+ *
2493
+ * @desc App-nvue(vue3 固定值为 true) 3.2.13+
2494
+ */
2495
+ "dynamicRpx"?: boolean;
2496
+ /**
2497
+ * 当浏览器可见区域宽度大于 maxWidth 时两侧留白,当小于等于 maxWidth 时页面铺满,单位为 px
2498
+ *
2499
+ * 不同页面支持配置不同的 maxWidth
2500
+ *
2501
+ * maxWidth = leftWindow(可选)+ page(页面主体)+ rightWindow(可选)
2502
+ *
2503
+ * 使用时,页面内 fixed 元素需要使用 --window-left 和 --window-right 来保证布局位置正确
2504
+ *
2505
+ * @desc H5(2.9.9+)
2506
+ */
2507
+ "maxWidth"?: number;
2508
+ [x: string]: any;
2509
+ }
2510
+
2511
+ interface SubPackage {
2512
+ /**
2513
+ * 子包的根目录
2514
+ */
2515
+ root: string;
2516
+ /**
2517
+ * 子包由哪些页面组成,参数同 pages
2518
+ */
2519
+ pages: PageMetaDatum[];
2520
+ /**
2521
+ * 分包插件
2522
+ */
2523
+ plugins?: {
2524
+ [pluginName: string]: {
2525
+ version: string;
2526
+ provider: string;
2527
+ export?: string;
2528
+ [key: string]: any;
2529
+ };
2530
+ };
2531
+ }
2532
+ type SubPackages = SubPackage[];
2533
+
2534
+ interface TabBarIconFont {
2535
+ /**
2536
+ * 字库 Unicode 码
2537
+ */
2538
+ text?: string;
2539
+ /**
2540
+ * 选中后字库 Unicode 码
2541
+ */
2542
+ selectedText?: string;
2543
+ /**
2544
+ * 字体图标字号,单位为 px
2545
+ */
2546
+ fontSize?: string;
2547
+ /**
2548
+ * 字体图标颜色
2549
+ */
2550
+ color?: string;
2551
+ /**
2552
+ * 字体图标选中颜色
2553
+ */
2554
+ selectedColor?: string;
2555
+ [x: string]: any;
2556
+ }
2557
+ interface TabBarItem {
2558
+ /**
2559
+ * 页面路径,必须在 pages 中先定义
2560
+ */
2561
+ pagePath: string;
2562
+ /**
2563
+ * tab 上按钮文字,在 App 和 H5 平台为非必填,例如中间可放一个没有文字的 + 号图标
2564
+ */
2565
+ text?: string;
2566
+ /**
2567
+ * 图片路径,icon 大小限制为 40 kb,建议尺寸为 81px * 81px
2568
+ *
2569
+ * 当 position 为 "top" 时,此参数无效
2570
+ *
2571
+ * 不支持网络图片,不支持字体图标
2572
+ */
2573
+ iconPath?: string | string;
2574
+ /**
2575
+ * 选中时的图片路径,icon 大小限制为 40 kb,建议尺寸为 81px * 81px
2576
+ *
2577
+ * 当 position 为 "top" 时,此参数无效
2578
+ *
2579
+ * 不支持网络图片,不支持字体图标
2580
+ */
2581
+ selectedIconPath?: string | string;
2582
+ /**
2583
+ * 该项是否显示,默认显示
2584
+ *
2585
+ * @desc App (3.2.10+)、H5 (3.2.10+)
2586
+ */
2587
+ visible?: boolean;
2588
+ /**
2589
+ * 字体图标,优先级高于 iconPath
2590
+ *
2591
+ * @desc App(3.4.4+)、H5 (3.5.3+)
2592
+ */
2593
+ iconfont?: TabBarIconFont;
2594
+ [x: string]: any;
2595
+ }
2596
+ interface TabBarMidButton {
2597
+ /**
2598
+ * 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度
2599
+ *
2600
+ * @default "80px"
2601
+ */
2602
+ width?: string;
2603
+ /**
2604
+ * 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果
2605
+ *
2606
+ * @default "50px"
2607
+ */
2608
+ height?: string;
2609
+ /**
2610
+ * 中间按钮的文字
2611
+ */
2612
+ text?: string;
2613
+ /**
2614
+ * 中间按钮的图片路径
2615
+ */
2616
+ iconPath?: string;
2617
+ /**
2618
+ * 图片宽度(高度等比例缩放)
2619
+ *
2620
+ * @default "24px"
2621
+ */
2622
+ iconWidth?: string;
2623
+ /**
2624
+ * 中间按钮的背景图片路径
2625
+ */
2626
+ backgroundImage?: string;
2627
+ /**
2628
+ * 字体图标,优先级高于 iconPath
2629
+ *
2630
+ * @desc App (3.4.4+)
2631
+ */
2632
+ iconfont?: TabBarIconFont;
2633
+ [x: string]: any;
2634
+ }
2635
+ interface TabBar {
2636
+ /**
2637
+ * tab 上的文字默认颜色
2638
+ *
2639
+ * @format color
2640
+ */
2641
+ color?: string | string;
2642
+ /**
2643
+ * tab 上的文字选中时的颜色
2644
+ *
2645
+ * @format color
2646
+ */
2647
+ selectedColor?: string | string;
2648
+ /**
2649
+ * tab 的背景色
2650
+ *
2651
+ * @format color
2652
+ */
2653
+ backgroundColor?: string | string;
2654
+ /**
2655
+ * tabBar 上边框的颜色
2656
+ *
2657
+ * @default "black"
2658
+ *
2659
+ * @desc App 2.3.4+、H5 3.0.0+
2660
+ *
2661
+ * @format color
2662
+ */
2663
+ borderStyle?: "black" | "white" | string | string;
2664
+ /**
2665
+ * iOS 高斯模糊效果,参考 [使用说明](https://ask.dcloud.net.cn/article/36617)
2666
+ *
2667
+ * @default "none"
2668
+ *
2669
+ * @desc App 2.4.0+、H5 3.0.0+(只有最新版浏览器才支持)
2670
+ */
2671
+ blurEffect?: "dark" | "extralight" | "light" | "none";
2672
+ /**
2673
+ * tab 列表,最少 2个,最多 5 个,app 端没有该限制
2674
+ *
2675
+ * @type {TabBarItem[]}
2676
+ */
2677
+ list?: TabBarItem[];
2678
+ /**
2679
+ * tab 位置
2680
+ *
2681
+ * @default "bottom"
2682
+ *
2683
+ * @desc "top" 仅微信小程序支持
2684
+ */
2685
+ position?: "bottom" | "top";
2686
+ /**
2687
+ * 文字默认大小
2688
+ *
2689
+ * @default "10px"
2690
+ *
2691
+ * @desc App 2.3.4+、H5 3.0.0+
2692
+ */
2693
+ fontSize?: string;
2694
+ /**
2695
+ * 图标默认宽度(高度等比例缩放)
2696
+ *
2697
+ * @default "24px"
2698
+ *
2699
+ * @desc App 2.3.4+、H5 3.0.0+
2700
+ */
2701
+ iconWidth?: string;
2702
+ /**
2703
+ * 图标和文字的间距
2704
+ *
2705
+ * @default "3px"
2706
+ *
2707
+ * @desc App 2.3.4+、H5 3.0.0+
2708
+ */
2709
+ spacing?: string;
2710
+ /**
2711
+ * tabBar 默认高度
2712
+ *
2713
+ * @default "50px"
2714
+ *
2715
+ * @desc App 2.3.4+、H5 3.0.0+
2716
+ */
2717
+ height?: string;
2718
+ /**
2719
+ * 中间按钮 仅在 list 项为偶数时有效
2720
+ *
2721
+ * @desc App 2.3.4+、H5 3.0.0+
2722
+ */
2723
+ midButton?: TabBarMidButton;
2724
+ /**
2725
+ * list 设置 iconfont 属性时,需要指定字体文件路径
2726
+ *
2727
+ * @desc App 3.4.4+、H5 3.5.3+
2728
+ */
2729
+ iconfontSrc?: string;
2730
+ /**
2731
+ * 设置背景图片,优先级高于 backgroundColor
2732
+ */
2733
+ backgroundImage?: string;
2734
+ /**
2735
+ * 设置标题栏的背景图平铺方式
2736
+ *
2737
+ * "repeat" 背景图片在垂直方向和水平方向平铺
2738
+ *
2739
+ * "repeat-x" 背景图片在水平方向平铺,垂直方向拉伸
2740
+ *
2741
+ * "repeat-y" 背景图片在垂直方向平铺,水平方向拉伸
2742
+ *
2743
+ * "no-repeat" 背景图片在垂直方向和水平方向都拉伸
2744
+ *
2745
+ * @default "no-repeat"
2746
+ */
2747
+ backgroundRepeat?: "no-repeat" | "repeat" | "repeat-x" | "repeat-y";
2748
+ /**
2749
+ * tabBar上红点颜色
2750
+ *
2751
+ * @format color
2752
+ */
2753
+ redDotColor?: string;
2754
+ [x: string]: any;
2755
+ }
2756
+
2757
+ interface TheWindow {
2758
+ /**
2759
+ * 配置页面路径
2760
+ */
2761
+ path: string;
2762
+ /**
2763
+ * 配置页面窗口表现,配置项参考 [pageStyle](https://uniapp.dcloud.net.cn/collocation/pages#style)
2764
+ */
2765
+ style?: GlobalStyle;
2766
+ /**
2767
+ * 配置显示该窗口的规则,配置项参考 [matchMedia](https://uniapp.dcloud.net.cn/collocation/pages#matchmedia)
2768
+ */
2769
+ matchMedia?: {
2770
+ /**
2771
+ * 当设备可见区域宽度 >= minWidth 时,显示该 window
2772
+ *
2773
+ * @default 768
2774
+ */
2775
+ minWidth?: number;
2776
+ };
2777
+ }
2778
+
2779
+ interface UniIdRouter {
2780
+ /**
2781
+ * 登录页面路径
2782
+ *
2783
+ * @example "pages/index/index"
2784
+ */
2785
+ loginPage: string;
2786
+ /**
2787
+ * 需要登录才可以访问的页面列表,可以使用正则语法
2788
+ *
2789
+ * @example ["pages/detail/.*"]
2790
+ */
2791
+ needLogin: string[];
2792
+ /**
2793
+ * 是否是否自动解析云对象及 clientDB 的错误码,如果是客户端 token 不正确或 token 过期则自动跳转配置的登录页面
2794
+ *
2795
+ * @default true
2796
+ */
2797
+ resToLogin?: boolean;
2798
+ }
2799
+
2800
+ /**
2801
+ * 对 uni-app 进行全局配置,决定页面文件的路径、窗口样式、原生的导航栏、底部的原生 tabBar 等,类似微信小程序中 app.json 的页面管理部分
2802
+ *
2803
+ * 注意定位权限申请等原属于 app.json 的内容,需要在 manifest 中配置
2804
+ */
2805
+ interface PagesConfig {
2806
+ /**
2807
+ * 设置默认页面的窗口表现
2808
+ */
2809
+ globalStyle?: GlobalStyle;
2810
+ /**
2811
+ * 设置页面路径及窗口表现
2812
+ */
2813
+ pages?: PageMetaDatum[];
2814
+ /**
2815
+ * 组件自动引入规则
2816
+ *
2817
+ * @desc 2.5.5+
2818
+ */
2819
+ easycom?: EasyCom;
2820
+ /**
2821
+ * 设置底部 tab 的表现
2822
+ */
2823
+ tabBar?: TabBar;
2824
+
2825
+ /**
2826
+ * 分包加载配置
2827
+ *
2828
+ * @desc H5 不支持
2829
+ */
2830
+ subPackages?: SubPackages;
2831
+ /**
2832
+ * 分包预下载规则
2833
+ *
2834
+ * @desc 微信小程序
2835
+ */
2836
+ preloadRule?: {
2837
+ /**
2838
+ * 页面路径
2839
+ */
2840
+ [path: string]: {
2841
+ /**
2842
+ * 进入页面后预下载分包的 root 或 name
2843
+ *
2844
+ * __APP__ 表示主包
2845
+ */
2846
+ packages: string[];
2847
+ /**
2848
+ * 在指定网络下预下载
2849
+ *
2850
+ * "all" 不限网络
2851
+ *
2852
+ * "wifi" 仅 wifi 下预下载
2853
+ *
2854
+ * @default "wifi"
2855
+ */
2856
+ network?: "all" | "wifi";
2857
+ };
2858
+ };
2859
+ /**
2860
+ * `Worker` 代码放置的目录
2861
+ *
2862
+ * @desc 微信小程序
2863
+ */
2864
+ workers?:
2865
+ | string
2866
+ | {
2867
+ /**
2868
+ * `Worker` 代码放置的目录
2869
+ */
2870
+ path: string;
2871
+ /**
2872
+ * 是否打包为分包
2873
+ *
2874
+ * @desc 微信小程序基础库 v2.27.3
2875
+ *
2876
+ * @default false
2877
+ */
2878
+ isSubpackage?: boolean;
2879
+ };
2880
+ /**
2881
+ * 大屏左侧窗口
2882
+ *
2883
+ * @desc H5
2884
+ */
2885
+ leftWindow?: TheWindow;
2886
+ /**
2887
+ * 大屏顶部窗口
2888
+ *
2889
+ * @desc H5
2890
+ */
2891
+ topWindow?: TheWindow;
2892
+ /**
2893
+ * 大屏右侧窗口
2894
+ *
2895
+ * @desc H5
2896
+ */
2897
+ rightWindow?: TheWindow;
2898
+ /**
2899
+ * 自动跳转相关配置,新增于 HBuilderX 3.5.0
2900
+ *
2901
+ * @desc uni-app 3.5.0+、uni-app-x 3.99+
2902
+ */
2903
+ uniIdRouter?: UniIdRouter;
2904
+ /**
2905
+ * 默认启动首页,新增于 HBuilderX 3.7.0
2906
+ *
2907
+ * @desc 微信小程序、支付宝小程序
2908
+ */
2909
+ entryPagePath?: string;
2910
+ [x: string]: any;
2911
+ }
2912
+
2913
+ declare enum CloseTypes {
2914
+ default = "default",
2915
+ current = "current",
2916
+ all = "all"
2917
+ }
2918
+ interface RouteMeta extends PageMetaDatum {
2919
+ url: string;
2920
+ isTabBar?: boolean;
2921
+ name: string;
2922
+ }
2923
+ interface RouterParams<TPath extends string> {
2924
+ path?: TPath;
2925
+ query?: Record<string, any>;
2926
+ close?: CloseTypes | keyof typeof CloseTypes;
2927
+ success?: (result?: unknown) => void;
2928
+ fail?: (error?: any) => void;
2929
+ }
2930
+ type TypeSafePush<TPath extends string> = (data: TPath | RouterParams<TPath>, callbacks?: {
2931
+ success?: (result?: unknown) => void;
2932
+ fail?: (error?: any) => void;
2933
+ }) => Promise<void>;
2934
+
2935
+ type RouterHookResult<TPath extends string> = {
2936
+ push: TypeSafePush<TPath>;
2937
+ };
2938
+
2939
+ interface RouteInfo<TName extends string> {
2940
+ name: TName;
2941
+ meta?: RouteMeta;
2942
+ query: Record<string, any>;
2943
+ handlerResult?: unknown;
2944
+ }
2945
+
2946
+ type RouteHandler = (payload?: unknown) => unknown | Promise<unknown>;
2947
+ interface RouteLocationNormalized<TName extends string> {
2948
+ name: TName;
2949
+ meta?: RouteMeta;
2950
+ query: Record<string, any>;
2951
+ path: string;
2952
+ }
2953
+ type RouteLocationRaw<TName extends string> = TName | {
2954
+ path: TName;
2955
+ query?: Record<string, any>;
2956
+ replace?: boolean;
2957
+ };
2958
+ type NavigationGuard<TName extends string> = (to: RouteLocationNormalized<TName>, from: RouteLocationNormalized<TName>) => void | boolean | RouteLocationRaw<TName> | Promise<void | boolean | RouteLocationRaw<TName>>;
2959
+ interface Router<TName extends string> {
2960
+ register(name: TName, handler: RouteHandler): () => void;
2961
+ unregister(name: TName): boolean;
2962
+ has(name: TName): boolean;
2963
+ beforeEach(guard: NavigationGuard<TName>): () => void;
2964
+ afterEach(guard: NavigationGuard<TName>): () => void;
2965
+ useRouter(): RouterHookResult<TName>;
2966
+ useRoute(): RouteInfo<TName>;
2967
+ }
2968
+ declare function createRouter<const TRoutes extends Record<string, RouteMeta>>(routes: PagesConfig): Router<Extract<keyof TRoutes, string>>;
2969
+ declare function createRouter<TName extends string>(routes?: PagesConfig): Router<TName>;
2970
+
2971
+ declare function routeTypesPlugin(dts: string): {
2972
+ name: string;
2973
+ buildStart(): void;
2974
+ handleHotUpdate(ctx: any): void;
2975
+ };
2976
+
2977
+ export { createRouter, routeTypesPlugin };