From 0e68148480be3fd10e128bcdbc55ebc25a24874b Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Sat, 15 Nov 2025 02:00:19 +0000 Subject: [PATCH] refactor(types): sync components types --- docs/apis/ai/visionkit/VKCamera.md | 6 +- docs/apis/ai/visionkit/VKFrame.md | 2 +- docs/apis/ai/visionkit/VKMarkerAnchor.md | 2 +- docs/apis/ai/visionkit/VKPlaneAnchor.md | 2 +- docs/apis/ai/visionkit/VKSession.md | 2 +- docs/apis/base/system/getSystemInfo.md | 1 + docs/apis/base/system/getSystemInfoAsync.md | 1 + docs/apis/base/system/getSystemInfoSync.md | 1 + docs/apis/canvas/ImageData.md | 2 +- docs/apis/canvas/canvasGetImageData.md | 2 +- docs/apis/canvas/canvasPutImageData.md | 2 +- docs/apis/canvas/createCanvasContext.md | 2 +- docs/apis/cloud/cloud.md | 1 + docs/apis/device/keyboard/hideKeyboard.md | 2 +- docs/apis/device/memory/offMemoryWarning.md | 2 +- docs/apis/device/memory/onMemoryWarning.md | 2 +- docs/apis/files/getFileSystemManager.md | 2 +- docs/apis/location/getLocation.md | 2 +- docs/apis/media/audio/AudioBuffer.md | 6 +- docs/apis/media/audio/WebAudioContext.md | 14 +- docs/apis/media/video/chooseMedia.md | 2 +- docs/apis/media/video/createVideoContext.md | 2 +- docs/apis/network/download/downloadFile.md | 2 +- docs/apis/network/request/request.md | 3 +- docs/apis/network/upload/uploadFile.md | 2 +- .../requestSubscribeMessage.md | 6 +- docs/apis/route/switchTab.md | 2 +- docs/apis/share/updateShareMenu.md | 24 +-- docs/apis/storage/clearStorage.md | 2 +- docs/apis/storage/createBufferURL.md | 2 +- docs/apis/taro.extend/getCurrentInstance.md | 2 +- docs/apis/taro.extend/interceptorify.md | 14 +- docs/apis/taro.hooks/useKeyboardHeight.md | 20 +++ docs/apis/taro.hooks/useLoad.md | 2 +- docs/apis/taro.hooks/useReady.md | 2 +- docs/apis/taro.hooks/useUnload.md | 2 +- docs/apis/ui/tab-bar/hideTabBar.md | 2 +- docs/apis/ui/tab-bar/hideTabBarRedDot.md | 2 +- docs/apis/ui/tab-bar/removeTabBarBadge.md | 2 +- docs/apis/ui/tab-bar/setTabBarBadge.md | 2 +- docs/apis/ui/tab-bar/setTabBarItem.md | 2 +- docs/apis/ui/tab-bar/showTabBar.md | 2 +- docs/apis/ui/tab-bar/showTabBarRedDot.md | 2 +- docs/components/forms/textarea.md | 2 +- docs/components/list-item.md | 10 ++ docs/components/list.md | 24 +++ docs/components/page-meta.md | 34 ++--- docs/components/viewContainer/cover-image.md | 28 ++-- docs/components/viewContainer/cover-view.md | 62 ++++---- .../viewContainer/custom-wrapper.md | 2 +- docs/components/viewContainer/match-media.md | 20 +-- docs/components/viewContainer/movable-area.md | 8 +- docs/components/viewContainer/movable-view.md | 60 ++++---- docs/components/viewContainer/native-slot.md | 2 +- .../viewContainer/page-container.md | 42 +++--- docs/components/viewContainer/root-portal.md | 8 +- docs/components/viewContainer/script.md | 10 +- docs/components/viewContainer/scroll-view.md | 138 +++++++++--------- docs/components/viewContainer/slot.md | 10 +- docs/components/viewContainer/swiper-item.md | 12 +- docs/components/viewContainer/swiper.md | 104 ++++++------- docs/components/viewContainer/view.md | 56 +++---- packages/taro-components/types/CoverView.d.ts | 16 ++ packages/taro-components/types/List.d.ts | 38 +++++ packages/taro-components/types/ListItem.d.ts | 6 + packages/taro-components/types/Textarea.d.ts | 4 +- packages/taro-components/types/index.d.ts | 2 + packages/taro/types/api/base/system.d.ts | 36 +++++ packages/taro/types/api/canvas/index.d.ts | 2 +- packages/taro/types/api/cloud/index.d.ts | 6 +- packages/taro/types/api/device/keyboard.d.ts | 2 +- packages/taro/types/api/device/memory.d.ts | 4 +- packages/taro/types/api/files/index.d.ts | 2 +- packages/taro/types/api/location/index.d.ts | 2 +- packages/taro/types/api/media/audio.d.ts | 6 +- packages/taro/types/api/media/video.d.ts | 4 +- packages/taro/types/api/media/voip.d.ts | 4 +- packages/taro/types/api/network/download.d.ts | 2 +- packages/taro/types/api/network/request.d.ts | 5 + packages/taro/types/api/network/upload.d.ts | 2 +- .../types/api/open-api/subscribe-message.d.ts | 7 +- packages/taro/types/api/route/index.d.ts | 2 +- packages/taro/types/api/share/index.d.ts | 48 ++++-- packages/taro/types/api/storage/index.d.ts | 4 +- packages/taro/types/api/taro.extend.d.ts | 17 ++- packages/taro/types/api/taro.hooks.d.ts | 12 +- packages/taro/types/api/ui/tab-bar.d.ts | 14 +- packages/taro/types/compile/config/h5.d.ts | 9 +- packages/taro/types/compile/config/mini.d.ts | 5 +- .../types/compile/viteCompilerContext.d.ts | 12 +- packages/taro/types/global.d.ts | 1 + packages/taro/types/index.d.ts | 1 + packages/taro/types/taro.component.d.ts | 2 + packages/taro/types/taro.config.d.ts | 4 +- 94 files changed, 660 insertions(+), 412 deletions(-) create mode 100644 docs/apis/taro.hooks/useKeyboardHeight.md create mode 100644 docs/components/list-item.md create mode 100644 docs/components/list.md create mode 100644 packages/taro-components/types/List.d.ts create mode 100644 packages/taro-components/types/ListItem.d.ts diff --git a/docs/apis/ai/visionkit/VKCamera.md b/docs/apis/ai/visionkit/VKCamera.md index b9d413d291f2..800e43effd77 100644 --- a/docs/apis/ai/visionkit/VKCamera.md +++ b/docs/apis/ai/visionkit/VKCamera.md @@ -13,8 +13,8 @@ sidebar_label: VKCamera | 参数 | 类型 | 说明 | | --- | --- | --- | -| viewMatrix | `Float32Array` | 视图矩阵 | -| intrinsics | `Float32Array` | 相机内参,只有 v2 版本支持 | +| viewMatrix | `Float32Array` | 视图矩阵 | +| intrinsics | `Float32Array` | 相机内参,只有 v2 版本支持 | ### getProjectionMatrix @@ -25,7 +25,7 @@ sidebar_label: VKCamera > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKCamera.getProjectionMatrix.html) ```tsx -(near: number, far: number) => Float32Array +(near: number, far: number) => Float32Array ``` | 参数 | 类型 | 说明 | diff --git a/docs/apis/ai/visionkit/VKFrame.md b/docs/apis/ai/visionkit/VKFrame.md index d9ae075d9603..bf40e8ffbd9e 100644 --- a/docs/apis/ai/visionkit/VKFrame.md +++ b/docs/apis/ai/visionkit/VKFrame.md @@ -60,7 +60,7 @@ vision kit 会话对象 > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getDisplayTransform.html) ```tsx -() => Float32Array +() => Float32Array ``` ## 参数 diff --git a/docs/apis/ai/visionkit/VKMarkerAnchor.md b/docs/apis/ai/visionkit/VKMarkerAnchor.md index dcf1a20a161e..d62dfce73409 100644 --- a/docs/apis/ai/visionkit/VKMarkerAnchor.md +++ b/docs/apis/ai/visionkit/VKMarkerAnchor.md @@ -15,7 +15,7 @@ marker anchor | --- | --- | --- | | id | `number` | 唯一标识 | | type | `1` | 类型 | -| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | +| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | | markerId | `number` | marker id | | path | `string` | 图片路径 | diff --git a/docs/apis/ai/visionkit/VKPlaneAnchor.md b/docs/apis/ai/visionkit/VKPlaneAnchor.md index 70fcb21498e1..6497ae011a5d 100644 --- a/docs/apis/ai/visionkit/VKPlaneAnchor.md +++ b/docs/apis/ai/visionkit/VKPlaneAnchor.md @@ -15,7 +15,7 @@ sidebar_label: VKPlaneAnchor | --- | --- | --- | | id | `number` | 唯一标识 | | type | `0` | 类型 | -| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | +| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | | size | `ISize` | 尺寸 | | alignment | `number` | 方向 | diff --git a/docs/apis/ai/visionkit/VKSession.md b/docs/apis/ai/visionkit/VKSession.md index e06e8549f380..c2d883f9e762 100644 --- a/docs/apis/ai/visionkit/VKSession.md +++ b/docs/apis/ai/visionkit/VKSession.md @@ -618,7 +618,7 @@ hitTest 检测结果 | 参数 | 类型 | 说明 | | --- | --- | --- | -| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | +| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | ### IStartStatus diff --git a/docs/apis/base/system/getSystemInfo.md b/docs/apis/base/system/getSystemInfo.md index db76951c65ac..c980de150898 100644 --- a/docs/apis/base/system/getSystemInfo.md +++ b/docs/apis/base/system/getSystemInfo.md @@ -71,6 +71,7 @@ sidebar_label: getSystemInfo | enableDebug | `boolean` | 否 | 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 | | deviceOrientation | `keyof DeviceOrientation` | 否 | 设备方向 | | environment | `string` | 否 | 小程序当前运行环境 | +| screen | `{ width: number; height: number; }` | 否 | 仅支付宝小程序生效
screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。
https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253
单位: px | ### Theme diff --git a/docs/apis/base/system/getSystemInfoAsync.md b/docs/apis/base/system/getSystemInfoAsync.md index b827c857616d..8fd26fecbd64 100644 --- a/docs/apis/base/system/getSystemInfoAsync.md +++ b/docs/apis/base/system/getSystemInfoAsync.md @@ -71,6 +71,7 @@ sidebar_label: getSystemInfoAsync | enableDebug | `boolean` | 否 | 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 | | deviceOrientation | `keyof DeviceOrientation` | 否 | 设备方向 | | environment | `string` | 否 | 小程序当前运行环境 | +| screen | `{ width: number; height: number; }` | 否 | 仅支付宝小程序生效
screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。
https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253
单位: px | ### Theme diff --git a/docs/apis/base/system/getSystemInfoSync.md b/docs/apis/base/system/getSystemInfoSync.md index 7a400d7bddbc..893e5d13c27c 100644 --- a/docs/apis/base/system/getSystemInfoSync.md +++ b/docs/apis/base/system/getSystemInfoSync.md @@ -59,6 +59,7 @@ sidebar_label: getSystemInfoSync | enableDebug | `boolean` | 否 | 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 | | deviceOrientation | `keyof DeviceOrientation` | 否 | 设备方向 | | environment | `string` | 否 | 小程序当前运行环境 | +| screen | `{ width: number; height: number; }` | 否 | 仅支付宝小程序生效
screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。
https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253
单位: px | ### Theme diff --git a/docs/apis/canvas/ImageData.md b/docs/apis/canvas/ImageData.md index aa0c7ed37e33..0cfb49f1dff7 100644 --- a/docs/apis/canvas/ImageData.md +++ b/docs/apis/canvas/ImageData.md @@ -15,7 +15,7 @@ ImageData 对象 | --- | --- | --- | | width | `number` | 使用像素描述 ImageData 的实际宽度 | | height | `number` | 使用像素描述 ImageData 的实际高度 | -| data | `Uint8ClampedArray` | 一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示 | +| data | `Uint8ClampedArray` | 一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示 | ## API 支持度 diff --git a/docs/apis/canvas/canvasGetImageData.md b/docs/apis/canvas/canvasGetImageData.md index 885c643f5bd1..a793c9894dd3 100644 --- a/docs/apis/canvas/canvasGetImageData.md +++ b/docs/apis/canvas/canvasGetImageData.md @@ -39,7 +39,7 @@ sidebar_label: canvasGetImageData | 参数 | 类型 | 说明 | | --- | --- | --- | -| data | `Uint8ClampedArray` | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | +| data | `Uint8ClampedArray` | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | | height | `number` | 图像数据矩形的高度 | | width | `number` | 图像数据矩形的宽度 | | errMsg | `string` | 调用结果 | diff --git a/docs/apis/canvas/canvasPutImageData.md b/docs/apis/canvas/canvasPutImageData.md index b01b65ee23ab..1e77805ffad7 100644 --- a/docs/apis/canvas/canvasPutImageData.md +++ b/docs/apis/canvas/canvasPutImageData.md @@ -27,7 +27,7 @@ sidebar_label: canvasPutImageData | 参数 | 类型 | 必填 | 说明 | | --- | --- | :---: | --- | | canvasId | `string` | 是 | 画布标识,传入 [canvas](/docs/components/canvas) 组件的 canvas-id 属性。 | -| data | `Uint8ClampedArray` | 是 | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | +| data | `Uint8ClampedArray` | 是 | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | | height | `number` | 是 | 源图像数据矩形区域的高度 | | width | `number` | 是 | 源图像数据矩形区域的宽度 | | x | `number` | 是 | 源图像数据在目标画布中的位置偏移量(x 轴方向的偏移量) | diff --git a/docs/apis/canvas/createCanvasContext.md b/docs/apis/canvas/createCanvasContext.md index 5b7b30b00fca..c6e3e61eab54 100644 --- a/docs/apis/canvas/createCanvasContext.md +++ b/docs/apis/canvas/createCanvasContext.md @@ -7,7 +7,7 @@ sidebar_label: createCanvasContext **Tip**: 需要指定 canvasId,该绘图上下文只作用于对应的 ``;另外,Web 端需要在 `useReady` 回调中执行它,否则会因为底层 canvas 渲染出来之前而去获取 CanvasContext,导致其底层的 context 为 `undefined`,从而不能正常绘图。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createCanvasContext.html) diff --git a/docs/apis/cloud/cloud.md b/docs/apis/cloud/cloud.md index e68999838538..1b7760afab3f 100644 --- a/docs/apis/cloud/cloud.md +++ b/docs/apis/cloud/cloud.md @@ -536,6 +536,7 @@ const r = await c1.callContainer({ | 参数 | 类型 | 必填 | 说明 | | --- | --- | :---: | --- | +| config | `{ env: string; }` | 否 | | | path | `string` | 是 | 服务路径 | | method | string or number or symbol | 否 | HTTP请求方法,默认 GET | | data | `P` | 否 | 请求数据 | diff --git a/docs/apis/device/keyboard/hideKeyboard.md b/docs/apis/device/keyboard/hideKeyboard.md index a5c1f8293766..aaf1df8a3c92 100644 --- a/docs/apis/device/keyboard/hideKeyboard.md +++ b/docs/apis/device/keyboard/hideKeyboard.md @@ -5,7 +5,7 @@ sidebar_label: hideKeyboard 在input、textarea等focus拉起键盘之后,手动调用此接口收起键盘 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.hideKeyboard.html) diff --git a/docs/apis/device/memory/offMemoryWarning.md b/docs/apis/device/memory/offMemoryWarning.md index dd306b72d141..34831c810229 100644 --- a/docs/apis/device/memory/offMemoryWarning.md +++ b/docs/apis/device/memory/offMemoryWarning.md @@ -5,7 +5,7 @@ sidebar_label: offMemoryWarning 取消监听内存不足告警事件。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/memory/wx.offMemoryWarning.html) diff --git a/docs/apis/device/memory/onMemoryWarning.md b/docs/apis/device/memory/onMemoryWarning.md index 4b26c24f3857..c02486b61bf2 100644 --- a/docs/apis/device/memory/onMemoryWarning.md +++ b/docs/apis/device/memory/onMemoryWarning.md @@ -7,7 +7,7 @@ sidebar_label: onMemoryWarning 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/performance/wx.onMemoryWarning.html) diff --git a/docs/apis/files/getFileSystemManager.md b/docs/apis/files/getFileSystemManager.md index bf468ca2aee2..8c38110a6ac6 100644 --- a/docs/apis/files/getFileSystemManager.md +++ b/docs/apis/files/getFileSystemManager.md @@ -5,7 +5,7 @@ sidebar_label: getFileSystemManager 获取全局唯一的文件管理器 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html) diff --git a/docs/apis/location/getLocation.md b/docs/apis/location/getLocation.md index e828bf6854e3..5665bbcc53d9 100644 --- a/docs/apis/location/getLocation.md +++ b/docs/apis/location/getLocation.md @@ -9,7 +9,7 @@ sidebar_label: getLocation - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。 - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html) diff --git a/docs/apis/media/audio/AudioBuffer.md b/docs/apis/media/audio/AudioBuffer.md index dbcc20325370..334e778f1c65 100644 --- a/docs/apis/media/audio/AudioBuffer.md +++ b/docs/apis/media/audio/AudioBuffer.md @@ -27,7 +27,7 @@ AudioBuffer 接口表示存在内存里的一段短小的音频资源,利用 [ > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.getChannelData.html) ```tsx -(channel: number) => Float32Array +(channel: number) => Float32Array ``` | 参数 | 类型 | @@ -86,12 +86,12 @@ for (let channel = 0; channel < channels; channel++) { > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.copyToChannel.html) ```tsx -(source: Float32Array, channelNumber: number, startInChannel: number) => void +(source: Float32Array, channelNumber: number, startInChannel: number) => void ``` | 参数 | 类型 | 说明 | | --- | --- | --- | -| source | `Float32Array` | 需要复制的源数组 | +| source | `Float32Array` | 需要复制的源数组 | | channelNumber | `number` | 需要复制到的目的通道号 | | startInChannel | `number` | 复制偏移数据量 | diff --git a/docs/apis/media/audio/WebAudioContext.md b/docs/apis/media/audio/WebAudioContext.md index c81ae17f9365..18196d8c6636 100644 --- a/docs/apis/media/audio/WebAudioContext.md +++ b/docs/apis/media/audio/WebAudioContext.md @@ -187,13 +187,13 @@ const waveNode = audioContext.createPeriodicWave(real, imag, {disableNormalizati > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createPeriodicWave.html) ```tsx -(real: Float32Array, imag: Float32Array, constraints: Constraints) => PeriodicWave +(real: Float32Array, imag: Float32Array, constraints: Constraints) => PeriodicWave ``` | 参数 | 类型 | 说明 | | --- | --- | --- | -| real | `Float32Array` | 一组余弦项(传统上是A项) | -| imag | `Float32Array` | 一组余弦项(传统上是A项) | +| real | `Float32Array` | 一组余弦项(传统上是A项) | +| imag | `Float32Array` | 一组余弦项(传统上是A项) | | constraints | `Constraints` | 一个字典对象,它指定是否应该禁用规范化(默认启用规范化) | ### createBiquadFilter @@ -373,9 +373,15 @@ const myArrayBuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampl > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html) ```tsx -() => AudioBuffer +(audioData: ArrayBuffer, successCallback: (buffer: AudioBuffer) => void, errorCallback: (error: any) => void) => Promise ``` +| 参数 | 类型 | +| --- | --- | +| audioData | `ArrayBuffer` | +| successCallback | `(buffer: AudioBuffer) => void` | +| errorCallback | `(error: any) => void` | + #### 示例代码 ```tsx diff --git a/docs/apis/media/video/chooseMedia.md b/docs/apis/media/video/chooseMedia.md index 4e57236ee04b..397bfafab5bd 100644 --- a/docs/apis/media/video/chooseMedia.md +++ b/docs/apis/media/video/chooseMedia.md @@ -5,7 +5,7 @@ sidebar_label: chooseMedia 拍摄或从手机相册中选择图片或视频。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html) diff --git a/docs/apis/media/video/createVideoContext.md b/docs/apis/media/video/createVideoContext.md index 4f82d2e7ad1f..bc1eec7918d0 100644 --- a/docs/apis/media/video/createVideoContext.md +++ b/docs/apis/media/video/createVideoContext.md @@ -5,7 +5,7 @@ sidebar_label: createVideoContext 创建 video 上下文 VideoContext 对象。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.createVideoContext.html) diff --git a/docs/apis/network/download/downloadFile.md b/docs/apis/network/download/downloadFile.md index 954e614ac36d..287a3024393f 100644 --- a/docs/apis/network/download/downloadFile.md +++ b/docs/apis/network/download/downloadFile.md @@ -7,7 +7,7 @@ sidebar_label: downloadFile 注意:请在服务端响应的 header 中指定合理的 `Content-Type` 字段,以保证客户端正确处理文件类型。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/wx.downloadFile.html) diff --git a/docs/apis/network/request/request.md b/docs/apis/network/request/request.md index 12c6d5a272d4..680afa0bf100 100644 --- a/docs/apis/network/request/request.md +++ b/docs/apis/network/request/request.md @@ -38,6 +38,7 @@ sidebar_label: request | method | `keyof Method` | `"GET"` | 否 | HTTP 请求方法 | | dataType | `string` | | 否 | 返回的数据格式 | | responseType | `keyof ResponseType` | | 否 | 响应的数据类型 | +| useHighPerformanceMode | `boolean` | `true` | 否 | 使用高性能模式。从基础库 v3.5.0 开始在 Android 端默认开启,其他端暂不生效。该模式下有更优的网络性能表现。 | | enableHttp2 | `boolean` | `false` | 否 | 开启 http2
API 支持度: weapp | | enableQuic | `boolean` | `false` | 否 | 开启 quic
API 支持度: weapp | | enableCache | `boolean` | `false` | 否 | 开启 cache
API 支持度: weapp, tt | @@ -49,7 +50,7 @@ sidebar_label: request | referrerStrategy | `keyof ReferrerStrategy` | `"querystring"` | 否 | referer 策略,用于控制当前请求 header 对象中 referer 字段格式。该参数默认值可通过 app.json 中的配置进行修改。
API 支持度: alipay 支付宝: 10.3.50+ APPX: 2.8.7 开发者工具: 3.5.1
[参考地址](https://opendocs.alipay.com/mini/api/owycmh#referrerStrategy%20%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E) | | success | `(result: SuccessCallbackResult) => void` | | 否 | 接口调用成功的回调函数 | | fail | `(res: TaroGeneral.CallbackResult) => void` | | 否 | 接口调用失败的回调函数 | -| complete | `(res: Partial & TaroGeneral.CallbackResult) => void` | | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | +| complete | `(res: any) => void` | | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | | jsonp | string or boolean | `false` | 否 | 设置是否使用 jsonp 方式获取数据
API 支持度: h5 | | jsonpCache | `RequestCache` | | 否 | 设置 jsonp 请求 url 是否需要被缓存
API 支持度: h5 | | mode | `keyof CorsMode` | `"same-origin"` | 否 | 设置是否允许跨域请求
API 支持度: h5 | diff --git a/docs/apis/network/upload/uploadFile.md b/docs/apis/network/upload/uploadFile.md index 265675879225..6fc2e1486213 100644 --- a/docs/apis/network/upload/uploadFile.md +++ b/docs/apis/network/upload/uploadFile.md @@ -5,7 +5,7 @@ sidebar_label: uploadFile 将本地资源上传到服务器。客户端发起一个 HTTPS POST 请求,其中 `content-type` 为 `multipart/form-data`。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/wx.uploadFile.html) diff --git a/docs/apis/open-api/subscribe-message/requestSubscribeMessage.md b/docs/apis/open-api/subscribe-message/requestSubscribeMessage.md index 20c2f41e9dcb..0db83b59d24c 100644 --- a/docs/apis/open-api/subscribe-message/requestSubscribeMessage.md +++ b/docs/apis/open-api/subscribe-message/requestSubscribeMessage.md @@ -23,7 +23,7 @@ sidebar_label: requestSubscribeMessage | --- | --- | | option | `Option` | -### Option +### BaseOption | 参数 | 类型 | 必填 | 说明 | | --- | --- | :---: | --- | @@ -34,6 +34,10 @@ sidebar_label: requestSubscribeMessage | fail | `(result: FailCallbackResult) => void` | 否 | 接口调用失败的回调函数 | | success | `(result: SuccessCallbackResult) => void` | 否 | 接口调用成功的回调函数 | +### AtLeastOne + +### Option + ### FailCallbackResult | 参数 | 类型 | 说明 | diff --git a/docs/apis/route/switchTab.md b/docs/apis/route/switchTab.md index ef0a84ac3bc8..50d43c1f9af7 100644 --- a/docs/apis/route/switchTab.md +++ b/docs/apis/route/switchTab.md @@ -5,7 +5,7 @@ sidebar_label: switchTab 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.switchTab.html) diff --git a/docs/apis/share/updateShareMenu.md b/docs/apis/share/updateShareMenu.md index 3f5e4c9bdce9..385a70805d11 100644 --- a/docs/apis/share/updateShareMenu.md +++ b/docs/apis/share/updateShareMenu.md @@ -23,15 +23,20 @@ sidebar_label: updateShareMenu ### Option -| 参数 | 类型 | 必填 | 说明 | -| --- | --- | :---: | --- | -| activityId | `string` | 否 | 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取 | -| complete | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | -| fail | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用失败的回调函数 | -| isUpdatableMessage | `boolean` | 否 | 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/updatable-message.html) | -| success | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用成功的回调函数 | -| templateInfo | `UpdatableMessageFrontEndTemplateInfo` | 否 | 动态消息的模板信息 | -| withShareTicket | `boolean` | 否 | 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) | +| 参数 | 类型 | 默认值 | 必填 | 说明 | +| --- | --- | :---: | :---: | --- | +| withShareTicket | `boolean` | `false` | 否 | 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) | +| isUpdatableMessage | `boolean` | `false` | 否 | 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/updatable-message.html) | +| activityId | `string` | | 否 | 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/miniprogram/dev/api/share/errorupdatableMessage.createActivityId)) 接口获取 | +| toDoActivityId | `string` | | 否 | 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/miniprogram/dev/api/share/errorupdatableMessage.createActivityId) 接口获取。详见[群待办消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html | +| templateInfo | `UpdatableMessageFrontEndTemplateInfo` | | 否 | 动态消息的模板信息 | +| isPrivateMessage | `boolean` | | 否 | 是否是私密消息。详见 [小程序私密消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/private-message.html) | +| participant | `string[]` | `[]` | 否 | 参与用户此聊天室下的 group_openid 列表 | +| useForChatTool | `boolean` | `false` | 否 | 聊天工具模式特殊动态消息 | +| chooseType | `number` | `1` | 否 | 指定成员的方式 | +| success | `(res: TaroGeneral.CallbackResult) => void` | | 否 | 接口调用成功的回调函数 | +| fail | `(res: TaroGeneral.CallbackResult) => void` | | 否 | 接口调用失败的回调函数 | +| complete | `(res: TaroGeneral.CallbackResult) => void` | | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | ### UpdatableMessageFrontEndTemplateInfo @@ -40,6 +45,7 @@ sidebar_label: updateShareMenu | 参数 | 类型 | 说明 | | --- | --- | --- | | parameterList | `UpdatableMessageFrontEndParameter[]` | 参数列表 | +| templateId | `string` | 模板ID | ### UpdatableMessageFrontEndParameter diff --git a/docs/apis/storage/clearStorage.md b/docs/apis/storage/clearStorage.md index fdc20d668ceb..d29b2ed4a6ac 100644 --- a/docs/apis/storage/clearStorage.md +++ b/docs/apis/storage/clearStorage.md @@ -5,7 +5,7 @@ sidebar_label: clearStorage 清理本地数据缓存 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorage.html) diff --git a/docs/apis/storage/createBufferURL.md b/docs/apis/storage/createBufferURL.md index ad5cf28ede07..1e759bc0c58c 100644 --- a/docs/apis/storage/createBufferURL.md +++ b/docs/apis/storage/createBufferURL.md @@ -12,7 +12,7 @@ sidebar_label: createBufferURL ## 类型 ```tsx -(buffer: TypedArray | ArrayBuffer) => void +(buffer: TypedArray | ArrayBuffer) => string ``` ## 参数 diff --git a/docs/apis/taro.extend/getCurrentInstance.md b/docs/apis/taro.extend/getCurrentInstance.md index 9d7d66b9daa5..c5339b532879 100644 --- a/docs/apis/taro.extend/getCurrentInstance.md +++ b/docs/apis/taro.extend/getCurrentInstance.md @@ -26,4 +26,4 @@ sidebar_label: getCurrentInstance | onHide | `string` | 是 | | | onShow | `string` | 是 | | | preloadData | `Record` | 否 | | -| rnNavigationRef | `React.RefObject` | 否 | RN 私有对象navigationRef,用于使用底层接口控制路由 | +| rnNavigationRef | `React.RefObject` | 否 | RN 私有对象 navigationRef,用于使用底层接口控制路由 | diff --git a/docs/apis/taro.extend/interceptorify.md b/docs/apis/taro.extend/interceptorify.md index 717d230dbf31..d99ca58e35cc 100644 --- a/docs/apis/taro.extend/interceptorify.md +++ b/docs/apis/taro.extend/interceptorify.md @@ -1,21 +1,25 @@ --- -title: Taro.interceptorify(promiseifyApi) +title: Taro.interceptorify(api) sidebar_label: interceptorify --- -包裹 promiseify api 的洋葱圈模型 +包裹 promisify api 的洋葱圈模型 支持情况: ## 类型 ```tsx -(promiseifyApi: promiseifyApi) => Interceptorify +(api: promisifyApi) => Interceptorify ``` ## 参数 -### promiseifyApi +| 参数 | 类型 | +| --- | --- | +| api | `T` | + +### promisifyApi ```tsx (requestParams: T) => Promise @@ -30,7 +34,7 @@ sidebar_label: interceptorify | 参数 | 类型 | | --- | --- | | requestParams | `T` | -| proceed | `promiseifyApi` | +| proceed | `promisifyApi` | ### InterceptorifyInterceptor diff --git a/docs/apis/taro.hooks/useKeyboardHeight.md b/docs/apis/taro.hooks/useKeyboardHeight.md new file mode 100644 index 000000000000..f42e9d5358d9 --- /dev/null +++ b/docs/apis/taro.hooks/useKeyboardHeight.md @@ -0,0 +1,20 @@ +--- +title: Taro.useKeyboardHeight(callback) +sidebar_label: useKeyboardHeight +--- + +键盘高度变化时的回调。 + +支持情况: + +## 类型 + +```tsx +(callback: (payload: { height: number; }) => void) => void +``` + +## 参数 + +| 参数 | 类型 | +| --- | --- | +| callback | `(payload: { height: number; }) => void` | diff --git a/docs/apis/taro.hooks/useLoad.md b/docs/apis/taro.hooks/useLoad.md index 1a1cb2b7d70b..baf5cae68834 100644 --- a/docs/apis/taro.hooks/useLoad.md +++ b/docs/apis/taro.hooks/useLoad.md @@ -5,7 +5,7 @@ sidebar_label: useLoad 页面加载完成时的回调。 -支持情况: +支持情况: ## 类型 diff --git a/docs/apis/taro.hooks/useReady.md b/docs/apis/taro.hooks/useReady.md index cdcb37d660ac..91fd1dad5691 100644 --- a/docs/apis/taro.hooks/useReady.md +++ b/docs/apis/taro.hooks/useReady.md @@ -6,7 +6,7 @@ sidebar_label: useReady 页面初次渲染完成的回调。 此时页面已经准备妥当,可以和视图层进行交互。 -支持情况: +支持情况: ## 类型 diff --git a/docs/apis/taro.hooks/useUnload.md b/docs/apis/taro.hooks/useUnload.md index b3c405a2274e..866fb69fbef2 100644 --- a/docs/apis/taro.hooks/useUnload.md +++ b/docs/apis/taro.hooks/useUnload.md @@ -5,7 +5,7 @@ sidebar_label: useUnload 页面卸载时的回调。 -支持情况: +支持情况: ## 类型 diff --git a/docs/apis/ui/tab-bar/hideTabBar.md b/docs/apis/ui/tab-bar/hideTabBar.md index 082adce21453..c4458ca65f1f 100644 --- a/docs/apis/ui/tab-bar/hideTabBar.md +++ b/docs/apis/ui/tab-bar/hideTabBar.md @@ -5,7 +5,7 @@ sidebar_label: hideTabBar 隐藏 tabBar -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBar.html) diff --git a/docs/apis/ui/tab-bar/hideTabBarRedDot.md b/docs/apis/ui/tab-bar/hideTabBarRedDot.md index 6808c96d0b48..2c3da47bc628 100644 --- a/docs/apis/ui/tab-bar/hideTabBarRedDot.md +++ b/docs/apis/ui/tab-bar/hideTabBarRedDot.md @@ -5,7 +5,7 @@ sidebar_label: hideTabBarRedDot 隐藏 tabBar 某一项的右上角的红点 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBarRedDot.html) diff --git a/docs/apis/ui/tab-bar/removeTabBarBadge.md b/docs/apis/ui/tab-bar/removeTabBarBadge.md index c53a609bedbe..d2b2a511a5ec 100644 --- a/docs/apis/ui/tab-bar/removeTabBarBadge.md +++ b/docs/apis/ui/tab-bar/removeTabBarBadge.md @@ -5,7 +5,7 @@ sidebar_label: removeTabBarBadge 移除 tabBar 某一项右上角的文本 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.removeTabBarBadge.html) diff --git a/docs/apis/ui/tab-bar/setTabBarBadge.md b/docs/apis/ui/tab-bar/setTabBarBadge.md index 7657d46f1a20..42e6a987897d 100644 --- a/docs/apis/ui/tab-bar/setTabBarBadge.md +++ b/docs/apis/ui/tab-bar/setTabBarBadge.md @@ -5,7 +5,7 @@ sidebar_label: setTabBarBadge 为 tabBar 某一项的右上角添加文本 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarBadge.html) diff --git a/docs/apis/ui/tab-bar/setTabBarItem.md b/docs/apis/ui/tab-bar/setTabBarItem.md index f6468184a7d2..220a6fe129f1 100644 --- a/docs/apis/ui/tab-bar/setTabBarItem.md +++ b/docs/apis/ui/tab-bar/setTabBarItem.md @@ -5,7 +5,7 @@ sidebar_label: setTabBarItem 动态设置 tabBar 某一项的内容,`2.7.0` 起图片支持临时文件和网络文件。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarItem.html) diff --git a/docs/apis/ui/tab-bar/showTabBar.md b/docs/apis/ui/tab-bar/showTabBar.md index 471a9d0ab7a6..924986a4e527 100644 --- a/docs/apis/ui/tab-bar/showTabBar.md +++ b/docs/apis/ui/tab-bar/showTabBar.md @@ -5,7 +5,7 @@ sidebar_label: showTabBar 显示 tabBar -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBar.html) diff --git a/docs/apis/ui/tab-bar/showTabBarRedDot.md b/docs/apis/ui/tab-bar/showTabBarRedDot.md index c557074d71f3..508dcd472fbb 100644 --- a/docs/apis/ui/tab-bar/showTabBarRedDot.md +++ b/docs/apis/ui/tab-bar/showTabBarRedDot.md @@ -5,7 +5,7 @@ sidebar_label: showTabBarRedDot 显示 tabBar 某一项的右上角的红点 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html) diff --git a/docs/components/forms/textarea.md b/docs/components/forms/textarea.md index f90baaa676f3..940fc447acce 100755 --- a/docs/components/forms/textarea.md +++ b/docs/components/forms/textarea.md @@ -90,7 +90,7 @@ export default class PageView extends Component { | showCount | `boolean` | `true` | 否 | 是否渲染字数统计功能(是否删除默认计数器/是否显示字数统计)。 | | controlled | `boolean` | `false` | 否 | 是否为受控组件。为 true 时,value 内容会完全受 setData 控制。 | | ariaLabel | `string` | | 否 | 无障碍访问,(属性)元素的额外描述 | -| adjustKeyboardTo | `boolean` | `false` | 否 | 键盘对齐位置 | +| adjustKeyboardTo | "cursor" or "bottom" | `'cursor'` | 否 | 键盘对齐位置 | | onFocus | `CommonEventFunction` | | 否 | 输入框聚焦时触发 | | onBlur | `CommonEventFunction` | | 否 | 输入框失去焦点时触发 | | onLineChange | `CommonEventFunction` | | 否 | 输入框行数变化时调用 | diff --git a/docs/components/list-item.md b/docs/components/list-item.md new file mode 100644 index 000000000000..3baaf4676730 --- /dev/null +++ b/docs/components/list-item.md @@ -0,0 +1,10 @@ +--- +title: ListItem +sidebar_label: ListItem +--- + +## 类型 + +```tsx +ComponentType +``` diff --git a/docs/components/list.md b/docs/components/list.md new file mode 100644 index 000000000000..266e8dd892ae --- /dev/null +++ b/docs/components/list.md @@ -0,0 +1,24 @@ +--- +title: List +sidebar_label: List +--- + +## 类型 + +```tsx +ComponentType> +``` + +## ListProps + +| 参数 | 类型 | 默认值 | 必填 | 说明 | +| --- | --- | :---: | :---: | --- | +| upperThresholdCount | `number` | `50` | 否 | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 | +| lowerThresholdCount | `number` | `50` | 否 | 距底部/右边多远时(单位px),触发 scrolltolower 事件 | + +### API 支持度 + +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| ListProps.upperThresholdCount | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ListProps.lowerThresholdCount | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | diff --git a/docs/components/page-meta.md b/docs/components/page-meta.md index 16b48c217ff0..0a075626c978 100644 --- a/docs/components/page-meta.md +++ b/docs/components/page-meta.md @@ -11,7 +11,7 @@ Taro v3.6.19 开始支持 开发者需要在页面配置里添加:`enablePageMeta: true` ::: -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/page-meta.html) @@ -91,22 +91,22 @@ function Index () { ### API 支持度 -| API | 微信小程序 | 支付宝小程序 | H5 | React Native | Harmony | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| PageMetaProps.backgroundTextStyle | ✔️ | | | | | | -| PageMetaProps.backgroundColor | ✔️ | ✔️ | | | ✔️ | | -| PageMetaProps.backgroundColorTop | ✔️ | ✔️ | | | ✔️ | | -| PageMetaProps.backgroundColorBottom | ✔️ | ✔️ | | | ✔️ | | -| PageMetaProps.scrollTop | ✔️ | ✔️ | | | ✔️ | | -| PageMetaProps.scrollDuration | ✔️ | ✔️ | | | ✔️ | | -| PageMetaProps.pageStyle | ✔️ | ✔️ | | | | | -| PageMetaProps.rootFontSize | ✔️ | ✔️ | | | | | -| PageMetaProps.rootBackgroundColor | ✔️ | ✔️ | | | ✔️ | | -| PageMetaProps.pageFontSize | ✔️ | ✔️ | | | | | -| PageMetaProps.pageOrientation | ✔️ | | | | | | -| PageMetaProps.onResize | ✔️ | | | | | | -| PageMetaProps.onScroll | ✔️ | ✔️ | | | | | -| PageMetaProps.onScrollDone | ✔️ | | | | | | +| API | 微信小程序 | 支付宝小程序 | H5 | React Native | Harmony | +| :---: | :---: | :---: | :---: | :---: | :---: | +| PageMetaProps.backgroundTextStyle | ✔️ | | | | | +| PageMetaProps.backgroundColor | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.backgroundColorTop | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.backgroundColorBottom | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.scrollTop | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.scrollDuration | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.pageStyle | ✔️ | ✔️ | | | | +| PageMetaProps.rootFontSize | ✔️ | ✔️ | | | | +| PageMetaProps.rootBackgroundColor | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.pageFontSize | ✔️ | ✔️ | | | | +| PageMetaProps.pageOrientation | ✔️ | | | | | +| PageMetaProps.onResize | ✔️ | | | | | +| PageMetaProps.onScroll | ✔️ | ✔️ | | | | +| PageMetaProps.onScrollDone | ✔️ | | | | | ### onResizeEventDetail diff --git a/docs/components/viewContainer/cover-image.md b/docs/components/viewContainer/cover-image.md index 1afc66e1ec37..34129de745f4 100644 --- a/docs/components/viewContainer/cover-image.md +++ b/docs/components/viewContainer/cover-image.md @@ -5,7 +5,7 @@ sidebar_label: CoverImage 覆盖在原生组件之上的图片视图。可覆盖的原生组件同cover-view,支持嵌套在cover-view里。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/cover-image.html) @@ -106,16 +106,16 @@ class App extends Components { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| CoverImageProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | | -| CoverImageProps.referrerPolicy | ✔️ | | | | | | | | | | -| CoverImageProps.fixedTop | | ✔️ | | | | | | | | | -| CoverImageProps.fixedRight | | ✔️ | | | | | | | | | -| CoverImageProps.fixedBottom | | ✔️ | | | | | | | | | -| CoverImageProps.fixedLeft | | ✔️ | | | | | | | | | -| CoverImageProps.ariaRole | | | | ✔️ | | | | | | | -| CoverImageProps.ariaLabel | | | | ✔️ | | | | | | | -| CoverImageProps.onLoad | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | ✔️ | | -| CoverImageProps.onError | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | ✔️ | | -| CoverImageProps.onTap | | | ✔️ | | | | | | | | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| CoverImageProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| CoverImageProps.referrerPolicy | ✔️ | | | | | | | | | +| CoverImageProps.fixedTop | | ✔️ | | | | | | | | +| CoverImageProps.fixedRight | | ✔️ | | | | | | | | +| CoverImageProps.fixedBottom | | ✔️ | | | | | | | | +| CoverImageProps.fixedLeft | | ✔️ | | | | | | | | +| CoverImageProps.ariaRole | | | | ✔️ | | | | | | +| CoverImageProps.ariaLabel | | | | ✔️ | | | | | | +| CoverImageProps.onLoad | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | ✔️ | +| CoverImageProps.onError | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | ✔️ | +| CoverImageProps.onTap | | | ✔️ | | | | | | | diff --git a/docs/components/viewContainer/cover-view.md b/docs/components/viewContainer/cover-view.md index 4a4fc473b09b..a27d18d56bb5 100755 --- a/docs/components/viewContainer/cover-view.md +++ b/docs/components/viewContainer/cover-view.md @@ -5,7 +5,7 @@ sidebar_label: CoverView 覆盖在原生组件之上的文本视图。可覆盖的原生组件包括 map、video、canvas、camera、live-player、live-pusher 只支持嵌套 cover-view、cover-image,可在 cover-view 中使用 button。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html) @@ -119,34 +119,38 @@ class App extends Components { | onTouchMove | `CommonEventFunction` | | 否 | 触摸后移动。 | | onTouchEnd | `CommonEventFunction` | | 否 | 触摸动作结束。 | | onTouchCancel | `CommonEventFunction` | | 否 | 触摸动作被打断,如来电提醒、弹窗。 | +| markerId | `number` | | 否 | 标记点 ID
description: 用于地图组件的标记点识别
example: | +| slot | `string` | | 否 | 插槽名称
description: 用于组件间的内容分发
example: | ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| CoverViewProps.scrollTop | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | -| CoverViewProps.fixedTop | | ✔️ | | | | | | | | -| CoverViewProps.fixedRight | | ✔️ | | | | | | | | -| CoverViewProps.fixedBottom | | ✔️ | | | | | | | | -| CoverViewProps.fixedLeft | | ✔️ | | | | | | | | -| CoverViewProps.ariaRole | | | | ✔️ | | | | | | -| CoverViewProps.ariaLabel | | | | ✔️ | | | | | | -| CoverViewProps.scrollX | | | ✔️ | | | | | | | -| CoverViewProps.scrollY | | | ✔️ | | | | | | | -| CoverViewProps.upperThreshold | | | ✔️ | | | | | | | -| CoverViewProps.lowerThreshold | | | ✔️ | | | | | | | -| CoverViewProps.scrollLeft | | | ✔️ | | | | | | | -| CoverViewProps.scrollIntoView | | | ✔️ | | | | | | | -| CoverViewProps.scrollWithAnimation | | | ✔️ | | | | | | | -| CoverViewProps.scrollAnimationDuration | | | ✔️ | | | | | | | -| CoverViewProps.enableBackToTop | | | ✔️ | | | | | | | -| CoverViewProps.trapScroll | | | ✔️ | | | | | | | -| CoverViewProps.disableLowerScroll | | | ✔️ | | | | | | | -| CoverViewProps.disableUpperScroll | | | ✔️ | | | | | | | -| CoverViewProps.onScrollToUpper | | | ✔️ | | | | | | | -| CoverViewProps.onScrollToLower | | | ✔️ | | | | | | | -| CoverViewProps.onScroll | | | ✔️ | | | | | | | -| CoverViewProps.onTouchStart | | | ✔️ | | | | | | | -| CoverViewProps.onTouchMove | | | ✔️ | | | | | | | -| CoverViewProps.onTouchEnd | | | ✔️ | | | | | | | -| CoverViewProps.onTouchCancel | | | ✔️ | | | | | | | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| CoverViewProps.scrollTop | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | +| CoverViewProps.fixedTop | | ✔️ | | | | | | | +| CoverViewProps.fixedRight | | ✔️ | | | | | | | +| CoverViewProps.fixedBottom | | ✔️ | | | | | | | +| CoverViewProps.fixedLeft | | ✔️ | | | | | | | +| CoverViewProps.ariaRole | | | | ✔️ | | | | | +| CoverViewProps.ariaLabel | | | | ✔️ | | | | | +| CoverViewProps.scrollX | | | ✔️ | | | | | | +| CoverViewProps.scrollY | | | ✔️ | | | | | | +| CoverViewProps.upperThreshold | | | ✔️ | | | | | | +| CoverViewProps.lowerThreshold | | | ✔️ | | | | | | +| CoverViewProps.scrollLeft | | | ✔️ | | | | | | +| CoverViewProps.scrollIntoView | | | ✔️ | | | | | | +| CoverViewProps.scrollWithAnimation | | | ✔️ | | | | | | +| CoverViewProps.scrollAnimationDuration | | | ✔️ | | | | | | +| CoverViewProps.enableBackToTop | | | ✔️ | | | | | | +| CoverViewProps.trapScroll | | | ✔️ | | | | | | +| CoverViewProps.disableLowerScroll | | | ✔️ | | | | | | +| CoverViewProps.disableUpperScroll | | | ✔️ | | | | | | +| CoverViewProps.onScrollToUpper | | | ✔️ | | | | | | +| CoverViewProps.onScrollToLower | | | ✔️ | | | | | | +| CoverViewProps.onScroll | | | ✔️ | | | | | | +| CoverViewProps.onTouchStart | | | ✔️ | | | | | | +| CoverViewProps.onTouchMove | | | ✔️ | | | | | | +| CoverViewProps.onTouchEnd | | | ✔️ | | | | | | +| CoverViewProps.onTouchCancel | | | ✔️ | | | | | | +| CoverViewProps.markerId | ✔️ | | | | | | | | +| CoverViewProps.slot | ✔️ | | | | | | | | diff --git a/docs/components/viewContainer/custom-wrapper.md b/docs/components/viewContainer/custom-wrapper.md index 1318ca7eefdb..8577b840c0c7 100644 --- a/docs/components/viewContainer/custom-wrapper.md +++ b/docs/components/viewContainer/custom-wrapper.md @@ -6,7 +6,7 @@ sidebar_label: CustomWrapper custom-wrapper 自定义组件包裹器 当数据更新层级较深时,可用此组件将需要更新的区域包裹起来,这样更新层级将大大减少 -支持情况: +支持情况: ## 类型 diff --git a/docs/components/viewContainer/match-media.md b/docs/components/viewContainer/match-media.md index 88b6457ec4ae..c0d01532ee6d 100644 --- a/docs/components/viewContainer/match-media.md +++ b/docs/components/viewContainer/match-media.md @@ -6,7 +6,7 @@ sidebar_label: MatchMedia media query 匹配检测节点。可以指定一组 media query 规则,满足时,这个节点才会被展示。 通过这个节点可以实现“页面宽高在某个范围时才展示某个区域”这样的效果。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/match-media.html) @@ -75,12 +75,12 @@ class App extends Components { ### API 支持度 -| API | 微信小程序 | 支付宝小程序 | 京东小程序 | H5 | React Native | Harmony | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| MatchMediaProps.minWidth | ✔️ | ✔️ | ✔️ | | | | | -| MatchMediaProps.maxWidth | ✔️ | ✔️ | ✔️ | | | | | -| MatchMediaProps.width | ✔️ | ✔️ | ✔️ | | | | | -| MatchMediaProps.minHeight | ✔️ | ✔️ | ✔️ | | | | | -| MatchMediaProps.maxHeight | ✔️ | ✔️ | ✔️ | | | | | -| MatchMediaProps.height | ✔️ | ✔️ | ✔️ | | | | | -| MatchMediaProps.orientation | ✔️ | ✔️ | ✔️ | | | | | +| API | 微信小程序 | 支付宝小程序 | 京东小程序 | H5 | React Native | Harmony | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| MatchMediaProps.minWidth | ✔️ | ✔️ | ✔️ | | | | +| MatchMediaProps.maxWidth | ✔️ | ✔️ | ✔️ | | | | +| MatchMediaProps.width | ✔️ | ✔️ | ✔️ | | | | +| MatchMediaProps.minHeight | ✔️ | ✔️ | ✔️ | | | | +| MatchMediaProps.maxHeight | ✔️ | ✔️ | ✔️ | | | | +| MatchMediaProps.height | ✔️ | ✔️ | ✔️ | | | | +| MatchMediaProps.orientation | ✔️ | ✔️ | ✔️ | | | | diff --git a/docs/components/viewContainer/movable-area.md b/docs/components/viewContainer/movable-area.md index 8b46cb8429c7..5a7ca67a28e8 100644 --- a/docs/components/viewContainer/movable-area.md +++ b/docs/components/viewContainer/movable-area.md @@ -5,7 +5,7 @@ sidebar_label: MovableArea movable-view 的可移动区域 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/movable-area.html) @@ -56,6 +56,6 @@ class App extends Components { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| MovableAreaProps.scaleArea | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| MovableAreaProps.scaleArea | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | diff --git a/docs/components/viewContainer/movable-view.md b/docs/components/viewContainer/movable-view.md index 6eb52302fa1a..c9a124852499 100755 --- a/docs/components/viewContainer/movable-view.md +++ b/docs/components/viewContainer/movable-view.md @@ -5,7 +5,7 @@ sidebar_label: MovableView 可移动的视图容器,在页面中可以拖拽滑动。movable-view 必须在 movable-area 组件中,并且必须是直接子节点,否则不能移动。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/movable-view.html) @@ -82,35 +82,35 @@ class App extends Components { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | H5 | React Native | Harmony | Harmony hybrid | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| MovableViewProps.direction | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| MovableViewProps.inertia | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.outOfBounds | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.x | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| MovableViewProps.y | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| MovableViewProps.damping | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.friction | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| MovableViewProps.scale | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.scaleMin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.scaleMax | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.scaleValue | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.animation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | ✔️ | -| MovableViewProps.onChangeEnd | | | ✔️ | | | | | | | | -| MovableViewProps.onDragStart | | | | | | | ✔️ | | | | -| MovableViewProps.onDragEnd | | | | | | | ✔️ | | | | -| MovableViewProps.onScale | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.onTouchStart | | | ✔️ | | | | | | | | -| MovableViewProps.onTouchMove | | | ✔️ | | | | | | | | -| MovableViewProps.onTouchEnd | | | ✔️ | | | ✔️(此事件的触发顺序会因为当前事件机制引起组件内外注册的事件执行顺序不正常,外部注册的事件可能会优先于内部执行,如需保证执行顺序一致,需要在回调函数中包裹 setTimeout 临时处理) | | | ✔️ | | -| MovableViewProps.onTouchCancel | | | ✔️ | | | | | | | | -| MovableViewProps.onHTouchMove | ✔️ | ✔️ | | ✔️ | | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.onVTouchMove | ✔️ | ✔️ | | ✔️ | | ✔️ | | | ✔️ | ✔️ | -| MovableViewProps.catchTouchStart | | | ✔️ | | | | | | | | -| MovableViewProps.catchTouchMove | | | ✔️ | | | | | | | | -| MovableViewProps.catchTouchEnd | | | ✔️ | | | | | | | | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| MovableViewProps.direction | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| MovableViewProps.inertia | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.outOfBounds | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.x | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| MovableViewProps.y | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| MovableViewProps.damping | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.friction | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| MovableViewProps.scale | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.scaleMin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.scaleMax | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.scaleValue | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.animation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | +| MovableViewProps.onChangeEnd | | | ✔️ | | | | | | | +| MovableViewProps.onDragStart | | | | | | | ✔️ | | | +| MovableViewProps.onDragEnd | | | | | | | ✔️ | | | +| MovableViewProps.onScale | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| MovableViewProps.onTouchStart | | | ✔️ | | | | | | | +| MovableViewProps.onTouchMove | | | ✔️ | | | | | | | +| MovableViewProps.onTouchEnd | | | ✔️ | | | ✔️(此事件的触发顺序会因为当前事件机制引起组件内外注册的事件执行顺序不正常,外部注册的事件可能会优先于内部执行,如需保证执行顺序一致,需要在回调函数中包裹 setTimeout 临时处理) | | | ✔️ | +| MovableViewProps.onTouchCancel | | | ✔️ | | | | | | | +| MovableViewProps.onHTouchMove | ✔️ | ✔️ | | ✔️ | | ✔️ | | | ✔️ | +| MovableViewProps.onVTouchMove | ✔️ | ✔️ | | ✔️ | | ✔️ | | | ✔️ | +| MovableViewProps.catchTouchStart | | | ✔️ | | | | | | | +| MovableViewProps.catchTouchMove | | | ✔️ | | | | | | | +| MovableViewProps.catchTouchEnd | | | ✔️ | | | | | | | ### TChangeSource diff --git a/docs/components/viewContainer/native-slot.md b/docs/components/viewContainer/native-slot.md index c75278f933a7..77b253daeb03 100644 --- a/docs/components/viewContainer/native-slot.md +++ b/docs/components/viewContainer/native-slot.md @@ -5,7 +5,7 @@ sidebar_label: NativeSlot 编译的原生组件支持使用 slot 插槽 -支持情况: +支持情况: > [参考文档](https://github.com/NervJS/taro/pull/12627) diff --git a/docs/components/viewContainer/page-container.md b/docs/components/viewContainer/page-container.md index 22e09aea7339..bda4efb990a5 100644 --- a/docs/components/viewContainer/page-container.md +++ b/docs/components/viewContainer/page-container.md @@ -12,7 +12,7 @@ Bug & Tip 1. tip: 当前页面最多只有 1 个容器,若已存在容器的情况下,无法增加新的容器 2. tip: wx.navigateBack 无法在页面栈顶调用,此时没有上一级页面 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html) @@ -47,26 +47,26 @@ ComponentType ### API 支持度 -| API | 微信小程序 | 支付宝小程序 | 京东小程序 | H5 | React Native | Harmony | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| PageContainerProps.show | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.duration | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.zIndex | ✔️ | ✔️ | | | | | | -| PageContainerProps.overlay | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.position | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.round | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.overlayStyle | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.customStyle | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.closeOnSlideDown | ✔️ | ✔️ | ✔️ | | | | | -| PageContainerProps.onBeforeEnter | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.onEnter | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.onAfterEnter | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.onBeforeLeave | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.onLeave | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.onAfterLeave | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| PageContainerProps.onClickOverlay | ✔️ | ✔️ | ✔️ | | | | | -| PageContainerProps.onEnterCancelled | | ✔️ | | | | | | -| PageContainerProps.onLeaveCancelled | | ✔️ | | | | | | +| API | 微信小程序 | 支付宝小程序 | 京东小程序 | H5 | React Native | Harmony | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| PageContainerProps.show | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.duration | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.zIndex | ✔️ | ✔️ | | | | | +| PageContainerProps.overlay | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.position | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.round | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.overlayStyle | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.customStyle | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.closeOnSlideDown | ✔️ | ✔️ | ✔️ | | | | +| PageContainerProps.onBeforeEnter | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.onEnter | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.onAfterEnter | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.onBeforeLeave | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.onLeave | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.onAfterLeave | ✔️ | ✔️ | ✔️ | | ✔️ | | +| PageContainerProps.onClickOverlay | ✔️ | ✔️ | ✔️ | | | | +| PageContainerProps.onEnterCancelled | | ✔️ | | | | | +| PageContainerProps.onLeaveCancelled | | ✔️ | | | | | ### Position diff --git a/docs/components/viewContainer/root-portal.md b/docs/components/viewContainer/root-portal.md index e8c7fc465263..8b9ed266b5b7 100644 --- a/docs/components/viewContainer/root-portal.md +++ b/docs/components/viewContainer/root-portal.md @@ -6,7 +6,7 @@ sidebar_label: RootPortal root-portal 使整个子树从页面中脱离出来,类似于在 CSS 中使用 fixed position 的效果。主要用于制作弹窗、弹出层等。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/root-portal.html) @@ -59,6 +59,6 @@ export default function RootPortalExample { ### API 支持度 -| API | 微信小程序 | 支付宝小程序 | H5 | React Native | Harmony | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| RootPortalProps.enable | ✔️ | ✔️ | | | | | +| API | 微信小程序 | 支付宝小程序 | H5 | React Native | Harmony | +| :---: | :---: | :---: | :---: | :---: | :---: | +| RootPortalProps.enable | ✔️ | ✔️ | | | | diff --git a/docs/components/viewContainer/script.md b/docs/components/viewContainer/script.md index f91f98b41d5a..8d3980be6d73 100644 --- a/docs/components/viewContainer/script.md +++ b/docs/components/viewContainer/script.md @@ -6,7 +6,7 @@ sidebar_label: Script script 类似微信小程序的 wxs 标签,支持引用各种小程序的 xs 文件 只能在 CompileMode 中使用 -支持情况: +支持情况: ## 类型 @@ -50,7 +50,7 @@ export function Index () { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| ScriptProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | ✔️ | -| ScriptProps.module | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | ✔️ | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| ScriptProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | +| ScriptProps.module | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | diff --git a/docs/components/viewContainer/scroll-view.md b/docs/components/viewContainer/scroll-view.md index 20d0c83fdb9e..b3d24c2b92c1 100755 --- a/docs/components/viewContainer/scroll-view.md +++ b/docs/components/viewContainer/scroll-view.md @@ -9,7 +9,7 @@ Tips: H5 中 ScrollView 组件是通过一个高度(或宽度)固定的容器内部滚动来实现的,因此务必正确的设置容器的高度。例如: 如果 ScrollView 的高度将 body 撑开,就会同时存在两个滚动条(body 下的滚动条,以及 ScrollView 的滚动条)。 微信小程序 中 ScrollView 组件如果设置 scrollX 横向滚动时,并且子元素为多个时(单个子元素时设置固定宽度则可以正常横向滚动),需要通过 WXSS 设置 `white-space: nowrap` 来保证元素不换行,并对 ScrollView 内部元素设置 `display: inline-block` 来使其能够横向滚动。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html) @@ -249,74 +249,74 @@ typeof ScrollViewProps ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| ScrollViewProps.scrollX | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | ✔️ | ✔️ | ✔️ | -| ScrollViewProps.scrollY | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | ✔️ | ✔️ | ✔️ | -| ScrollViewProps.upperThreshold | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ScrollViewProps.lowerThreshold | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ScrollViewProps.scrollTop | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ScrollViewProps.scrollLeft | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ScrollViewProps.scrollIntoView | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| ScrollViewProps.scrollWithAnimation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ScrollViewProps.enableBackToTop | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | ✔️ | | | | -| ScrollViewProps.enableFlex | ✔️ | | | | | ✔️ | | | | | | -| ScrollViewProps.scrollAnchoring | ✔️ | | | | | | | | | | | -| ScrollViewProps.refresherEnabled | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.refresherThreshold | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.refresherDefaultStyle | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.refresherBackground | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.refresherTriggered | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.enhanced | ✔️ | ✔️ | | | | | | | | | | -| ScrollViewProps.usingSticky | ✔️ | | | | | | | | | | | -| ScrollViewProps.bounces | ✔️ | ✔️ | | | | | | | | | | -| ScrollViewProps.showScrollbar | ✔️ | | | | | | | | ✔️ | | ✔️ | -| ScrollViewProps.pagingEnabled | ✔️ | | | | | | | | | | | -| ScrollViewProps.fastDeceleration | ✔️ | | | | | | | | | | | -| ScrollViewProps.scrollAnimationDuration | | | ✔️ | | | | | | | | | -| ScrollViewProps.trapScroll | | | ✔️ | | | | | | | | | -| ScrollViewProps.disableLowerScroll | | | ✔️ | | | | | | | | | -| ScrollViewProps.disableUpperScroll | | | ✔️ | | | | | | | | | -| ScrollViewProps.ariaLabel | | | | | ✔️ | | | | | | | -| ScrollViewProps.enablePassive | ✔️ | | | | | | | | | | | -| ScrollViewProps.type | ✔️ | | | | | | | | ✔️ | | | -| ScrollViewProps.associativeContainer | ✔️ | | | | | | | | | | | -| ScrollViewProps.reverse | ✔️ | | | | | | | | | | | -| ScrollViewProps.clip | ✔️ | | | | | | | | | | | -| ScrollViewProps.cacheExtent | ✔️ | | | | | | | | | | | -| ScrollViewProps.minDragDistance | ✔️ | | | | | | | | | | | -| ScrollViewProps.padding | ✔️ | | | | | | | | | | | -| ScrollViewProps.scrollIntoViewWithinExtent | ✔️ | | | | | | | | | | | -| ScrollViewProps.scrollIntoViewAlignment | ✔️ | | | | | | ✔️ | | | ✔️ | | -| ScrollViewProps.refresherTwoLevelEnabled | ✔️ | | | | | | | | | | | -| ScrollViewProps.refresherTwoLevelTriggered | ✔️ | | | | | | | | | | | -| ScrollViewProps.refresherTwoLevelThreshold | ✔️ | | | | | | | | | | | -| ScrollViewProps.refresherTwoLevelCloseThreshold | ✔️ | | | | | | | | | | | -| ScrollViewProps.refresherTwoLevelScrollEnabled | ✔️ | | | | | | | | | | | -| ScrollViewProps.refresherBallisticRefreshEnabled | ✔️ | | | | | | | | | | | -| ScrollViewProps.refresherTwoLevelPinned | ✔️ | | | | | | | | | | | -| ScrollViewProps.onScrollToUpper | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ScrollViewProps.onScrollToLower | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ScrollViewProps.onScroll | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| ScrollViewProps.onScrollStart | ✔️ | | | | | | | | | | | -| ScrollViewProps.onScrollEnd | ✔️ | | | | | | | | | | | -| ScrollViewProps.onRefresherPulling | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.onRefresherRefresh | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.onRefresherRestore | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.onRefresherAbort | ✔️ | | | | | | | | | | ✔️ | -| ScrollViewProps.onRefresherWillRefresh | ✔️ | | | | | | | | | | | -| ScrollViewProps.onRefresherStatusChange | ✔️ | | | | | | | | | | | -| ScrollViewProps.onDragStart | ✔️ | | | | | | | | | | | -| ScrollViewProps.onDragging | ✔️ | | | | | | | | | | | -| ScrollViewProps.onDragEnd | ✔️ | | | | | | | | | | | -| ScrollViewProps.onTouchStart | | | ✔️ | | | | | | | | | -| ScrollViewProps.onTouchMove | | | ✔️ | | | | | | | | | -| ScrollViewProps.onTouchEnd | | | ✔️ | | | | | | | | | -| ScrollViewProps.onTouchCancel | | | ✔️ | | | | | | | | | -| ScrollViewProps.onScrollStartWorklet | ✔️ | | | | | | | | | | | -| ScrollViewProps.onScrollUpdateWorklet | ✔️ | | | | | | | | | | | -| ScrollViewProps.onScrollEndWorklet | ✔️ | | | | | | | | | | | -| ScrollViewProps.adjustDecelerationVelocityWorklet | ✔️ | | | | | | | | | | | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| ScrollViewProps.scrollX | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | ✔️ | ✔️ | +| ScrollViewProps.scrollY | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | ✔️ | ✔️ | +| ScrollViewProps.upperThreshold | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.lowerThreshold | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.scrollTop | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.scrollLeft | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.scrollIntoView | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| ScrollViewProps.scrollWithAnimation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.enableBackToTop | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | ✔️ | | | +| ScrollViewProps.enableFlex | ✔️ | | | | | ✔️ | | | | | +| ScrollViewProps.scrollAnchoring | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherEnabled | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherThreshold | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherDefaultStyle | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherBackground | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherTriggered | ✔️ | | | | | | | | | | +| ScrollViewProps.enhanced | ✔️ | ✔️ | | | | | | | | | +| ScrollViewProps.usingSticky | ✔️ | | | | | | | | | | +| ScrollViewProps.bounces | ✔️ | ✔️ | | | | | | | | | +| ScrollViewProps.showScrollbar | ✔️ | | | | | | | | ✔️ | | +| ScrollViewProps.pagingEnabled | ✔️ | | | | | | | | | | +| ScrollViewProps.fastDeceleration | ✔️ | | | | | | | | | | +| ScrollViewProps.scrollAnimationDuration | | | ✔️ | | | | | | | | +| ScrollViewProps.trapScroll | | | ✔️ | | | | | | | | +| ScrollViewProps.disableLowerScroll | | | ✔️ | | | | | | | | +| ScrollViewProps.disableUpperScroll | | | ✔️ | | | | | | | | +| ScrollViewProps.ariaLabel | | | | | ✔️ | | | | | | +| ScrollViewProps.enablePassive | ✔️ | | | | | | | | | | +| ScrollViewProps.type | ✔️ | | | | | | | | ✔️ | | +| ScrollViewProps.associativeContainer | ✔️ | | | | | | | | | | +| ScrollViewProps.reverse | ✔️ | | | | | | | | | | +| ScrollViewProps.clip | ✔️ | | | | | | | | | | +| ScrollViewProps.cacheExtent | ✔️ | | | | | | | | | | +| ScrollViewProps.minDragDistance | ✔️ | | | | | | | | | | +| ScrollViewProps.padding | ✔️ | | | | | | | | | | +| ScrollViewProps.scrollIntoViewWithinExtent | ✔️ | | | | | | | | | | +| ScrollViewProps.scrollIntoViewAlignment | ✔️ | | | | | | ✔️ | | | ✔️ | +| ScrollViewProps.refresherTwoLevelEnabled | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherTwoLevelTriggered | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherTwoLevelThreshold | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherTwoLevelCloseThreshold | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherTwoLevelScrollEnabled | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherBallisticRefreshEnabled | ✔️ | | | | | | | | | | +| ScrollViewProps.refresherTwoLevelPinned | ✔️ | | | | | | | | | | +| ScrollViewProps.onScrollToUpper | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.onScrollToLower | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.onScroll | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| ScrollViewProps.onScrollStart | ✔️ | | | | | | | | | | +| ScrollViewProps.onScrollEnd | ✔️ | | | | | | | | | | +| ScrollViewProps.onRefresherPulling | ✔️ | | | | | | | | | | +| ScrollViewProps.onRefresherRefresh | ✔️ | | | | | | | | | | +| ScrollViewProps.onRefresherRestore | ✔️ | | | | | | | | | | +| ScrollViewProps.onRefresherAbort | ✔️ | | | | | | | | | | +| ScrollViewProps.onRefresherWillRefresh | ✔️ | | | | | | | | | | +| ScrollViewProps.onRefresherStatusChange | ✔️ | | | | | | | | | | +| ScrollViewProps.onDragStart | ✔️ | | | | | | | | | | +| ScrollViewProps.onDragging | ✔️ | | | | | | | | | | +| ScrollViewProps.onDragEnd | ✔️ | | | | | | | | | | +| ScrollViewProps.onTouchStart | | | ✔️ | | | | | | | | +| ScrollViewProps.onTouchMove | | | ✔️ | | | | | | | | +| ScrollViewProps.onTouchEnd | | | ✔️ | | | | | | | | +| ScrollViewProps.onTouchCancel | | | ✔️ | | | | | | | | +| ScrollViewProps.onScrollStartWorklet | ✔️ | | | | | | | | | | +| ScrollViewProps.onScrollUpdateWorklet | ✔️ | | | | | | | | | | +| ScrollViewProps.onScrollEndWorklet | ✔️ | | | | | | | | | | +| ScrollViewProps.adjustDecelerationVelocityWorklet | ✔️ | | | | | | | | | | | 参数 | 类型 | | --- | --- | diff --git a/docs/components/viewContainer/slot.md b/docs/components/viewContainer/slot.md index fb889ede6e25..9b43404f2a2f 100644 --- a/docs/components/viewContainer/slot.md +++ b/docs/components/viewContainer/slot.md @@ -5,7 +5,7 @@ sidebar_label: Slot slot 插槽 -支持情况: +支持情况: ## 类型 @@ -42,7 +42,7 @@ export default class SlotView extends Component { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| SlotProps.name | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | ✔️ | -| SlotProps.varName | | ✔️ | | | | | | | | | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| SlotProps.name | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | +| SlotProps.varName | | ✔️ | | | | | | | | diff --git a/docs/components/viewContainer/swiper-item.md b/docs/components/viewContainer/swiper-item.md index e70b8db42b87..ccc584415f78 100644 --- a/docs/components/viewContainer/swiper-item.md +++ b/docs/components/viewContainer/swiper-item.md @@ -6,7 +6,7 @@ sidebar_label: SwiperItem 仅可放置在 swiper 组件中,宽高自动设置为100% > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147) -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/swiper-item.html) @@ -92,8 +92,8 @@ class App extends Component { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 抖音小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| SwiperItemProps.itemId | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperItemProps.skipHiddenItemLayout | ✔️ | | | | | | | | | -| SwiperItemProps.deep | | | | | ✔️ | | | | | +| API | 微信小程序 | 百度小程序 | 抖音小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| SwiperItemProps.itemId | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperItemProps.skipHiddenItemLayout | ✔️ | | | | | | | | +| SwiperItemProps.deep | | | | | ✔️ | | | | diff --git a/docs/components/viewContainer/swiper.md b/docs/components/viewContainer/swiper.md index 89ab9e8861ee..cb4a4fd6dcd3 100755 --- a/docs/components/viewContainer/swiper.md +++ b/docs/components/viewContainer/swiper.md @@ -6,7 +6,7 @@ sidebar_label: Swiper 滑块视图容器。其中只可放置 swiper-item 组件,否则会导致未定义的行为。 > 不要为 `SwiperItem` 设置 **style** 属性,可以通过 class 设置样式。[7147](https://github.com/NervJS/taro/issues/7147) -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html) @@ -138,57 +138,57 @@ class App extends Component { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| SwiperProps.indicatorDots | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.indicatorColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.indicatorActiveColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.autoplay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.current | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.currentItemId | (deprecated) | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | | -| SwiperProps.interval | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.duration | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | -| SwiperProps.circular | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| SwiperProps.vertical | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.previousMargin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| SwiperProps.nextMargin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| SwiperProps.snapToEdge | ✔️ | | ✔️ | | | | | | | | | -| SwiperProps.displayMultipleItems | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ✔️ | -| SwiperProps.skipHiddenItemLayout | | | | | ✔️ | ✔️ | | | | | | -| SwiperProps.easingFunction | ✔️ | | ✔️ | ✔️ | | ✔️ | | | | | | -| SwiperProps.disableTouch | | | ✔️ | | | | | | | | ✔️ | -| SwiperProps.zoom | | | | | | | ✔️ | | | ✔️ | | -| SwiperProps.full | | | | | | | ✔️ | | | ✔️ | | -| SwiperProps.activeClass | | | ✔️ | | | | | | | | | -| SwiperProps.changingClass | | | ✔️ | | | | | | | | | -| SwiperProps.acceleration | | | ✔️ | | | | | | | | | -| SwiperProps.disableProgrammaticAnimation | | | ✔️ | | | | | | | | | -| SwiperProps.swipeRatio | | | ✔️ | | | | | | | | | -| SwiperProps.swipeSpeed | | | ✔️ | | | | | | | | | -| SwiperProps.touchAngle | | | ✔️ | | | | | | | | | -| SwiperProps.adjustHeight | | | ✔️ | | | | | | | | | -| SwiperProps.adjustVerticalHeight | | | ✔️ | | | | | | | | | -| SwiperProps.disableTouchmove | | ✔️ | | | | | | | | | | -| SwiperProps.effectsProps | | | | | | | ✔️ | | | | | -| SwiperProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | -| SwiperProps.onTransition | ✔️ | | ✔️ | ✔️ | ✔️ | | | | | | ✔️ | -| SwiperProps.onAnimationFinish | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| SwiperProps.onAnimationEnd | | | ✔️ | | | | | | | | | -| SwiperProps.layoutType | ✔️ | | | | | | | | | | | -| SwiperProps.transformerType | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorType | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorMargin | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorSpacing | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorRadius | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorWidth | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorHeight | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorAlignment | ✔️ | | | | | | | | | | | -| SwiperProps.indicatorOffset | ✔️ | | | | | | | | | | | -| SwiperProps.scrollWithAnimation | ✔️ | | | | | | | | | | | -| SwiperProps.cacheExtent | ✔️ | | | | | | | | | | | -| SwiperProps.onScrollStartWorklet | ✔️ | | | | | | | | | | | -| SwiperProps.onScrollUpdateWorklet | ✔️ | | | | | | | | | | | -| SwiperProps.onScrollEndWorklet | ✔️ | | | | | | | | | | | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| SwiperProps.indicatorDots | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.indicatorColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.indicatorActiveColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.autoplay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.current | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.currentItemId | (deprecated) | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| SwiperProps.interval | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.duration | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | +| SwiperProps.circular | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwiperProps.vertical | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.previousMargin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| SwiperProps.nextMargin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| SwiperProps.snapToEdge | ✔️ | | ✔️ | | | | | | | | +| SwiperProps.displayMultipleItems | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| SwiperProps.skipHiddenItemLayout | | | | | ✔️ | ✔️ | | | | | +| SwiperProps.easingFunction | ✔️ | | ✔️ | ✔️ | | ✔️ | | | | | +| SwiperProps.disableTouch | | | ✔️ | | | | | | | | +| SwiperProps.zoom | | | | | | | ✔️ | | | ✔️ | +| SwiperProps.full | | | | | | | ✔️ | | | ✔️ | +| SwiperProps.activeClass | | | ✔️ | | | | | | | | +| SwiperProps.changingClass | | | ✔️ | | | | | | | | +| SwiperProps.acceleration | | | ✔️ | | | | | | | | +| SwiperProps.disableProgrammaticAnimation | | | ✔️ | | | | | | | | +| SwiperProps.swipeRatio | | | ✔️ | | | | | | | | +| SwiperProps.swipeSpeed | | | ✔️ | | | | | | | | +| SwiperProps.touchAngle | | | ✔️ | | | | | | | | +| SwiperProps.adjustHeight | | | ✔️ | | | | | | | | +| SwiperProps.adjustVerticalHeight | | | ✔️ | | | | | | | | +| SwiperProps.disableTouchmove | | ✔️ | | | | | | | | | +| SwiperProps.effectsProps | | | | | | | ✔️ | | | | +| SwiperProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.onTransition | ✔️ | | ✔️ | ✔️ | ✔️ | | | | | | +| SwiperProps.onAnimationFinish | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwiperProps.onAnimationEnd | | | ✔️ | | | | | | | | +| SwiperProps.layoutType | ✔️ | | | | | | | | | | +| SwiperProps.transformerType | ✔️ | | | | | | | | | | +| SwiperProps.indicatorType | ✔️ | | | | | | | | | | +| SwiperProps.indicatorMargin | ✔️ | | | | | | | | | | +| SwiperProps.indicatorSpacing | ✔️ | | | | | | | | | | +| SwiperProps.indicatorRadius | ✔️ | | | | | | | | | | +| SwiperProps.indicatorWidth | ✔️ | | | | | | | | | | +| SwiperProps.indicatorHeight | ✔️ | | | | | | | | | | +| SwiperProps.indicatorAlignment | ✔️ | | | | | | | | | | +| SwiperProps.indicatorOffset | ✔️ | | | | | | | | | | +| SwiperProps.scrollWithAnimation | ✔️ | | | | | | | | | | +| SwiperProps.cacheExtent | ✔️ | | | | | | | | | | +| SwiperProps.onScrollStartWorklet | ✔️ | | | | | | | | | | +| SwiperProps.onScrollUpdateWorklet | ✔️ | | | | | | | | | | +| SwiperProps.onScrollEndWorklet | ✔️ | | | | | | | | | | ### TChangeSource diff --git a/docs/components/viewContainer/view.md b/docs/components/viewContainer/view.md index feefff5dff9a..388dada8a494 100755 --- a/docs/components/viewContainer/view.md +++ b/docs/components/viewContainer/view.md @@ -5,7 +5,7 @@ sidebar_label: View 视图容器 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/view.html) @@ -121,30 +121,30 @@ export default class PageView extends Component { ### API 支持度 -| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | ASCF元服务 | -| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| ViewProps.hoverClass | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。) | | ✔️ | ✔️ | -| ViewProps.hoverStyle | | | | | | | | ✔️ | | | | -| ViewProps.hoverStopPropagation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | ✔️ | -| ViewProps.hoverStartTime | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ViewProps.hoverStayTime | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | -| ViewProps.disableScroll | | | ✔️ | | | | | | | | | -| ViewProps.hidden | | | ✔️ | | | | | | | | | -| ViewProps.animation | | | ✔️ | | | | | | | | | -| ViewProps.role | | | ✔️ | | | | | | | | | -| ViewProps.ariaRole | | | | | ✔️ | | | | | | | -| ViewProps.ariaLabel | | | | | ✔️ | | | | | | | -| ViewProps.onTap | | | ✔️ | | | | | | | | | -| ViewProps.onTouchStart | | | ✔️ | | | | | | | | | -| ViewProps.onTouchMove | | | ✔️ | | | | | | | | | -| ViewProps.onTouchEnd | | | ✔️ | | | | | | | | | -| ViewProps.onTouchCancel | | | ✔️ | | | | | | | | | -| ViewProps.onLongTap | | | ✔️ | | | | | | | | | -| ViewProps.onTransitionEnd | | | ✔️ | | | | | | | | | -| ViewProps.onAnimationIteration | | | ✔️ | | | | | | | | | -| ViewProps.onAnimationStart | | | ✔️ | | | | | | | | | -| ViewProps.onAnimationEnd | | | ✔️ | | | | | | | | | -| ViewProps.onAppear | | | ✔️ | | | | | | | | | -| ViewProps.onDisappear | | | ✔️ | | | | | | | | | -| ViewProps.onFirstAppear | | | ✔️ | | | | | | | | | -| ViewProps.catchMove | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | | +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| ViewProps.hoverClass | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。) | | ✔️ | +| ViewProps.hoverStyle | | | | | | | | ✔️ | | | +| ViewProps.hoverStopPropagation | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | +| ViewProps.hoverStartTime | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ViewProps.hoverStayTime | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ViewProps.disableScroll | | | ✔️ | | | | | | | | +| ViewProps.hidden | | | ✔️ | | | | | | | | +| ViewProps.animation | | | ✔️ | | | | | | | | +| ViewProps.role | | | ✔️ | | | | | | | | +| ViewProps.ariaRole | | | | | ✔️ | | | | | | +| ViewProps.ariaLabel | | | | | ✔️ | | | | | | +| ViewProps.onTap | | | ✔️ | | | | | | | | +| ViewProps.onTouchStart | | | ✔️ | | | | | | | | +| ViewProps.onTouchMove | | | ✔️ | | | | | | | | +| ViewProps.onTouchEnd | | | ✔️ | | | | | | | | +| ViewProps.onTouchCancel | | | ✔️ | | | | | | | | +| ViewProps.onLongTap | | | ✔️ | | | | | | | | +| ViewProps.onTransitionEnd | | | ✔️ | | | | | | | | +| ViewProps.onAnimationIteration | | | ✔️ | | | | | | | | +| ViewProps.onAnimationStart | | | ✔️ | | | | | | | | +| ViewProps.onAnimationEnd | | | ✔️ | | | | | | | | +| ViewProps.onAppear | | | ✔️ | | | | | | | | +| ViewProps.onDisappear | | | ✔️ | | | | | | | | +| ViewProps.onFirstAppear | | | ✔️ | | | | | | | | +| ViewProps.catchMove | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | diff --git a/packages/taro-components/types/CoverView.d.ts b/packages/taro-components/types/CoverView.d.ts index 701e449ce1c1..c25e946f745a 100644 --- a/packages/taro-components/types/CoverView.d.ts +++ b/packages/taro-components/types/CoverView.d.ts @@ -114,6 +114,22 @@ interface CoverViewProps extends ViewProps { * @supported alipay */ onTouchCancel?: CommonEventFunction + /** + * 标记点 ID + * @description 用于地图组件的标记点识别 + * @supported weapp + * @example + * + */ + markerId?: number + /** + * 插槽名称 + * @description 用于组件间的内容分发 + * @supported weapp + * @example + * + */ + slot?: string } /** 覆盖在原生组件之上的文本视图。可覆盖的原生组件包括 map、video、canvas、camera、live-player、live-pusher 只支持嵌套 cover-view、cover-image,可在 cover-view 中使用 button。 * @classification viewContainer diff --git a/packages/taro-components/types/List.d.ts b/packages/taro-components/types/List.d.ts new file mode 100644 index 000000000000..a2663909f600 --- /dev/null +++ b/packages/taro-components/types/List.d.ts @@ -0,0 +1,38 @@ +import type { ComponentType, PropsWithChildren } from 'react' +import type { ListBuilderProps } from './ListBuilder' +import type { ScrollViewProps } from './ScrollView' +import type { StandardProps } from './common' + +interface ListProps + extends Pick< + ScrollViewProps, + | 'scrollX' + | 'scrollY' + | 'scrollTop' + | 'scrollIntoView' + | 'enableBackToTop' + | 'showScrollbar' + | 'onScroll' + | 'onScrollStart' + | 'onScrollEnd' + | 'onScrollToUpper' + | 'onScrollToLower' + | 'cacheExtent' + >, + Omit, + Pick { + /** 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 + * @default 50 + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + */ + upperThresholdCount?: number + /** 距底部/右边多远时(单位px),触发 scrolltolower 事件 + * @default 50 + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + */ + lowerThresholdCount?: number +} + +declare const List: ComponentType> + +export { List, ListProps } diff --git a/packages/taro-components/types/ListItem.d.ts b/packages/taro-components/types/ListItem.d.ts new file mode 100644 index 000000000000..eaa65742b287 --- /dev/null +++ b/packages/taro-components/types/ListItem.d.ts @@ -0,0 +1,6 @@ +import type { ComponentType, Key, PropsWithChildren } from 'react' +import type { ViewProps } from './View' + +declare const ListItem: ComponentType> + +export { ListItem } diff --git a/packages/taro-components/types/Textarea.d.ts b/packages/taro-components/types/Textarea.d.ts index a70e745b580e..139e0edc7ac4 100644 --- a/packages/taro-components/types/Textarea.d.ts +++ b/packages/taro-components/types/Textarea.d.ts @@ -125,9 +125,9 @@ interface TextareaProps extends StandardProps, FormItemProps { ariaLabel?: string /** 键盘对齐位置 * @supported weapp - * @default false + * @default 'cursor' */ - adjustKeyboardTo?: boolean + adjustKeyboardTo?: 'cursor' | 'bottom' /** 输入框聚焦时触发 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ diff --git a/packages/taro-components/types/index.d.ts b/packages/taro-components/types/index.d.ts index 3405a60a4573..f848253df038 100644 --- a/packages/taro-components/types/index.d.ts +++ b/packages/taro-components/types/index.d.ts @@ -63,6 +63,8 @@ export { OpenContainer } from './OpenContainer' export { DraggableSheet } from './DraggableSheet' export { NestedScrollHeader } from './NestedScrollHeader' export { NestedScrollBody } from './NestedScrollBody' +export { List } from './List' +export { ListItem } from './ListItem' /** 导航 */ export { FunctionalPageNavigator } from './FunctionalPageNavigator' diff --git a/packages/taro/types/api/base/system.d.ts b/packages/taro/types/api/base/system.d.ts index 3e20b53b49f8..b479e571a805 100644 --- a/packages/taro/types/api/base/system.d.ts +++ b/packages/taro/types/api/base/system.d.ts @@ -132,6 +132,18 @@ declare module '../../index' { deviceOrientation?: keyof DeviceOrientation /** 小程序当前运行环境 */ environment?: string + /** + * 仅支付宝小程序生效 + * screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。 + * https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253 + * 单位: px + * */ + screen?: { + /** 屏幕宽度 */ + width: number + /** 屏幕高度 */ + height: number + } } /** 系统主题合法值 */ interface Theme { @@ -231,6 +243,18 @@ declare module '../../index' { deviceOrientation?: keyof DeviceOrientation /** 小程序当前运行环境 */ environment?: string + /** + * 仅支付宝小程序生效 + * screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。 + * https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253 + * 单位: px + * */ + screen?: { + /** 屏幕宽度 */ + width: number + /** 屏幕高度 */ + height: number + } } /** 系统主题合法值 */ interface Theme { @@ -330,6 +354,18 @@ declare module '../../index' { deviceOrientation?: keyof DeviceOrientation /** 小程序当前运行环境 */ environment?: string + /** + * 仅支付宝小程序生效 + * screenHeight、screenWidth在 Android 上取值有误,建议使用 screen字段内的属性替代。 + * https://opendocs.alipay.com/mini/api/gawhvz?pathHash=270f3253 + * 单位: px + * */ + screen?: { + /** 屏幕宽度 */ + width: number + /** 屏幕高度 */ + height: number + } } /** 系统主题合法值 */ interface Theme { diff --git a/packages/taro/types/api/canvas/index.d.ts b/packages/taro/types/api/canvas/index.d.ts index 99ea3407615e..df65774034ad 100644 --- a/packages/taro/types/api/canvas/index.d.ts +++ b/packages/taro/types/api/canvas/index.d.ts @@ -2048,7 +2048,7 @@ declare module '../../index' { /** 创建 canvas 的绘图上下文 [CanvasContext](/docs/apis/canvas/CanvasContext) 对象 * * **Tip**: 需要指定 canvasId,该绘图上下文只作用于对应的 ``;另外,Web 端需要在 `useReady` 回调中执行它,否则会因为底层 canvas 渲染出来之前而去获取 CanvasContext,导致其底层的 context 为 `undefined`,从而不能正常绘图。 - * @supported weapp, alipay, swan, jd, qq, tt, h5, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, harmony_hybrid, harmony * @example * ```tsx * import { useReady } from '@tarojs/taro' diff --git a/packages/taro/types/api/cloud/index.d.ts b/packages/taro/types/api/cloud/index.d.ts index 16b37f586696..df076bdbc8f9 100644 --- a/packages/taro/types/api/cloud/index.d.ts +++ b/packages/taro/types/api/cloud/index.d.ts @@ -1,4 +1,4 @@ -import Taro, { DownloadTask, UploadTask } from "../../index" +import Taro from "../../index" declare module '../../index' { namespace cloud { @@ -212,6 +212,10 @@ declare module '../../index' { /** 调用云托管参数 */ interface CallContainerParam < P extends string | TaroGeneral.IAnyObject | ArrayBuffer = any | any > { + config?:{ + /** 微信云托管的环境ID, 如果在 Taro.cloud.init 中配置了env, 则可以不配置。 */ + env: string, + } /** 服务路径 */ path: string /** HTTP请求方法,默认 GET */ diff --git a/packages/taro/types/api/device/keyboard.d.ts b/packages/taro/types/api/device/keyboard.d.ts index bf6f1bbae5f9..12b80ab1a5e3 100644 --- a/packages/taro/types/api/device/keyboard.d.ts +++ b/packages/taro/types/api/device/keyboard.d.ts @@ -43,7 +43,7 @@ declare module '../../index' { interface TaroStatic { /** 在input、textarea等focus拉起键盘之后,手动调用此接口收起键盘 - * @supported weapp, alipay, swan, jd, tt, rn, harmony_hybrid + * @supported weapp, alipay, swan, jd, tt, rn, harmony_hybrid, harmony * @example * ```tsx * Taro.hideKeyboard({ diff --git a/packages/taro/types/api/device/memory.d.ts b/packages/taro/types/api/device/memory.d.ts index 94516403951f..d366723c9dee 100644 --- a/packages/taro/types/api/device/memory.d.ts +++ b/packages/taro/types/api/device/memory.d.ts @@ -26,7 +26,7 @@ declare module '../../index' { /** 监听内存不足告警事件。 * * 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。 - * @supported weapp, alipay, swan, jd, tt + * @supported weapp, alipay, swan, jd, tt, harmony * @example * ```tsx * Taro.onMemoryWarning(function () { @@ -41,7 +41,7 @@ declare module '../../index' { ): void /** 取消监听内存不足告警事件。 - * @supported weapp, alipay, swan + * @supported weapp, alipay, swan, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/memory/wx.offMemoryWarning.html */ offMemoryWarning( diff --git a/packages/taro/types/api/files/index.d.ts b/packages/taro/types/api/files/index.d.ts index 8ab00efa1eb0..bf6f74e9617a 100644 --- a/packages/taro/types/api/files/index.d.ts +++ b/packages/taro/types/api/files/index.d.ts @@ -1464,7 +1464,7 @@ declare module '../../index' { getFileInfo(option: getFileInfo.Option): Promise /** 获取全局唯一的文件管理器 - * @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html */ getFileSystemManager(): FileSystemManager diff --git a/packages/taro/types/api/location/index.d.ts b/packages/taro/types/api/location/index.d.ts index 9be76e5ab502..cfe35bbc373e 100644 --- a/packages/taro/types/api/location/index.d.ts +++ b/packages/taro/types/api/location/index.d.ts @@ -455,7 +455,7 @@ declare module '../../index' { * **注意** * - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。 * - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。 - * @supported weapp, swan, jd, qq, tt, rn, harmony_hybrid + * @supported weapp, swan, jd, qq, tt, rn, harmony_hybrid, harmony * @example * ```tsx * Taro.getLocation({ diff --git a/packages/taro/types/api/media/audio.d.ts b/packages/taro/types/api/media/audio.d.ts index 0d8eedcac9f0..3a938cc0d168 100644 --- a/packages/taro/types/api/media/audio.d.ts +++ b/packages/taro/types/api/media/audio.d.ts @@ -740,7 +740,11 @@ declare module '../../index' { * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html */ - decodeAudioData(): AudioBuffer + decodeAudioData( + audioData: ArrayBuffer, + successCallback: (buffer: AudioBuffer) => void, + errorCallback: (error: any) => void + ): Promise } namespace WebAudioContext { diff --git a/packages/taro/types/api/media/video.d.ts b/packages/taro/types/api/media/video.d.ts index fbf13418c9a4..81dc34fb13b8 100644 --- a/packages/taro/types/api/media/video.d.ts +++ b/packages/taro/types/api/media/video.d.ts @@ -442,7 +442,7 @@ declare module '../../index' { getVideoInfo(option: getVideoInfo.Option): Promise /** 创建 video 上下文 VideoContext 对象。 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid, harmony * @example * ```tsx * videoContext = Taro.createVideoContext('myVideo') @@ -505,7 +505,7 @@ declare module '../../index' { chooseVideo(option: chooseVideo.Option): Promise /** 拍摄或从手机相册中选择图片或视频。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony * @example * ```tsx * Taro.chooseMedia({ diff --git a/packages/taro/types/api/media/voip.d.ts b/packages/taro/types/api/media/voip.d.ts index 1cc1dea97bbb..c37ab2699215 100644 --- a/packages/taro/types/api/media/voip.d.ts +++ b/packages/taro/types/api/media/voip.d.ts @@ -320,7 +320,7 @@ declare module '../../index' { * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.setEnable1v1Chat.html */ - setEnable1v1Chat(option: subscribeVoIPVideoMembers.Option): Promise + setEnable1v1Chat(option: setEnable1v1Chat.Option): Promise /** 监听实时语音通话成员视频状态变化事件 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.onVoIPVideoMembersChanged.html @@ -373,7 +373,7 @@ declare module '../../index' { */ offVoIPChatInterrupted(callback: onVoIPChatInterrupted.Callback): void /** 加入 (创建) 实时语音通话,更多信息可见 [实时语音指南](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/voip-chat.html) - * + * * 调用前需要用户授权 `scope.record`,若房间类型为视频房间需要用户授权 `scope.camera`。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.joinVoIPChat.html diff --git a/packages/taro/types/api/network/download.d.ts b/packages/taro/types/api/network/download.d.ts index 1fbd846ee5be..77d91ce333d1 100644 --- a/packages/taro/types/api/network/download.d.ts +++ b/packages/taro/types/api/network/download.d.ts @@ -151,7 +151,7 @@ declare module '../../index' { /** 下载文件资源到本地。客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径,单次下载允许的最大文件为 50MB。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 * * 注意:请在服务端响应的 header 中指定合理的 `Content-Type` 字段,以保证客户端正确处理文件类型。 - * @supported weapp, h5, alipay, swan, rn, tt, harmony_hybrid + * @supported weapp, h5, alipay, swan, rn, tt, harmony_hybrid, harmony * @example * ```tsx * Taro.downloadFile({ diff --git a/packages/taro/types/api/network/request.d.ts b/packages/taro/types/api/network/request.d.ts index 4fac0617ef1a..794fca1e95b5 100644 --- a/packages/taro/types/api/network/request.d.ts +++ b/packages/taro/types/api/network/request.d.ts @@ -25,6 +25,11 @@ declare module '../../index' { dataType?: keyof DataType | string /** 响应的数据类型 */ responseType?: keyof ResponseType + /** + * 使用高性能模式。从基础库 v3.5.0 开始在 Android 端默认开启,其他端暂不生效。该模式下有更优的网络性能表现。 + * @default true + * */ + useHighPerformanceMode?: boolean /** 开启 http2 * @default false * @supported weapp diff --git a/packages/taro/types/api/network/upload.d.ts b/packages/taro/types/api/network/upload.d.ts index 4fa7167d7cd6..8794c86d81a6 100644 --- a/packages/taro/types/api/network/upload.d.ts +++ b/packages/taro/types/api/network/upload.d.ts @@ -152,7 +152,7 @@ declare module '../../index' { interface TaroStatic { /** 将本地资源上传到服务器。客户端发起一个 HTTPS POST 请求,其中 `content-type` 为 `multipart/form-data`。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 - * @supported weapp, swan, alipay, h5, rn, tt, harmony_hybrid + * @supported weapp, swan, alipay, h5, rn, tt, harmony_hybrid, harmony * @example * ```tsx * Taro.chooseImage({ diff --git a/packages/taro/types/api/open-api/subscribe-message.d.ts b/packages/taro/types/api/open-api/subscribe-message.d.ts index a168306a7f76..a2fd681f9e35 100644 --- a/packages/taro/types/api/open-api/subscribe-message.d.ts +++ b/packages/taro/types/api/open-api/subscribe-message.d.ts @@ -2,7 +2,7 @@ import Taro from '../../index' declare module '../../index' { namespace requestSubscribeMessage { - interface Option { + interface BaseOption { /** * 需要订阅的消息模板的id的集合(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置 * @supported weapp, tt @@ -24,6 +24,11 @@ declare module '../../index' { success?: (result: SuccessCallbackResult) => void } + type AtLeastOne = + Keys extends keyof T ? T & Required> : never; + + type Option = AtLeastOne; + interface FailCallbackResult extends TaroGeneral.CallbackResult { /** 接口调用失败错误码 */ errCode: number diff --git a/packages/taro/types/api/route/index.d.ts b/packages/taro/types/api/route/index.d.ts index 8bc89d4b8b42..c2d1bec63830 100644 --- a/packages/taro/types/api/route/index.d.ts +++ b/packages/taro/types/api/route/index.d.ts @@ -220,7 +220,7 @@ declare module '../../index' { interface TaroStatic { /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```json * { diff --git a/packages/taro/types/api/share/index.d.ts b/packages/taro/types/api/share/index.d.ts index 8f299e857443..29f34c816efa 100644 --- a/packages/taro/types/api/share/index.d.ts +++ b/packages/taro/types/api/share/index.d.ts @@ -3,26 +3,52 @@ import Taro from '../../index' declare module '../../index' { namespace updateShareMenu { interface Option { - /** 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取 */ - activityId?: string - /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: (res: TaroGeneral.CallbackResult) => void - /** 接口调用失败的回调函数 */ - fail?: (res: TaroGeneral.CallbackResult) => void - /** 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/updatable-message.html) */ + /** 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) + * @default false + */ + withShareTicket?: boolean + /** 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/updatable-message.html) + * @default false + */ isUpdatableMessage?: boolean + /** 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/miniprogram/dev/api/share/errorupdatableMessage.createActivityId)) 接口获取 + */ + activityId?: string + /** 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/miniprogram/dev/api/share/errorupdatableMessage.createActivityId) 接口获取。详见[群待办消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html + */ + toDoActivityId?: string + /** 动态消息的模板信息 + */ + templateInfo?: UpdatableMessageFrontEndTemplateInfo + /** 是否是私密消息。详见 [小程序私密消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/private-message.html) + */ + isPrivateMessage?: boolean + /** 参与用户此聊天室下的 group_openid 列表 + * @default [] + */ + participant?: string[] + /** 聊天工具模式特殊动态消息 + * @default false + */ + useForChatTool?: boolean + /** 指定成员的方式 + * @default 1 + */ + chooseType?: number /** 接口调用成功的回调函数 */ success?: (res: TaroGeneral.CallbackResult) => void - /** 动态消息的模板信息 */ - templateInfo?: UpdatableMessageFrontEndTemplateInfo - /** 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ - withShareTicket?: boolean + /** 接口调用失败的回调函数 */ + fail?: (res: TaroGeneral.CallbackResult) => void + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: (res: TaroGeneral.CallbackResult) => void } /** 动态消息的模板信息 */ interface UpdatableMessageFrontEndTemplateInfo { /** 参数列表 */ parameterList: UpdatableMessageFrontEndParameter[] + /** 模板ID */ + templateId: string } /** 参数列表 */ interface UpdatableMessageFrontEndParameter { diff --git a/packages/taro/types/api/storage/index.d.ts b/packages/taro/types/api/storage/index.d.ts index 120b4227e090..e1d8084f0b83 100644 --- a/packages/taro/types/api/storage/index.d.ts +++ b/packages/taro/types/api/storage/index.d.ts @@ -310,7 +310,7 @@ declare module '../../index' { createBufferURL( /** 需要存入内存的二进制数据 */ buffer: ArrayBuffer | TypedArray - ): void + ): string /** Taro.clearStorage 的同步版本 * @supported weapp, alipay, swan, jd, qq, tt, h5, harmony_hybrid @@ -327,7 +327,7 @@ declare module '../../index' { clearStorageSync(): void /** 清理本地数据缓存 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.clearStorage() diff --git a/packages/taro/types/api/taro.extend.d.ts b/packages/taro/types/api/taro.extend.d.ts index 4519a77168a8..5c4fa139016b 100644 --- a/packages/taro/types/api/taro.extend.d.ts +++ b/packages/taro/types/api/taro.extend.d.ts @@ -22,7 +22,7 @@ declare module '../index' { onShow: string preloadData?: Record /** - * RN 私有对象navigationRef,用于使用底层接口控制路由 + * RN 私有对象 navigationRef,用于使用底层接口控制路由 */ rnNavigationRef?: React.RefObject } @@ -48,13 +48,14 @@ declare module '../index' { [TaroGeneral.ENV_TYPE.HARMONY]: TaroGeneral.ENV_TYPE.HARMONY [TaroGeneral.ENV_TYPE.QUICKAPP]: TaroGeneral.ENV_TYPE.QUICKAPP [TaroGeneral.ENV_TYPE.HARMONYHYBRID]: TaroGeneral.ENV_TYPE.HARMONYHYBRID + [TaroGeneral.ENV_TYPE.ASCF]: TaroGeneral.ENV_TYPE.ASCF } namespace interceptorify { - type promiseifyApi = (requestParams: T) => Promise + type promisifyApi = (requestParams: T) => Promise interface InterceptorifyChain { requestParams: T - proceed: promiseifyApi + proceed: promisifyApi } type InterceptorifyInterceptor = (chain: InterceptorifyChain) => Promise interface Interceptorify { @@ -111,7 +112,7 @@ declare module '../index' { mpVersion: string /** 小程序环境 */ envType: string - /** 小程序appId */ + /** 小程序 appId */ appId: string } /** 插件信息 */ @@ -120,7 +121,7 @@ declare module '../index' { common: { /** 用户数据存储的路径 */ USER_DATA_PATH: string - /** 校验白名单属性中的appInfoLaunchFrom后返回额外信息 */ + /** 校验白名单属性中的 appInfoLaunchFrom 后返回额外信息 */ location: string | undefined launchFrom: string | undefined schema: string | undefined @@ -173,9 +174,9 @@ declare module '../index' { getRenderer(): 'webview' | 'skyline' /** - * 包裹 promiseify api 的洋葱圈模型 + * 包裹 promisify api 的洋葱圈模型 * @supported global - * @param promiseifyApi + * @param promisifyApi * @example * ```tsx * // 创建实例 @@ -227,6 +228,6 @@ declare module '../index' { * }) * ``` */ - interceptorify(promiseifyApi: interceptorify.promiseifyApi): interceptorify.Interceptorify + interceptorify(api: interceptorify.promisifyApi): interceptorify.Interceptorify } } diff --git a/packages/taro/types/api/taro.hooks.d.ts b/packages/taro/types/api/taro.hooks.d.ts index 6b07e06c7978..da775627737d 100644 --- a/packages/taro/types/api/taro.hooks.d.ts +++ b/packages/taro/types/api/taro.hooks.d.ts @@ -98,20 +98,20 @@ declare module '../index' { /** * 页面加载完成时的回调。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony */ useLoad>(callback: (param: T) => void): void /** * 页面卸载时的回调。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony */ useUnload(callback: () => void): void /** * 页面初次渲染完成的回调。 * 此时页面已经准备妥当,可以和视图层进行交互。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony */ useReady(callback: () => void): void @@ -133,6 +133,12 @@ declare module '../index' { */ useOptionMenuClick(callback: () => void): void + /** + * 键盘高度变化时的回调。 + * @supported alipay + */ + useKeyboardHeight(callback: (payload: { height: number }) => void): void + /** * 下拉中断时的回调。 * @supported alipay, h5, harmony_hybrid diff --git a/packages/taro/types/api/ui/tab-bar.d.ts b/packages/taro/types/api/ui/tab-bar.d.ts index 57e3be1292b6..afca2e227aa8 100644 --- a/packages/taro/types/api/ui/tab-bar.d.ts +++ b/packages/taro/types/api/ui/tab-bar.d.ts @@ -121,13 +121,13 @@ declare module '../../index' { interface TaroStatic { /** 显示 tabBar 某一项的右上角的红点 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html */ showTabBarRedDot(option: showTabBarRedDot.Option): Promise /** 显示 tabBar - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBar.html */ showTabBar(option?: showTabBar.Option): Promise @@ -148,7 +148,7 @@ declare module '../../index' { setTabBarStyle(option?: setTabBarStyle.Option): Promise /** 动态设置 tabBar 某一项的内容,`2.7.0` 起图片支持临时文件和网络文件。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.setTabBarItem({ @@ -163,7 +163,7 @@ declare module '../../index' { setTabBarItem(option: setTabBarItem.Option): Promise /** 为 tabBar 某一项的右上角添加文本 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.setTabBarBadge({ @@ -176,19 +176,19 @@ declare module '../../index' { setTabBarBadge(option: setTabBarBadge.Option): Promise /** 移除 tabBar 某一项右上角的文本 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.removeTabBarBadge.html */ removeTabBarBadge(option: removeTabBarBadge.Option): Promise /** 隐藏 tabBar 某一项的右上角的红点 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBarRedDot.html */ hideTabBarRedDot(option: hideTabBarRedDot.Option): Promise /** 隐藏 tabBar - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBar.html */ hideTabBar(option?: hideTabBar.Option): Promise diff --git a/packages/taro/types/compile/config/h5.d.ts b/packages/taro/types/compile/config/h5.d.ts index 088d4164c5c1..43883d311b67 100644 --- a/packages/taro/types/compile/config/h5.d.ts +++ b/packages/taro/types/compile/config/h5.d.ts @@ -6,6 +6,7 @@ import type { IOption, IPostcssOption, IUrlLoaderOption } from './util' import type { OutputOptions as RollupOutputOptions } from 'rollup' import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler' import type { OutputExt } from './project' +import type { ServerOptions as ViteServerOptions } from 'vite' export interface IH5RouterConfig { /** 配置路由模式 */ @@ -51,7 +52,8 @@ export interface IH5Config { router?: IH5RouterConfig /** 预览服务的配置,可以更改端口等参数。具体配置参考 [webpack-dev-server](https://webpack.js.org/configuration/dev-server) */ - devServer?: webpackDevServer.Configuration + // 修改后:同时支持 Webpack 和 Vite + devServer?: T extends 'vite' ? ViteServerOptions : webpackDevServer.Configuration /** 用于控制是否生成 js、css 对应的 sourceMap (默认值:watch 模式下为 true,否则为 false) */ enableSourceMap?: boolean @@ -119,8 +121,9 @@ export interface IH5Config { /** Web 编译过程的相关配置 */ compile?: { - exclude?: (string | RegExp)[] - include?: (string | RegExp)[] + exclude?: any[] + include?: any[] + /** 对应 @rollup/plugin-babel 插件的 filter 配置。只在 vite 编译模式下有效 */ filter?: (filename: string) => boolean } /** 生成的代码是否要兼容旧版浏览器,值为 true 时,会去读取 package.json 的 browserslist 字段。只在 vite 编译模式下有效 */ diff --git a/packages/taro/types/compile/config/mini.d.ts b/packages/taro/types/compile/config/mini.d.ts index 4bc69cc634c8..d7514669e3bf 100644 --- a/packages/taro/types/compile/config/mini.d.ts +++ b/packages/taro/types/compile/config/mini.d.ts @@ -91,8 +91,9 @@ export interface IMiniAppConfig /** 小程序编译过程的相关配置 */ compile?: { - exclude?: (string | RegExp)[] - include?: (string | RegExp)[] + exclude?: any[] + include?: any[] + /** 对应 @rollup/plugin-babel 插件的 filter 配置。只在 vite 编译模式下有效 */ filter?: (filename: string) => boolean } diff --git a/packages/taro/types/compile/viteCompilerContext.d.ts b/packages/taro/types/compile/viteCompilerContext.d.ts index 48f11ede8203..4513b36b54b1 100644 --- a/packages/taro/types/compile/viteCompilerContext.d.ts +++ b/packages/taro/types/compile/viteCompilerContext.d.ts @@ -9,6 +9,7 @@ import type { AppConfig, PageConfig } from '../index' export interface ViteNativeCompMeta { name: string + exportName: string scriptPath: string configPath: string config: PageConfig @@ -16,6 +17,7 @@ export interface ViteNativeCompMeta { templatePath: string cssPath?: string isPackage?: boolean + isGenerated?: boolean } export interface ViteFileType { @@ -57,6 +59,7 @@ export interface ViteHarmonyBuildConfig extends CommonBuildConfig, IHarmonyConfi runtimePath?: string | string[] isPure?: boolean taroComponentsPath: string + cssVariables?: boolean // 是否动态解析css变量 } export interface CommonBuildConfig extends IProjectConfig<'vite'> { @@ -109,6 +112,7 @@ export interface ViteCompilerContext { configFileList: string[] compilePage: (pageName: string) => VitePageMeta watchConfigFile: (rollupCtx: PluginContext) => void + collectedDeps: (rollupCtx: PluginContext, id: string, filter, cache: Set = new Set()) => Promise> getAppScriptPath: () => string getApp: () => ViteAppMeta getPages: () => VitePageMeta[] @@ -140,7 +144,9 @@ export interface ViteHarmonyCompilerContext extends ViteCompilerContext string[] modifyHarmonyConfig: (config: Partial) => void modifyHostPackage: (deps?: Record, devDeps?: Record) => Exclude - collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + resolvePageImportPath: (scriptPath: string, pageName: string) => string + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => ViteNativeCompMeta[] + generateNativeComponent: (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) => void getScriptPath: (filePath: string) => string getStylePath: (filePath: string) => string getConfigPath: (filePath: string) => string @@ -151,7 +157,9 @@ export interface ViteMiniCompilerContext extends ViteCompilerContext getCommonChunks: () => string[] - collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + resolvePageImportPath: (scriptPath: string, pageName: string) => string + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => ViteNativeCompMeta[] + generateNativeComponent: (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) => void getScriptPath: (filePath: string) => string getTemplatePath: (filePath: string) => string getStylePath: (filePath: string) => string diff --git a/packages/taro/types/global.d.ts b/packages/taro/types/global.d.ts index 85410b1fb434..8edca59a425f 100644 --- a/packages/taro/types/global.d.ts +++ b/packages/taro/types/global.d.ts @@ -410,6 +410,7 @@ declare namespace TaroGeneral { // ENV_TYPE enum ENV_TYPE { + ASCF = 'ASCF', WEAPP = 'WEAPP', SWAN = 'SWAN', ALIPAY = 'ALIPAY', diff --git a/packages/taro/types/index.d.ts b/packages/taro/types/index.d.ts index da8ec8360884..de679c27cfe1 100644 --- a/packages/taro/types/index.d.ts +++ b/packages/taro/types/index.d.ts @@ -192,4 +192,5 @@ declare namespace Taro { declare global { const defineAppConfig: (config: Taro.AppConfig) => Taro.AppConfig const definePageConfig: (config: Taro.PageConfig) => Taro.Config + const importNativeComponent: (path: string, name = '', exportName = 'default') => Awaited } diff --git a/packages/taro/types/taro.component.d.ts b/packages/taro/types/taro.component.d.ts index 5ae244eaee6d..825833482d19 100644 --- a/packages/taro/types/taro.component.d.ts +++ b/packages/taro/types/taro.component.d.ts @@ -45,6 +45,8 @@ declare module './index' { eh?(event: MpEvent): void onLoad(options: Record): void onOptionMenuClick?(): void + /** 键盘高度变化时触发 @supported alipay */ + onKeyboardHeight?(opt: { height: number; }): void onPageScroll?(opt: PageScrollObject): void onPopMenuClick?(): void onPullDownRefresh?(): void diff --git a/packages/taro/types/taro.config.d.ts b/packages/taro/types/taro.config.d.ts index 1bae7fbde63f..2e948de78331 100644 --- a/packages/taro/types/taro.config.d.ts +++ b/packages/taro/types/taro.config.d.ts @@ -193,7 +193,7 @@ declare module './index' { /** 页面自定义组件配置 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/ */ - usingComponents?: Record + usingComponents?: Record /** 指定使用升级后的 weui 样式 * - v2: 可表明启用新版的组件样式 * @default default @@ -581,7 +581,7 @@ declare module './index' { desc: string /** 在该场景下打开小程序时跳转页面 */ path: string - } + }[] /** 定制化型服务商票据 */ serviceProviderTicket?: string /** 半屏小程序 appId */