@uni-helper/vite-plugin-uni-pages 0.3.2 → 0.3.4
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 +2 -2
- package/client.d.ts +5 -1
- package/dist/index.cjs +357 -168
- package/dist/index.d.cts +413 -376
- package/dist/index.d.mts +413 -376
- package/dist/index.d.ts +413 -376
- package/dist/index.mjs +335 -168
- package/index.d.ts +5 -0
- package/package.json +17 -8
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Logger, ViteDevServer, Plugin } from 'vite';
|
|
2
|
-
import { LoadConfigSource } from 'unconfig';
|
|
3
2
|
import { CommentJSONValue } from 'comment-json';
|
|
3
|
+
import { LoadConfigSource } from 'unconfig';
|
|
4
4
|
import { FSWatcher } from 'chokidar';
|
|
5
|
+
import { SFCParseOptions, SFCDescriptor, SFCBlock } from '@vue/compiler-sfc';
|
|
6
|
+
import * as t from '@babel/types';
|
|
7
|
+
import babelGenerator from '@babel/generator';
|
|
5
8
|
import Debug from 'debug';
|
|
6
|
-
import { SFCBlock, SFCDescriptor } from '@vue/compiler-sfc';
|
|
7
9
|
|
|
8
10
|
interface ConditionItem {
|
|
9
11
|
/**
|
|
@@ -154,130 +156,6 @@ interface TitleNViewButton {
|
|
|
154
156
|
width?: PxSize | 'auto';
|
|
155
157
|
}
|
|
156
158
|
|
|
157
|
-
interface H5 {
|
|
158
|
-
/**
|
|
159
|
-
* 导航栏,详见 [导航栏](https://uniapp.dcloud.net.cn/collocation/pages#h5-titlenview)
|
|
160
|
-
*/
|
|
161
|
-
titleNView?: false | {
|
|
162
|
-
/**
|
|
163
|
-
* 背景颜色,支持 HEX 颜色
|
|
164
|
-
*
|
|
165
|
-
* @default "#F7F7F7"
|
|
166
|
-
*
|
|
167
|
-
* @format color
|
|
168
|
-
*/
|
|
169
|
-
backgroundColor?: HEXColor;
|
|
170
|
-
/**
|
|
171
|
-
* 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons)
|
|
172
|
-
*/
|
|
173
|
-
buttons?: TitleNViewButton[];
|
|
174
|
-
/**
|
|
175
|
-
* 标题文字颜色,支持 HEX 颜色
|
|
176
|
-
*
|
|
177
|
-
* @default "#000000"
|
|
178
|
-
*
|
|
179
|
-
* @format color
|
|
180
|
-
*/
|
|
181
|
-
titleColor?: HEXColor;
|
|
182
|
-
/**
|
|
183
|
-
* 标题文字内容
|
|
184
|
-
*/
|
|
185
|
-
titleText?: string;
|
|
186
|
-
/**
|
|
187
|
-
* 标题文字大小
|
|
188
|
-
*/
|
|
189
|
-
titleSize?: string;
|
|
190
|
-
/**
|
|
191
|
-
* 导航栏样式
|
|
192
|
-
*
|
|
193
|
-
* "default" 默认样式
|
|
194
|
-
*
|
|
195
|
-
* "transparent" 滚动透明渐变
|
|
196
|
-
*
|
|
197
|
-
* @default "default"
|
|
198
|
-
*/
|
|
199
|
-
type?: 'default' | 'transparent';
|
|
200
|
-
/**
|
|
201
|
-
* 导航栏上的搜索框配置,详见 [searchInput](https://uniapp.dcloud.net.cn/collocation/pages#h5-searchinput)
|
|
202
|
-
*
|
|
203
|
-
* @desc 1.6.5
|
|
204
|
-
*/
|
|
205
|
-
searchInput?: {
|
|
206
|
-
/**
|
|
207
|
-
* 是否自动获取焦点
|
|
208
|
-
*
|
|
209
|
-
* @default false
|
|
210
|
-
*/
|
|
211
|
-
autoFocus?: boolean;
|
|
212
|
-
/**
|
|
213
|
-
* 非输入状态下文本的对齐方式
|
|
214
|
-
*
|
|
215
|
-
* "left" 居左对齐
|
|
216
|
-
*
|
|
217
|
-
* "right" 居右对齐
|
|
218
|
-
*
|
|
219
|
-
* "center" 居中对齐
|
|
220
|
-
*
|
|
221
|
-
* @default "center"
|
|
222
|
-
*/
|
|
223
|
-
align?: 'center' | 'left' | 'right';
|
|
224
|
-
/**
|
|
225
|
-
* 背景颜色,支持 HEX 和 RGBA 颜色
|
|
226
|
-
*
|
|
227
|
-
* @default "rgba(255,255,255,0.5)"
|
|
228
|
-
*
|
|
229
|
-
* @format color
|
|
230
|
-
*/
|
|
231
|
-
backgroundColor?: HEXColor | RGBAColor;
|
|
232
|
-
/**
|
|
233
|
-
* 输入框的圆角半径,单位为 px
|
|
234
|
-
*
|
|
235
|
-
* @default "0px"
|
|
236
|
-
*/
|
|
237
|
-
borderRadius?: PxSize;
|
|
238
|
-
/**
|
|
239
|
-
* 提示文本
|
|
240
|
-
*/
|
|
241
|
-
placeholder?: string;
|
|
242
|
-
/**
|
|
243
|
-
* 提示文本颜色,支持 HEX 颜色
|
|
244
|
-
*
|
|
245
|
-
* @default "#CCCCCC"
|
|
246
|
-
*
|
|
247
|
-
* @format color
|
|
248
|
-
*/
|
|
249
|
-
placeholderColor?: HEXColor;
|
|
250
|
-
/**
|
|
251
|
-
* 是否禁止输入
|
|
252
|
-
*
|
|
253
|
-
* @default false
|
|
254
|
-
*/
|
|
255
|
-
disabled?: boolean;
|
|
256
|
-
[x: string]: any;
|
|
257
|
-
};
|
|
258
|
-
[x: string]: any;
|
|
259
|
-
};
|
|
260
|
-
/**
|
|
261
|
-
* 下拉刷新,详见 [下拉刷新](https://uniapp.dcloud.net.cn/collocation/pages#h5-pulltorefresh)
|
|
262
|
-
*/
|
|
263
|
-
pullToRefresh?: {
|
|
264
|
-
/**
|
|
265
|
-
* 下拉刷新控件颜色,支持 HEX 颜色
|
|
266
|
-
*
|
|
267
|
-
* @default "#2BD009"
|
|
268
|
-
*/
|
|
269
|
-
color?: HEXColor;
|
|
270
|
-
/**
|
|
271
|
-
* 下拉刷新控件起始位置,支持支持单位为 px 的逻辑像素值或百分比
|
|
272
|
-
*
|
|
273
|
-
* @default "0px"
|
|
274
|
-
*/
|
|
275
|
-
offset?: PxSize | PercentageSize;
|
|
276
|
-
[x: string]: any;
|
|
277
|
-
};
|
|
278
|
-
[x: string]: any;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
159
|
interface AppPlus {
|
|
282
160
|
/**
|
|
283
161
|
* 窗体背景色,支持 HEX 颜色
|
|
@@ -1312,6 +1190,130 @@ interface AppPlus {
|
|
|
1312
1190
|
[x: string]: any;
|
|
1313
1191
|
}
|
|
1314
1192
|
|
|
1193
|
+
interface H5 {
|
|
1194
|
+
/**
|
|
1195
|
+
* 导航栏,详见 [导航栏](https://uniapp.dcloud.net.cn/collocation/pages#h5-titlenview)
|
|
1196
|
+
*/
|
|
1197
|
+
titleNView?: false | {
|
|
1198
|
+
/**
|
|
1199
|
+
* 背景颜色,支持 HEX 颜色
|
|
1200
|
+
*
|
|
1201
|
+
* @default "#F7F7F7"
|
|
1202
|
+
*
|
|
1203
|
+
* @format color
|
|
1204
|
+
*/
|
|
1205
|
+
backgroundColor?: HEXColor;
|
|
1206
|
+
/**
|
|
1207
|
+
* 自定义按钮,详见 [自定义按钮](https://uniapp.dcloud.net.cn/collocation/pages#app-titlenview-buttons)
|
|
1208
|
+
*/
|
|
1209
|
+
buttons?: TitleNViewButton[];
|
|
1210
|
+
/**
|
|
1211
|
+
* 标题文字颜色,支持 HEX 颜色
|
|
1212
|
+
*
|
|
1213
|
+
* @default "#000000"
|
|
1214
|
+
*
|
|
1215
|
+
* @format color
|
|
1216
|
+
*/
|
|
1217
|
+
titleColor?: HEXColor;
|
|
1218
|
+
/**
|
|
1219
|
+
* 标题文字内容
|
|
1220
|
+
*/
|
|
1221
|
+
titleText?: string;
|
|
1222
|
+
/**
|
|
1223
|
+
* 标题文字大小
|
|
1224
|
+
*/
|
|
1225
|
+
titleSize?: string;
|
|
1226
|
+
/**
|
|
1227
|
+
* 导航栏样式
|
|
1228
|
+
*
|
|
1229
|
+
* "default" 默认样式
|
|
1230
|
+
*
|
|
1231
|
+
* "transparent" 滚动透明渐变
|
|
1232
|
+
*
|
|
1233
|
+
* @default "default"
|
|
1234
|
+
*/
|
|
1235
|
+
type?: 'default' | 'transparent';
|
|
1236
|
+
/**
|
|
1237
|
+
* 导航栏上的搜索框配置,详见 [searchInput](https://uniapp.dcloud.net.cn/collocation/pages#h5-searchinput)
|
|
1238
|
+
*
|
|
1239
|
+
* @desc 1.6.5
|
|
1240
|
+
*/
|
|
1241
|
+
searchInput?: {
|
|
1242
|
+
/**
|
|
1243
|
+
* 是否自动获取焦点
|
|
1244
|
+
*
|
|
1245
|
+
* @default false
|
|
1246
|
+
*/
|
|
1247
|
+
autoFocus?: boolean;
|
|
1248
|
+
/**
|
|
1249
|
+
* 非输入状态下文本的对齐方式
|
|
1250
|
+
*
|
|
1251
|
+
* "left" 居左对齐
|
|
1252
|
+
*
|
|
1253
|
+
* "right" 居右对齐
|
|
1254
|
+
*
|
|
1255
|
+
* "center" 居中对齐
|
|
1256
|
+
*
|
|
1257
|
+
* @default "center"
|
|
1258
|
+
*/
|
|
1259
|
+
align?: 'center' | 'left' | 'right';
|
|
1260
|
+
/**
|
|
1261
|
+
* 背景颜色,支持 HEX 和 RGBA 颜色
|
|
1262
|
+
*
|
|
1263
|
+
* @default "rgba(255,255,255,0.5)"
|
|
1264
|
+
*
|
|
1265
|
+
* @format color
|
|
1266
|
+
*/
|
|
1267
|
+
backgroundColor?: HEXColor | RGBAColor;
|
|
1268
|
+
/**
|
|
1269
|
+
* 输入框的圆角半径,单位为 px
|
|
1270
|
+
*
|
|
1271
|
+
* @default "0px"
|
|
1272
|
+
*/
|
|
1273
|
+
borderRadius?: PxSize;
|
|
1274
|
+
/**
|
|
1275
|
+
* 提示文本
|
|
1276
|
+
*/
|
|
1277
|
+
placeholder?: string;
|
|
1278
|
+
/**
|
|
1279
|
+
* 提示文本颜色,支持 HEX 颜色
|
|
1280
|
+
*
|
|
1281
|
+
* @default "#CCCCCC"
|
|
1282
|
+
*
|
|
1283
|
+
* @format color
|
|
1284
|
+
*/
|
|
1285
|
+
placeholderColor?: HEXColor;
|
|
1286
|
+
/**
|
|
1287
|
+
* 是否禁止输入
|
|
1288
|
+
*
|
|
1289
|
+
* @default false
|
|
1290
|
+
*/
|
|
1291
|
+
disabled?: boolean;
|
|
1292
|
+
[x: string]: any;
|
|
1293
|
+
};
|
|
1294
|
+
[x: string]: any;
|
|
1295
|
+
};
|
|
1296
|
+
/**
|
|
1297
|
+
* 下拉刷新,详见 [下拉刷新](https://uniapp.dcloud.net.cn/collocation/pages#h5-pulltorefresh)
|
|
1298
|
+
*/
|
|
1299
|
+
pullToRefresh?: {
|
|
1300
|
+
/**
|
|
1301
|
+
* 下拉刷新控件颜色,支持 HEX 颜色
|
|
1302
|
+
*
|
|
1303
|
+
* @default "#2BD009"
|
|
1304
|
+
*/
|
|
1305
|
+
color?: HEXColor;
|
|
1306
|
+
/**
|
|
1307
|
+
* 下拉刷新控件起始位置,支持支持单位为 px 的逻辑像素值或百分比
|
|
1308
|
+
*
|
|
1309
|
+
* @default "0px"
|
|
1310
|
+
*/
|
|
1311
|
+
offset?: PxSize | PercentageSize;
|
|
1312
|
+
[x: string]: any;
|
|
1313
|
+
};
|
|
1314
|
+
[x: string]: any;
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1315
1317
|
/**
|
|
1316
1318
|
* 设置编译到 mp-alipay 平台的特定样式,配置项参考 [MP-ALIPAY](https://uniapp.dcloud.net.cn/collocation/pages#mp-alipay) 和 <https://opendocs.alipay.com/mini/framework/app-json#window>
|
|
1317
1319
|
*
|
|
@@ -1422,13 +1424,13 @@ interface MpAlipay {
|
|
|
1422
1424
|
}
|
|
1423
1425
|
|
|
1424
1426
|
/**
|
|
1425
|
-
* 设置编译到 mp-
|
|
1427
|
+
* 设置编译到 mp-baidu 平台的特定样式,配置项参考 [MP-BAIDU](https://uniapp.dcloud.net.cn/collocation/pages.html#mp-baidu) 和 <https://smartprogram.baidu.com/docs/develop/framework/process/#window>
|
|
1426
1428
|
*
|
|
1427
|
-
* 相应的类型是
|
|
1429
|
+
* 相应的类型是 MpBaidu
|
|
1428
1430
|
*
|
|
1429
|
-
* @desc
|
|
1431
|
+
* @desc 百度小程序
|
|
1430
1432
|
*/
|
|
1431
|
-
interface
|
|
1433
|
+
interface MpBaidu {
|
|
1432
1434
|
/**
|
|
1433
1435
|
* 导航栏背景颜色,支持 HEX 颜色
|
|
1434
1436
|
*
|
|
@@ -1454,19 +1456,11 @@ interface MpWeixin {
|
|
|
1454
1456
|
*
|
|
1455
1457
|
* "custom" 自定义导航栏,只保留右上角胶囊按钮
|
|
1456
1458
|
*
|
|
1457
|
-
* @desc
|
|
1459
|
+
* @desc 2.10.34
|
|
1458
1460
|
*
|
|
1459
1461
|
* @default "default"
|
|
1460
1462
|
*/
|
|
1461
1463
|
navigationStyle?: 'default' | 'custom';
|
|
1462
|
-
/**
|
|
1463
|
-
* 在非首页、非页面栈最底层页面或非 tabbar 内页面中的导航栏展示 home 键
|
|
1464
|
-
*
|
|
1465
|
-
* @desc 微信客户端 8.0.24
|
|
1466
|
-
*
|
|
1467
|
-
* @default false
|
|
1468
|
-
*/
|
|
1469
|
-
homeButton?: boolean;
|
|
1470
1464
|
/**
|
|
1471
1465
|
* 窗口的背景色,支持 HEX 颜色
|
|
1472
1466
|
*
|
|
@@ -1482,94 +1476,64 @@ interface MpWeixin {
|
|
|
1482
1476
|
/**
|
|
1483
1477
|
* 顶部窗口的背景色,仅 iOS 支持
|
|
1484
1478
|
*
|
|
1485
|
-
* @desc 微信客户端 6.5.16
|
|
1486
|
-
*
|
|
1487
1479
|
* @default "#FFFFFF"
|
|
1488
1480
|
*/
|
|
1489
1481
|
backgroundColorTop?: HEXColor | ThemeVar;
|
|
1490
1482
|
/**
|
|
1491
1483
|
* 底部窗口的背景色,仅 iOS 支持
|
|
1492
1484
|
*
|
|
1493
|
-
* @desc 微信客户端 6.5.16
|
|
1494
|
-
*
|
|
1495
1485
|
* @default "#FFFFFF"
|
|
1496
1486
|
*/
|
|
1497
1487
|
backgroundColorBottom?: HEXColor | ThemeVar;
|
|
1498
1488
|
/**
|
|
1499
|
-
*
|
|
1489
|
+
* 是否开启全局的下拉刷新
|
|
1500
1490
|
*
|
|
1501
1491
|
* @default false
|
|
1502
1492
|
*/
|
|
1503
1493
|
enablePullDownRefresh?: boolean;
|
|
1504
1494
|
/**
|
|
1505
|
-
* 页面上拉触底事件触发时距页面底部距离,单位为 px
|
|
1495
|
+
* 页面上拉触底事件触发时距页面底部距离,单位为 px
|
|
1506
1496
|
*
|
|
1507
1497
|
* @default 50
|
|
1508
1498
|
*/
|
|
1509
1499
|
onReachBottomDistance?: number;
|
|
1510
1500
|
/**
|
|
1511
|
-
*
|
|
1512
|
-
*
|
|
1513
|
-
* "auto" 自动
|
|
1514
|
-
*
|
|
1515
|
-
* "portrait" 竖屏
|
|
1516
|
-
*
|
|
1517
|
-
* "landscape" 横屏
|
|
1518
|
-
*
|
|
1519
|
-
* @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)
|
|
1520
|
-
*
|
|
1521
|
-
* @default "portrait"
|
|
1522
|
-
*/
|
|
1523
|
-
pageOrientation?: 'auto' | 'portrait' | 'landscape';
|
|
1524
|
-
/**
|
|
1525
|
-
* 重新启动策略配置
|
|
1526
|
-
*
|
|
1527
|
-
* "homePage" 如果从这个页面退出小程序,下次将从首页冷启动
|
|
1528
|
-
*
|
|
1529
|
-
* "homePageAndLatestPage" 如果从这个页面退出小程序,下次冷启动后立刻加载这个页面,页面的参数保持不变(不可用于 tab 页)
|
|
1501
|
+
* 小程序页面是否禁止响应字体大小的设置
|
|
1530
1502
|
*
|
|
1531
|
-
*
|
|
1532
|
-
*/
|
|
1533
|
-
restartStrategy?: 'homePage' | 'homePageAndLatestPage';
|
|
1534
|
-
/**
|
|
1535
|
-
* 页面初始渲染缓存配置,详见 [初始渲染缓存](https://developers.weixin.qq.com/miniprogram/dev/framework/view/initial-rendering-cache.html)
|
|
1503
|
+
* "auto" 默认响应
|
|
1536
1504
|
*
|
|
1537
|
-
*
|
|
1538
|
-
*/
|
|
1539
|
-
initialRenderingCache?: 'static' | 'dynamic';
|
|
1540
|
-
/**
|
|
1541
|
-
* 切入系统后台时,隐藏页面内容,保护用户隐私
|
|
1505
|
+
* "none" 不响应
|
|
1542
1506
|
*
|
|
1543
|
-
* @desc
|
|
1507
|
+
* @desc 基础库版本 3.200.1
|
|
1544
1508
|
*
|
|
1545
|
-
* @default "
|
|
1509
|
+
* @default "auto"
|
|
1546
1510
|
*/
|
|
1547
|
-
|
|
1511
|
+
textSizeAdjust?: 'auto' | 'none';
|
|
1548
1512
|
/**
|
|
1549
|
-
*
|
|
1513
|
+
* 屏幕旋转设置,支持 auto / portrait / landscape
|
|
1550
1514
|
*
|
|
1551
|
-
* "
|
|
1515
|
+
* "auto" 自动
|
|
1552
1516
|
*
|
|
1553
|
-
* "
|
|
1517
|
+
* "portrait" 竖屏
|
|
1554
1518
|
*
|
|
1555
|
-
* "
|
|
1519
|
+
* "landscape" 横屏
|
|
1556
1520
|
*
|
|
1557
|
-
* @desc
|
|
1521
|
+
* @desc 基础库版本 3.450.8,web 化暂不支持
|
|
1558
1522
|
*
|
|
1559
|
-
* @default "
|
|
1523
|
+
* @default "portrait"
|
|
1560
1524
|
*/
|
|
1561
|
-
|
|
1525
|
+
pageOrientation?: 'auto' | 'portrait' | 'landscape';
|
|
1562
1526
|
[x: string]: any;
|
|
1563
1527
|
}
|
|
1564
1528
|
|
|
1565
1529
|
/**
|
|
1566
|
-
* 设置编译到 mp-
|
|
1530
|
+
* 设置编译到 mp-jd 平台的特定样式,配置项参考 <https://mp-docs.jd.com/doc/dev/framework/504#heading-3>
|
|
1567
1531
|
*
|
|
1568
|
-
* 相应的类型是
|
|
1532
|
+
* 相应的类型是 MpJd
|
|
1569
1533
|
*
|
|
1570
|
-
* @desc
|
|
1534
|
+
* @desc 京东小程序
|
|
1571
1535
|
*/
|
|
1572
|
-
interface
|
|
1536
|
+
interface MpJd {
|
|
1573
1537
|
/**
|
|
1574
1538
|
* 导航栏背景颜色,支持 HEX 颜色
|
|
1575
1539
|
*
|
|
@@ -1595,13 +1559,11 @@ interface MpBaidu {
|
|
|
1595
1559
|
*
|
|
1596
1560
|
* "custom" 自定义导航栏,只保留右上角胶囊按钮
|
|
1597
1561
|
*
|
|
1598
|
-
* @desc 2.10.34
|
|
1599
|
-
*
|
|
1600
1562
|
* @default "default"
|
|
1601
1563
|
*/
|
|
1602
1564
|
navigationStyle?: 'default' | 'custom';
|
|
1603
1565
|
/**
|
|
1604
|
-
*
|
|
1566
|
+
* 下拉窗口的背景色,不是页面的背景颜色
|
|
1605
1567
|
*
|
|
1606
1568
|
* @default "#FFFFFF"
|
|
1607
1569
|
*/
|
|
@@ -1625,54 +1587,22 @@ interface MpBaidu {
|
|
|
1625
1587
|
*/
|
|
1626
1588
|
backgroundColorBottom?: HEXColor | ThemeVar;
|
|
1627
1589
|
/**
|
|
1628
|
-
*
|
|
1590
|
+
* 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://mp-docs.jd.com/doc/dev/framework/520#heading-10)
|
|
1629
1591
|
*
|
|
1630
1592
|
* @default false
|
|
1631
1593
|
*/
|
|
1632
1594
|
enablePullDownRefresh?: boolean;
|
|
1633
|
-
/**
|
|
1634
|
-
* 页面上拉触底事件触发时距页面底部距离,单位为 px
|
|
1635
|
-
*
|
|
1636
|
-
* @default 50
|
|
1637
|
-
*/
|
|
1638
|
-
onReachBottomDistance?: number;
|
|
1639
|
-
/**
|
|
1640
|
-
* 小程序页面是否禁止响应字体大小的设置
|
|
1641
|
-
*
|
|
1642
|
-
* "auto" 默认响应
|
|
1643
|
-
*
|
|
1644
|
-
* "none" 不响应
|
|
1645
|
-
*
|
|
1646
|
-
* @desc 基础库版本 3.200.1
|
|
1647
|
-
*
|
|
1648
|
-
* @default "auto"
|
|
1649
|
-
*/
|
|
1650
|
-
textSizeAdjust?: 'auto' | 'none';
|
|
1651
|
-
/**
|
|
1652
|
-
* 屏幕旋转设置,支持 auto / portrait / landscape
|
|
1653
|
-
*
|
|
1654
|
-
* "auto" 自动
|
|
1655
|
-
*
|
|
1656
|
-
* "portrait" 竖屏
|
|
1657
|
-
*
|
|
1658
|
-
* "landscape" 横屏
|
|
1659
|
-
*
|
|
1660
|
-
* @desc 基础库版本 3.450.8,web 化暂不支持
|
|
1661
|
-
*
|
|
1662
|
-
* @default "portrait"
|
|
1663
|
-
*/
|
|
1664
|
-
pageOrientation?: 'auto' | 'portrait' | 'landscape';
|
|
1665
1595
|
[x: string]: any;
|
|
1666
1596
|
}
|
|
1667
1597
|
|
|
1668
1598
|
/**
|
|
1669
|
-
* 设置编译到 mp-
|
|
1599
|
+
* 设置编译到 mp-kuaishou 平台的特定样式,配置项参考 <https://mp.kuaishou.com/docs/develop/frame/config/conf_appjson.html#window>
|
|
1670
1600
|
*
|
|
1671
|
-
* 相应的类型是
|
|
1601
|
+
* 相应的类型是 MpKuaishou
|
|
1672
1602
|
*
|
|
1673
|
-
* @desc
|
|
1603
|
+
* @desc 快手小程序
|
|
1674
1604
|
*/
|
|
1675
|
-
interface
|
|
1605
|
+
interface MpKuaishou {
|
|
1676
1606
|
/**
|
|
1677
1607
|
* 导航栏背景颜色,支持 HEX 颜色
|
|
1678
1608
|
*
|
|
@@ -1682,7 +1612,7 @@ interface MpToutiao {
|
|
|
1682
1612
|
*/
|
|
1683
1613
|
navigationBarBackgroundColor?: HEXColor | ThemeVar;
|
|
1684
1614
|
/**
|
|
1685
|
-
*
|
|
1615
|
+
* 导航栏标题、状态栏颜色
|
|
1686
1616
|
*
|
|
1687
1617
|
* @default "white"
|
|
1688
1618
|
*/
|
|
@@ -1716,139 +1646,39 @@ interface MpToutiao {
|
|
|
1716
1646
|
/**
|
|
1717
1647
|
* 顶部窗口的背景色,仅 iOS 支持
|
|
1718
1648
|
*
|
|
1719
|
-
* @default
|
|
1649
|
+
* @default "#FFFFFF"
|
|
1720
1650
|
*/
|
|
1721
1651
|
backgroundColorTop?: HEXColor | ThemeVar;
|
|
1722
1652
|
/**
|
|
1723
1653
|
* 底部窗口的背景色,仅 iOS 支持
|
|
1724
1654
|
*
|
|
1725
|
-
* @default
|
|
1655
|
+
* @default "#FFFFFF"
|
|
1726
1656
|
*/
|
|
1727
1657
|
backgroundColorBottom?: HEXColor | ThemeVar;
|
|
1728
1658
|
/**
|
|
1729
|
-
*
|
|
1659
|
+
* 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://mp.kuaishou.com/docs/develop/frame/page/page_page.html#onpulldownrefresh)
|
|
1730
1660
|
*
|
|
1731
1661
|
* @default false
|
|
1732
1662
|
*/
|
|
1733
1663
|
enablePullDownRefresh?: boolean;
|
|
1734
1664
|
/**
|
|
1735
|
-
* 页面上拉触底事件触发时距页面底部距离,单位为 px
|
|
1665
|
+
* 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [Page.onReachBottom](https://mp.kuaishou.com/docs/develop/frame/page/page_page.html#onreachbottom)
|
|
1736
1666
|
*
|
|
1737
1667
|
* @default 50
|
|
1738
1668
|
*/
|
|
1739
1669
|
onReachBottomDistance?: number;
|
|
1740
1670
|
/**
|
|
1741
|
-
*
|
|
1742
|
-
*
|
|
1743
|
-
* "always" 一直透明
|
|
1671
|
+
* 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
|
|
1744
1672
|
*
|
|
1745
|
-
* "auto"
|
|
1673
|
+
* "auto" 自动
|
|
1746
1674
|
*
|
|
1747
|
-
* "
|
|
1675
|
+
* "portrait" 竖屏
|
|
1748
1676
|
*
|
|
1749
|
-
*
|
|
1750
|
-
*/
|
|
1751
|
-
transparentTitle?: 'always' | 'auto' | 'none';
|
|
1752
|
-
/**
|
|
1753
|
-
* 框架骨架屏配置,仅支持配置 config 属性,优先级高于 app.json,详见 [小程序框架骨架屏](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/guide/experience-optimization/list/skeleton)
|
|
1677
|
+
* "landscape" 横屏
|
|
1754
1678
|
*
|
|
1755
|
-
* @
|
|
1679
|
+
* @default "portrait"
|
|
1756
1680
|
*/
|
|
1757
|
-
|
|
1758
|
-
/**
|
|
1759
|
-
* 包含超时移除及自动生成配置等
|
|
1760
|
-
*/
|
|
1761
|
-
config?: {
|
|
1762
|
-
/**
|
|
1763
|
-
* 设置骨架屏超时移除时间,单位为 ms,为 0 时关闭超时移除
|
|
1764
|
-
*
|
|
1765
|
-
* @default 2000
|
|
1766
|
-
*/
|
|
1767
|
-
timeout?: number;
|
|
1768
|
-
/**
|
|
1769
|
-
* 骨架屏显示时的动画
|
|
1770
|
-
*
|
|
1771
|
-
* @default 'spin'
|
|
1772
|
-
*/
|
|
1773
|
-
loading?: 'spin' | 'chiaroscuro' | 'shine';
|
|
1774
|
-
/**
|
|
1775
|
-
* 骨架页面中图片块配置
|
|
1776
|
-
*
|
|
1777
|
-
* @default { shape: 'rect', color: '#efefef' }
|
|
1778
|
-
*/
|
|
1779
|
-
image?: {
|
|
1780
|
-
/**
|
|
1781
|
-
* 骨架页面中图片块形状
|
|
1782
|
-
*
|
|
1783
|
-
* circle 圆形
|
|
1784
|
-
*
|
|
1785
|
-
* rect 矩形
|
|
1786
|
-
*
|
|
1787
|
-
* @default "rect"
|
|
1788
|
-
*/
|
|
1789
|
-
shape?: 'circle' | 'rect';
|
|
1790
|
-
/**
|
|
1791
|
-
* 骨架页面中图片块颜色,支持 HEX 颜色
|
|
1792
|
-
*
|
|
1793
|
-
* @default "#efefef"
|
|
1794
|
-
*
|
|
1795
|
-
* @format color
|
|
1796
|
-
*/
|
|
1797
|
-
color?: HEXColor;
|
|
1798
|
-
[x: string]: any;
|
|
1799
|
-
};
|
|
1800
|
-
/**
|
|
1801
|
-
* 骨架页面中被视为按钮块的配置
|
|
1802
|
-
*
|
|
1803
|
-
* @default { color: '#efefef }
|
|
1804
|
-
*/
|
|
1805
|
-
button?: {
|
|
1806
|
-
/**
|
|
1807
|
-
* 骨架页面中被视为按钮块的颜色,支持 HEX 颜色
|
|
1808
|
-
*
|
|
1809
|
-
* @default "#efefef"
|
|
1810
|
-
*
|
|
1811
|
-
* @format color
|
|
1812
|
-
*/
|
|
1813
|
-
color?: HEXColor;
|
|
1814
|
-
[x: string]: any;
|
|
1815
|
-
};
|
|
1816
|
-
/**
|
|
1817
|
-
* 骨架屏背景色,支持 HEX 颜色
|
|
1818
|
-
*
|
|
1819
|
-
* @default "#fff"
|
|
1820
|
-
*
|
|
1821
|
-
* @format color
|
|
1822
|
-
*/
|
|
1823
|
-
backgroundColor?: HEXColor;
|
|
1824
|
-
/**
|
|
1825
|
-
* 默认为使用绝对定位占满全屏
|
|
1826
|
-
*
|
|
1827
|
-
* 当对自定义组件使用,作为局部加载的样式时,可设置为 "auto",高度随内容高度撑开
|
|
1828
|
-
*
|
|
1829
|
-
* @default "fullscreen"
|
|
1830
|
-
*/
|
|
1831
|
-
mode?: 'fullscreen' | 'auto';
|
|
1832
|
-
/**
|
|
1833
|
-
* CSS单位,元素绝对定位都使用 "vw" 与 "vh"
|
|
1834
|
-
*
|
|
1835
|
-
* @default "vw"
|
|
1836
|
-
*/
|
|
1837
|
-
cssUnit?: 'px' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax';
|
|
1838
|
-
/**
|
|
1839
|
-
* 生成骨架屏页面中 css 值保留的小数点位数,默认为 4
|
|
1840
|
-
*
|
|
1841
|
-
* @default 4
|
|
1842
|
-
*/
|
|
1843
|
-
decimal?: number;
|
|
1844
|
-
[x: string]: any;
|
|
1845
|
-
};
|
|
1846
|
-
/**
|
|
1847
|
-
* 页面路径同骨架屏文件的对应关系
|
|
1848
|
-
*/
|
|
1849
|
-
page?: Record<string, string>;
|
|
1850
|
-
[x: string]: any;
|
|
1851
|
-
};
|
|
1681
|
+
pageOrientation?: 'auto' | 'portrait' | 'landscape';
|
|
1852
1682
|
[x: string]: any;
|
|
1853
1683
|
}
|
|
1854
1684
|
|
|
@@ -2047,13 +1877,13 @@ interface MpQq {
|
|
|
2047
1877
|
}
|
|
2048
1878
|
|
|
2049
1879
|
/**
|
|
2050
|
-
* 设置编译到 mp-
|
|
1880
|
+
* 设置编译到 mp-toutiao 平台的特定样式,配置项参考 <https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/framework/general-configuration#window>
|
|
2051
1881
|
*
|
|
2052
|
-
* 相应的类型是
|
|
1882
|
+
* 相应的类型是 MpToutiao
|
|
2053
1883
|
*
|
|
2054
|
-
* @desc
|
|
1884
|
+
* @desc 抖音小程序
|
|
2055
1885
|
*/
|
|
2056
|
-
interface
|
|
1886
|
+
interface MpToutiao {
|
|
2057
1887
|
/**
|
|
2058
1888
|
* 导航栏背景颜色,支持 HEX 颜色
|
|
2059
1889
|
*
|
|
@@ -2063,7 +1893,7 @@ interface MpKuaishou {
|
|
|
2063
1893
|
*/
|
|
2064
1894
|
navigationBarBackgroundColor?: HEXColor | ThemeVar;
|
|
2065
1895
|
/**
|
|
2066
|
-
*
|
|
1896
|
+
* 导航栏标题颜色,同时影响标题颜色、右胶囊颜色、左返回箭头颜色
|
|
2067
1897
|
*
|
|
2068
1898
|
* @default "white"
|
|
2069
1899
|
*/
|
|
@@ -2097,50 +1927,150 @@ interface MpKuaishou {
|
|
|
2097
1927
|
/**
|
|
2098
1928
|
* 顶部窗口的背景色,仅 iOS 支持
|
|
2099
1929
|
*
|
|
2100
|
-
* @default
|
|
1930
|
+
* @default 同 backgroundColor
|
|
2101
1931
|
*/
|
|
2102
1932
|
backgroundColorTop?: HEXColor | ThemeVar;
|
|
2103
1933
|
/**
|
|
2104
1934
|
* 底部窗口的背景色,仅 iOS 支持
|
|
2105
1935
|
*
|
|
2106
|
-
* @default
|
|
1936
|
+
* @default 同 backgroundColor
|
|
2107
1937
|
*/
|
|
2108
1938
|
backgroundColorBottom?: HEXColor | ThemeVar;
|
|
2109
1939
|
/**
|
|
2110
|
-
*
|
|
1940
|
+
* 是否开启全局的下拉刷新
|
|
2111
1941
|
*
|
|
2112
1942
|
* @default false
|
|
2113
1943
|
*/
|
|
2114
1944
|
enablePullDownRefresh?: boolean;
|
|
2115
1945
|
/**
|
|
2116
|
-
* 页面上拉触底事件触发时距页面底部距离,单位为 px
|
|
1946
|
+
* 页面上拉触底事件触发时距页面底部距离,单位为 px
|
|
2117
1947
|
*
|
|
2118
1948
|
* @default 50
|
|
2119
1949
|
*/
|
|
2120
1950
|
onReachBottomDistance?: number;
|
|
2121
1951
|
/**
|
|
2122
|
-
*
|
|
1952
|
+
* 仅在 navigationStyle 为 "default" 时生效,用来控制导航栏透明设置
|
|
2123
1953
|
*
|
|
2124
|
-
* "
|
|
1954
|
+
* "always" 一直透明
|
|
2125
1955
|
*
|
|
2126
|
-
* "
|
|
1956
|
+
* "auto" 滑动自适应
|
|
2127
1957
|
*
|
|
2128
|
-
* "
|
|
1958
|
+
* "none" 不透明
|
|
2129
1959
|
*
|
|
2130
|
-
* @default "
|
|
1960
|
+
* @default "none"
|
|
2131
1961
|
*/
|
|
2132
|
-
|
|
1962
|
+
transparentTitle?: 'always' | 'auto' | 'none';
|
|
1963
|
+
/**
|
|
1964
|
+
* 框架骨架屏配置,仅支持配置 config 属性,优先级高于 app.json,详见 [小程序框架骨架屏](https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/guide/experience-optimization/list/skeleton)
|
|
1965
|
+
*
|
|
1966
|
+
* @desc 2.47.0
|
|
1967
|
+
*/
|
|
1968
|
+
skeleton?: {
|
|
1969
|
+
/**
|
|
1970
|
+
* 包含超时移除及自动生成配置等
|
|
1971
|
+
*/
|
|
1972
|
+
config?: {
|
|
1973
|
+
/**
|
|
1974
|
+
* 设置骨架屏超时移除时间,单位为 ms,为 0 时关闭超时移除
|
|
1975
|
+
*
|
|
1976
|
+
* @default 2000
|
|
1977
|
+
*/
|
|
1978
|
+
timeout?: number;
|
|
1979
|
+
/**
|
|
1980
|
+
* 骨架屏显示时的动画
|
|
1981
|
+
*
|
|
1982
|
+
* @default 'spin'
|
|
1983
|
+
*/
|
|
1984
|
+
loading?: 'spin' | 'chiaroscuro' | 'shine';
|
|
1985
|
+
/**
|
|
1986
|
+
* 骨架页面中图片块配置
|
|
1987
|
+
*
|
|
1988
|
+
* @default { shape: 'rect', color: '#efefef' }
|
|
1989
|
+
*/
|
|
1990
|
+
image?: {
|
|
1991
|
+
/**
|
|
1992
|
+
* 骨架页面中图片块形状
|
|
1993
|
+
*
|
|
1994
|
+
* circle 圆形
|
|
1995
|
+
*
|
|
1996
|
+
* rect 矩形
|
|
1997
|
+
*
|
|
1998
|
+
* @default "rect"
|
|
1999
|
+
*/
|
|
2000
|
+
shape?: 'circle' | 'rect';
|
|
2001
|
+
/**
|
|
2002
|
+
* 骨架页面中图片块颜色,支持 HEX 颜色
|
|
2003
|
+
*
|
|
2004
|
+
* @default "#efefef"
|
|
2005
|
+
*
|
|
2006
|
+
* @format color
|
|
2007
|
+
*/
|
|
2008
|
+
color?: HEXColor;
|
|
2009
|
+
[x: string]: any;
|
|
2010
|
+
};
|
|
2011
|
+
/**
|
|
2012
|
+
* 骨架页面中被视为按钮块的配置
|
|
2013
|
+
*
|
|
2014
|
+
* @default { color: '#efefef }
|
|
2015
|
+
*/
|
|
2016
|
+
button?: {
|
|
2017
|
+
/**
|
|
2018
|
+
* 骨架页面中被视为按钮块的颜色,支持 HEX 颜色
|
|
2019
|
+
*
|
|
2020
|
+
* @default "#efefef"
|
|
2021
|
+
*
|
|
2022
|
+
* @format color
|
|
2023
|
+
*/
|
|
2024
|
+
color?: HEXColor;
|
|
2025
|
+
[x: string]: any;
|
|
2026
|
+
};
|
|
2027
|
+
/**
|
|
2028
|
+
* 骨架屏背景色,支持 HEX 颜色
|
|
2029
|
+
*
|
|
2030
|
+
* @default "#fff"
|
|
2031
|
+
*
|
|
2032
|
+
* @format color
|
|
2033
|
+
*/
|
|
2034
|
+
backgroundColor?: HEXColor;
|
|
2035
|
+
/**
|
|
2036
|
+
* 默认为使用绝对定位占满全屏
|
|
2037
|
+
*
|
|
2038
|
+
* 当对自定义组件使用,作为局部加载的样式时,可设置为 "auto",高度随内容高度撑开
|
|
2039
|
+
*
|
|
2040
|
+
* @default "fullscreen"
|
|
2041
|
+
*/
|
|
2042
|
+
mode?: 'fullscreen' | 'auto';
|
|
2043
|
+
/**
|
|
2044
|
+
* CSS单位,元素绝对定位都使用 "vw" 与 "vh"
|
|
2045
|
+
*
|
|
2046
|
+
* @default "vw"
|
|
2047
|
+
*/
|
|
2048
|
+
cssUnit?: 'px' | 'rem' | 'vw' | 'vh' | 'vmin' | 'vmax';
|
|
2049
|
+
/**
|
|
2050
|
+
* 生成骨架屏页面中 css 值保留的小数点位数,默认为 4
|
|
2051
|
+
*
|
|
2052
|
+
* @default 4
|
|
2053
|
+
*/
|
|
2054
|
+
decimal?: number;
|
|
2055
|
+
[x: string]: any;
|
|
2056
|
+
};
|
|
2057
|
+
/**
|
|
2058
|
+
* 页面路径同骨架屏文件的对应关系
|
|
2059
|
+
*/
|
|
2060
|
+
page?: Record<string, string>;
|
|
2061
|
+
[x: string]: any;
|
|
2062
|
+
};
|
|
2133
2063
|
[x: string]: any;
|
|
2134
2064
|
}
|
|
2135
2065
|
|
|
2136
2066
|
/**
|
|
2137
|
-
* 设置编译到 mp-
|
|
2067
|
+
* 设置编译到 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>
|
|
2138
2068
|
*
|
|
2139
|
-
* 相应的类型是
|
|
2069
|
+
* 相应的类型是 MpWeixin
|
|
2140
2070
|
*
|
|
2141
|
-
* @desc
|
|
2071
|
+
* @desc 微信小程序
|
|
2142
2072
|
*/
|
|
2143
|
-
interface
|
|
2073
|
+
interface MpWeixin {
|
|
2144
2074
|
/**
|
|
2145
2075
|
* 导航栏背景颜色,支持 HEX 颜色
|
|
2146
2076
|
*
|
|
@@ -2166,11 +2096,21 @@ interface MpJd {
|
|
|
2166
2096
|
*
|
|
2167
2097
|
* "custom" 自定义导航栏,只保留右上角胶囊按钮
|
|
2168
2098
|
*
|
|
2099
|
+
* @desc iOS / Android 微信客户端 6.6.0,Windows 微信客户端不支持
|
|
2100
|
+
*
|
|
2169
2101
|
* @default "default"
|
|
2170
2102
|
*/
|
|
2171
2103
|
navigationStyle?: 'default' | 'custom';
|
|
2172
2104
|
/**
|
|
2173
|
-
*
|
|
2105
|
+
* 在非首页、非页面栈最底层页面或非 tabbar 内页面中的导航栏展示 home 键
|
|
2106
|
+
*
|
|
2107
|
+
* @desc 微信客户端 8.0.24
|
|
2108
|
+
*
|
|
2109
|
+
* @default false
|
|
2110
|
+
*/
|
|
2111
|
+
homeButton?: boolean;
|
|
2112
|
+
/**
|
|
2113
|
+
* 窗口的背景色,支持 HEX 颜色
|
|
2174
2114
|
*
|
|
2175
2115
|
* @default "#FFFFFF"
|
|
2176
2116
|
*/
|
|
@@ -2184,21 +2124,83 @@ interface MpJd {
|
|
|
2184
2124
|
/**
|
|
2185
2125
|
* 顶部窗口的背景色,仅 iOS 支持
|
|
2186
2126
|
*
|
|
2127
|
+
* @desc 微信客户端 6.5.16
|
|
2128
|
+
*
|
|
2187
2129
|
* @default "#FFFFFF"
|
|
2188
2130
|
*/
|
|
2189
2131
|
backgroundColorTop?: HEXColor | ThemeVar;
|
|
2190
2132
|
/**
|
|
2191
2133
|
* 底部窗口的背景色,仅 iOS 支持
|
|
2192
2134
|
*
|
|
2135
|
+
* @desc 微信客户端 6.5.16
|
|
2136
|
+
*
|
|
2193
2137
|
* @default "#FFFFFF"
|
|
2194
2138
|
*/
|
|
2195
2139
|
backgroundColorBottom?: HEXColor | ThemeVar;
|
|
2196
2140
|
/**
|
|
2197
|
-
* 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://
|
|
2141
|
+
* 是否开启全局的下拉刷新,详见 [Page.onPullDownRefresh](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onpulldownrefresh)
|
|
2198
2142
|
*
|
|
2199
2143
|
* @default false
|
|
2200
2144
|
*/
|
|
2201
2145
|
enablePullDownRefresh?: boolean;
|
|
2146
|
+
/**
|
|
2147
|
+
* 页面上拉触底事件触发时距页面底部距离,单位为 px,详见 [Page.onReachBottom](https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html#onreachbottom)
|
|
2148
|
+
*
|
|
2149
|
+
* @default 50
|
|
2150
|
+
*/
|
|
2151
|
+
onReachBottomDistance?: number;
|
|
2152
|
+
/**
|
|
2153
|
+
* 屏幕旋转设置,支持 auto / portrait / landscape,详见 [响应显示区域变化](https://developers.weixin.qq.com/miniprogram/dev/framework/view/resizable.html)
|
|
2154
|
+
*
|
|
2155
|
+
* "auto" 自动
|
|
2156
|
+
*
|
|
2157
|
+
* "portrait" 竖屏
|
|
2158
|
+
*
|
|
2159
|
+
* "landscape" 横屏
|
|
2160
|
+
*
|
|
2161
|
+
* @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)
|
|
2162
|
+
*
|
|
2163
|
+
* @default "portrait"
|
|
2164
|
+
*/
|
|
2165
|
+
pageOrientation?: 'auto' | 'portrait' | 'landscape';
|
|
2166
|
+
/**
|
|
2167
|
+
* 重新启动策略配置
|
|
2168
|
+
*
|
|
2169
|
+
* "homePage" 如果从这个页面退出小程序,下次将从首页冷启动
|
|
2170
|
+
*
|
|
2171
|
+
* "homePageAndLatestPage" 如果从这个页面退出小程序,下次冷启动后立刻加载这个页面,页面的参数保持不变(不可用于 tab 页)
|
|
2172
|
+
*
|
|
2173
|
+
* @desc [2.8.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
2174
|
+
*/
|
|
2175
|
+
restartStrategy?: 'homePage' | 'homePageAndLatestPage';
|
|
2176
|
+
/**
|
|
2177
|
+
* 页面初始渲染缓存配置,详见 [初始渲染缓存](https://developers.weixin.qq.com/miniprogram/dev/framework/view/initial-rendering-cache.html)
|
|
2178
|
+
*
|
|
2179
|
+
* @desc [2.11.1](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
2180
|
+
*/
|
|
2181
|
+
initialRenderingCache?: 'static' | 'dynamic';
|
|
2182
|
+
/**
|
|
2183
|
+
* 切入系统后台时,隐藏页面内容,保护用户隐私
|
|
2184
|
+
*
|
|
2185
|
+
* @desc [2.15.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
2186
|
+
*
|
|
2187
|
+
* @default "none"
|
|
2188
|
+
*/
|
|
2189
|
+
visualEffectInBackground?: 'hidden' | 'none';
|
|
2190
|
+
/**
|
|
2191
|
+
* 控制预加载下个页面的时机,详见 [控制预加载下个页面的时机](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)
|
|
2192
|
+
*
|
|
2193
|
+
* "static" 在当前页面 onReady 触发 200ms 后触发预加载
|
|
2194
|
+
*
|
|
2195
|
+
* "auto" 渲染线程空闲时进行预加载,由基础库根据一段时间内 requestAnimationFrame 的触发频率算法判断
|
|
2196
|
+
*
|
|
2197
|
+
* "manual" 由开发者通过调用 [wx.preloadWebview](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.preloadWebview.html) 触发,开发者可以在页面主要内容的 setData 结束后手动触发
|
|
2198
|
+
*
|
|
2199
|
+
* @desc [2.15.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)
|
|
2200
|
+
*
|
|
2201
|
+
* @default "static"
|
|
2202
|
+
*/
|
|
2203
|
+
handleWebviewPreload?: 'static' | 'manual' | 'auto';
|
|
2202
2204
|
[x: string]: any;
|
|
2203
2205
|
}
|
|
2204
2206
|
|
|
@@ -2921,12 +2923,32 @@ interface UserPagesConfig extends PagesConfig {
|
|
|
2921
2923
|
|
|
2922
2924
|
declare function defineUniPages(config: UserPagesConfig): UserPagesConfig;
|
|
2923
2925
|
|
|
2926
|
+
declare class Page {
|
|
2927
|
+
ctx: PageContext;
|
|
2928
|
+
path: PagePath;
|
|
2929
|
+
private rawOptions;
|
|
2930
|
+
private options;
|
|
2931
|
+
constructor(ctx: PageContext, path: PagePath);
|
|
2932
|
+
getPageMeta(forceUpdate?: boolean): Promise<PageMetaDatum>;
|
|
2933
|
+
hasChanged(): Promise<boolean>;
|
|
2934
|
+
readPageMeta(): Promise<{
|
|
2935
|
+
options: PageMetaDatum;
|
|
2936
|
+
hasChanged: boolean;
|
|
2937
|
+
}>;
|
|
2938
|
+
private readPageMetaFromFile;
|
|
2939
|
+
}
|
|
2940
|
+
declare function parseSFC(code: string, options?: SFCParseOptions): SFCDescriptor;
|
|
2941
|
+
declare function tryPageMetaFromMacro(sfc: SFCDescriptor): Promise<UserPageMeta | undefined>;
|
|
2942
|
+
declare function tryPageMetaFromCustomBlock(sfc: SFCDescriptor, routeBlockLang: RouteBlockLang): Promise<UserPageMeta>;
|
|
2943
|
+
declare function findMacro(stmts: t.Statement[], filename: string): t.CallExpression | undefined;
|
|
2944
|
+
declare function findImports(stmts: t.Statement[]): t.ImportDeclaration[];
|
|
2945
|
+
|
|
2924
2946
|
declare class PageContext {
|
|
2925
2947
|
private _server;
|
|
2926
2948
|
pagesGlobConfig: PagesConfig | undefined;
|
|
2927
2949
|
pagesConfigSourcePaths: string[];
|
|
2928
|
-
|
|
2929
|
-
|
|
2950
|
+
pages: Map<string, Page>;
|
|
2951
|
+
subPages: Map<string, Map<string, Page>>;
|
|
2930
2952
|
pageMetaData: PageMetaDatum[];
|
|
2931
2953
|
subPageMetaData: SubPageMetaDatum[];
|
|
2932
2954
|
resolvedPagesJSONPath: string;
|
|
@@ -2946,7 +2968,6 @@ declare class PageContext {
|
|
|
2946
2968
|
setupViteServer(server: ViteDevServer): void;
|
|
2947
2969
|
setupWatcher(watcher: FSWatcher): Promise<void>;
|
|
2948
2970
|
onUpdate(): void;
|
|
2949
|
-
parsePage(page: PagePath): Promise<PageMetaDatum>;
|
|
2950
2971
|
/**
|
|
2951
2972
|
* parse pages rules && set page type
|
|
2952
2973
|
* @param pages page path array
|
|
@@ -2954,7 +2975,7 @@ declare class PageContext {
|
|
|
2954
2975
|
* @param overrides custom page config
|
|
2955
2976
|
* @returns pages rules
|
|
2956
2977
|
*/
|
|
2957
|
-
parsePages(pages:
|
|
2978
|
+
parsePages(pages: Map<string, Page>, type: 'main' | 'sub', overrides?: PageMetaDatum[]): Promise<PageMetaDatum[]>;
|
|
2958
2979
|
/**
|
|
2959
2980
|
* set home page
|
|
2960
2981
|
* @param result pages rules array
|
|
@@ -2980,6 +3001,7 @@ declare const debug: {
|
|
|
2980
3001
|
error: Debug.Debugger;
|
|
2981
3002
|
cache: Debug.Debugger;
|
|
2982
3003
|
declaration: Debug.Debugger;
|
|
3004
|
+
definePage: Debug.Debugger;
|
|
2983
3005
|
};
|
|
2984
3006
|
declare function extsToGlob(extensions: string[]): string;
|
|
2985
3007
|
declare function isTargetFile(path: string): boolean;
|
|
@@ -2989,10 +3011,13 @@ declare function isTargetFile(path: string): boolean;
|
|
|
2989
3011
|
* TODO: support merge middleware
|
|
2990
3012
|
*/
|
|
2991
3013
|
declare function mergePageMetaDataArray(pageMetaData: PageMetaDatum[]): PageMetaDatum[];
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
3014
|
+
/**
|
|
3015
|
+
* 执行 TypeScript 代码字符串并返回其返回值
|
|
3016
|
+
* @param code - TypeScript 代码字符串
|
|
3017
|
+
* @returns 返回值
|
|
3018
|
+
*/
|
|
3019
|
+
declare function execScript(code: string, filename: string): Promise<any>;
|
|
3020
|
+
declare const babelGenerate: typeof babelGenerator;
|
|
2996
3021
|
|
|
2997
3022
|
interface CustomBlock {
|
|
2998
3023
|
attr: Record<string, any>;
|
|
@@ -3000,6 +3025,7 @@ interface CustomBlock {
|
|
|
3000
3025
|
}
|
|
3001
3026
|
type debugType = keyof typeof debug;
|
|
3002
3027
|
type ConfigSource = string | LoadConfigSource<PagesConfig> | LoadConfigSource<PagesConfig>[];
|
|
3028
|
+
type RouteBlockLang = 'json5' | 'jsonc' | 'json' | 'yaml' | 'yml';
|
|
3003
3029
|
interface Options {
|
|
3004
3030
|
/**
|
|
3005
3031
|
* Generate TypeScript declaration for pages path
|
|
@@ -3049,7 +3075,7 @@ interface Options {
|
|
|
3049
3075
|
* Set the default route block parser, or use `<route lang="xxx">` in SFC route block
|
|
3050
3076
|
* @default 'json5'
|
|
3051
3077
|
*/
|
|
3052
|
-
routeBlockLang:
|
|
3078
|
+
routeBlockLang: RouteBlockLang;
|
|
3053
3079
|
/**
|
|
3054
3080
|
* minify the `pages.json`
|
|
3055
3081
|
* @default false
|
|
@@ -3110,12 +3136,28 @@ interface SubPageMetaDatum {
|
|
|
3110
3136
|
root: string;
|
|
3111
3137
|
pages: PageMetaDatum[];
|
|
3112
3138
|
}
|
|
3139
|
+
interface UserPageMeta extends Partial<PageMetaDatum> {
|
|
3140
|
+
/**
|
|
3141
|
+
* 配置页面路径
|
|
3142
|
+
* @deprecated 可选,将会根据文件路径自动生成
|
|
3143
|
+
*/
|
|
3144
|
+
path?: string;
|
|
3145
|
+
}
|
|
3146
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
3147
|
+
type MaybeCallable<T> = T | (() => T);
|
|
3148
|
+
type MaybePromiseCallable<T> = T | (() => T) | (() => Promise<T>);
|
|
3149
|
+
declare function definePage(options: MaybePromiseCallable<UserPageMeta>): void;
|
|
3150
|
+
type DefinePage = typeof definePage;
|
|
3113
3151
|
|
|
3114
3152
|
declare const MODULE_ID_VIRTUAL = "virtual:uni-pages";
|
|
3115
3153
|
declare const RESOLVED_MODULE_ID_VIRTUAL = "\0virtual:uni-pages";
|
|
3116
3154
|
declare const OUTPUT_NAME = "pages.json";
|
|
3117
3155
|
declare const FILE_EXTENSIONS: string[];
|
|
3118
3156
|
|
|
3157
|
+
declare function parseCustomBlock(block: SFCBlock, filePath: string, routeBlockLang: RouteBlockLang): CustomBlock | undefined;
|
|
3158
|
+
declare function getRouteSfcBlock(sfc?: SFCDescriptor): SFCBlock | undefined;
|
|
3159
|
+
declare function getRouteBlock(path: string, blockStr: SFCBlock | undefined, routeBlockLang: RouteBlockLang): CustomBlock | undefined;
|
|
3160
|
+
|
|
3119
3161
|
/**
|
|
3120
3162
|
* Resolves the files that are valid pages for the given context.
|
|
3121
3163
|
*/
|
|
@@ -3130,12 +3172,7 @@ declare function resolveOptions(userOptions: UserOptions, viteRoot?: string): Re
|
|
|
3130
3172
|
*/
|
|
3131
3173
|
declare function resolvePageDirs(dir: string, root: string, exclude: string[]): string[];
|
|
3132
3174
|
|
|
3133
|
-
declare function parseSFC(code: string): Promise<SFCDescriptor>;
|
|
3134
|
-
declare function parseCustomBlock(block: SFCBlock, filePath: string, options: ResolvedOptions): CustomBlock | undefined;
|
|
3135
|
-
declare function getRouteSfcBlock(path: string): Promise<SFCBlock | undefined>;
|
|
3136
|
-
declare function getRouteBlock(path: string, blockStr: SFCBlock | undefined, options: ResolvedOptions): Promise<CustomBlock | undefined>;
|
|
3137
|
-
|
|
3138
3175
|
declare function VitePluginUniPages(userOptions?: UserOptions): Plugin;
|
|
3139
3176
|
|
|
3140
|
-
export { FILE_EXTENSIONS, MODULE_ID_VIRTUAL, OUTPUT_NAME, PageContext, RESOLVED_MODULE_ID_VIRTUAL, VitePluginUniPages, checkPagesJsonFile, debug, VitePluginUniPages as default, defineUniPages, extsToGlob, getPageFiles, getRouteBlock, getRouteSfcBlock, invalidatePagesModule, isTargetFile, mergePageMetaDataArray, parseCustomBlock, parseSFC, readFileSync, resolveOptions, resolvePageDirs,
|
|
3141
|
-
export type { Condition, ConditionItem, ConfigSource, CustomBlock, EasyCom, GlobalStyle, Options, PageMetaDatum, PagePath, PagesConfig, ResolvedOptions, SubPackage, SubPackages, SubPageMetaDatum, TabBar, TabBarIconFont, TabBarItem, TabBarMidButton, TheWindow, UniIdRouter, UserOptions, UserPagesConfig, debugType };
|
|
3177
|
+
export { FILE_EXTENSIONS, MODULE_ID_VIRTUAL, OUTPUT_NAME, Page, PageContext, RESOLVED_MODULE_ID_VIRTUAL, VitePluginUniPages, babelGenerate, checkPagesJsonFile, debug, VitePluginUniPages as default, definePage, defineUniPages, execScript, extsToGlob, findImports, findMacro, getPageFiles, getRouteBlock, getRouteSfcBlock, invalidatePagesModule, isTargetFile, mergePageMetaDataArray, parseCustomBlock, parseSFC, readFileSync, resolveOptions, resolvePageDirs, tryPageMetaFromCustomBlock, tryPageMetaFromMacro, writeFileSync };
|
|
3178
|
+
export type { Condition, ConditionItem, ConfigSource, CustomBlock, DefinePage, EasyCom, GlobalStyle, MaybeCallable, MaybePromise, MaybePromiseCallable, Options, PageMetaDatum, PagePath, PagesConfig, ResolvedOptions, RouteBlockLang, SubPackage, SubPackages, SubPageMetaDatum, TabBar, TabBarIconFont, TabBarItem, TabBarMidButton, TheWindow, UniIdRouter, UserOptions, UserPageMeta, UserPagesConfig, debugType };
|