From 496c2644b49b5fa814537fc56d820299b5c497a7 Mon Sep 17 00:00:00 2001 From: ZakaryCode Date: Sat, 10 Aug 2024 01:37:54 +0000 Subject: [PATCH] refactor(types): sync components types --- docs/apis/base/env/env.md | 2 +- docs/apis/base/system/getSystemInfo.md | 2 +- docs/apis/base/system/getSystemInfoSync.md | 2 +- docs/apis/base/weapp/app-event/offError.md | 2 +- .../weapp/app-event/offUnhandledRejection.md | 2 +- docs/apis/base/weapp/app-event/onError.md | 2 +- .../weapp/app-event/onUnhandledRejection.md | 2 +- .../accelerometer/offAccelerometerChange.md | 2 +- .../accelerometer/onAccelerometerChange.md | 2 +- .../accelerometer/startAccelerometer.md | 2 +- .../device/accelerometer/stopAccelerometer.md | 2 +- docs/apis/device/battery/getBatteryInfo.md | 2 +- .../apis/device/battery/getBatteryInfoSync.md | 2 +- .../apis/device/clipboard/getClipboardData.md | 2 +- .../apis/device/clipboard/setClipboardData.md | 2 +- .../keyboard/offKeyboardHeightChange.md | 2 +- .../device/keyboard/onKeyboardHeightChange.md | 2 +- docs/apis/device/network/getNetworkType.md | 2 +- .../device/network/offNetworkStatusChange.md | 2 +- .../device/network/onNetworkStatusChange.md | 2 +- docs/apis/device/phone/makePhoneCall.md | 2 +- .../apis/device/screen/getScreenBrightness.md | 2 +- docs/apis/device/vibrate/vibrateLong.md | 2 +- docs/apis/device/vibrate/vibrateShort.md | 2 +- docs/apis/media/image/compressImage.md | 2 +- docs/apis/media/image/getImageInfo.md | 2 +- docs/apis/network/request/request.md | 4 +- docs/apis/route/navigateBack.md | 2 +- docs/apis/route/navigateTo.md | 2 +- docs/apis/route/reLaunch.md | 2 +- docs/apis/route/redirectTo.md | 2 +- docs/apis/route/switchTab.md | 2 +- docs/apis/storage/clearStorage.md | 2 +- docs/apis/storage/getStorage.md | 2 +- docs/apis/storage/removeStorage.md | 2 +- docs/apis/storage/setStorage.md | 2 +- docs/apis/taro.extend/getAppInfo.md | 2 +- docs/apis/ui/animation/createAnimation.md | 2 +- docs/apis/ui/interaction/showActionSheet.md | 2 +- docs/apis/ui/interaction/showModal.md | 2 +- docs/apis/ui/interaction/showToast.md | 2 +- docs/apis/ui/navigation-bar/hideHomeButton.md | 2 +- .../hideNavigationBarLoading.md | 2 +- .../navigation-bar/setNavigationBarColor.md | 2 +- .../navigation-bar/setNavigationBarTitle.md | 2 +- .../showNavigationBarLoading.md | 2 +- .../pull-down-refresh/startPullDownRefresh.md | 2 +- .../pull-down-refresh/stopPullDownRefresh.md | 2 +- docs/apis/ui/scroll/pageScrollTo.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/apis/wxml/IntersectionObserver.md | 15 +- docs/apis/wxml/createIntersectionObserver.md | 2 +- docs/apis/wxml/createSelectorQuery.md | 2 +- docs/components/base/icon.md | 6 +- docs/components/base/progress.md | 2 +- docs/components/base/text.md | 4 +- docs/components/forms/button.md | 10 +- docs/components/forms/checkbox.md | 10 +- docs/components/forms/form.md | 4 +- docs/components/forms/input.md | 30 ++-- docs/components/forms/label.md | 2 +- docs/components/forms/picker-view-column.md | 2 +- docs/components/forms/picker-view.md | 2 +- docs/components/forms/picker.md | 40 ++--- docs/components/forms/radio-group.md | 2 +- docs/components/forms/radio.md | 10 +- docs/components/forms/slider.md | 28 +-- docs/components/forms/switch.md | 10 +- docs/components/forms/textarea.md | 14 +- docs/components/media/camera.md | 2 +- docs/components/media/image.md | 4 +- docs/components/media/video.md | 32 ++-- docs/components/navig/navigation-bar.md | 8 +- docs/components/navig/navigator.md | 2 +- docs/components/page-meta.md | 14 +- docs/components/skyline/list-view.md | 2 +- docs/components/skyline/sticky-header.md | 2 +- docs/components/skyline/sticky-section.md | 2 +- docs/components/viewContainer/cover-image.md | 2 +- docs/components/viewContainer/scroll-view.md | 10 +- docs/components/viewContainer/slot.md | 2 +- docs/components/viewContainer/swiper-item.md | 2 +- docs/components/viewContainer/swiper.md | 18 +- packages/taro-components/types/Button.d.ts | 10 +- packages/taro-components/types/Camera.d.ts | 2 +- packages/taro-components/types/Checkbox.d.ts | 10 +- .../taro-components/types/CoverImage.d.ts | 2 +- packages/taro-components/types/Form.d.ts | 4 +- packages/taro-components/types/Icon.d.ts | 6 +- packages/taro-components/types/Image.d.ts | 5 +- packages/taro-components/types/Input.d.ts | 30 ++-- packages/taro-components/types/Label.d.ts | 2 +- packages/taro-components/types/ListView.d.ts | 2 +- .../taro-components/types/NavigationBar.d.ts | 8 +- packages/taro-components/types/Navigator.d.ts | 2 +- packages/taro-components/types/PageMeta.d.ts | 14 +- packages/taro-components/types/Picker.d.ts | 40 ++--- .../taro-components/types/PickerView.d.ts | 2 +- .../types/PickerViewColumn.d.ts | 2 +- packages/taro-components/types/Progress.d.ts | 2 +- packages/taro-components/types/Radio.d.ts | 10 +- .../taro-components/types/RadioGroup.d.ts | 2 +- .../taro-components/types/ScrollView.d.ts | 10 +- packages/taro-components/types/Slider.d.ts | 28 +-- packages/taro-components/types/Slot.d.ts | 2 +- .../taro-components/types/StickyHeader.d.ts | 2 +- .../taro-components/types/StickySection.d.ts | 2 +- packages/taro-components/types/Swiper.d.ts | 18 +- .../taro-components/types/SwiperItem.d.ts | 2 +- packages/taro-components/types/Switch.d.ts | 10 +- packages/taro-components/types/Text.d.ts | 4 +- packages/taro-components/types/Textarea.d.ts | 14 +- packages/taro-components/types/Video.d.ts | 32 ++-- packages/taro-components/types/common.d.ts | 9 +- packages/taro/types/api/base/env.d.ts | 2 +- packages/taro/types/api/base/system.d.ts | 4 +- .../taro/types/api/base/weapp/app-event.d.ts | 8 +- .../taro/types/api/device/accelerometer.d.ts | 8 +- packages/taro/types/api/device/battery.d.ts | 4 +- packages/taro/types/api/device/clipboard.d.ts | 28 +-- packages/taro/types/api/device/keyboard.d.ts | 4 +- packages/taro/types/api/device/network.d.ts | 6 +- packages/taro/types/api/device/phone.d.ts | 2 +- packages/taro/types/api/device/screen.d.ts | 4 +- packages/taro/types/api/device/vibrate.d.ts | 4 +- packages/taro/types/api/media/image.d.ts | 4 +- packages/taro/types/api/network/request.d.ts | 4 +- packages/taro/types/api/route/index.d.ts | 10 +- packages/taro/types/api/storage/index.d.ts | 8 +- packages/taro/types/api/swan/pay.d.ts | 8 +- packages/taro/types/api/taro.extend.d.ts | 8 +- packages/taro/types/api/ui/animation.d.ts | 2 +- packages/taro/types/api/ui/interaction.d.ts | 6 +- .../taro/types/api/ui/navigation-bar.d.ts | 10 +- .../taro/types/api/ui/pull-down-refresh.d.ts | 4 +- packages/taro/types/api/ui/scroll.d.ts | 2 +- packages/taro/types/api/ui/tab-bar.d.ts | 14 +- packages/taro/types/api/wxml/index.d.ts | 24 ++- packages/taro/types/compile/compiler.d.ts | 13 +- packages/taro/types/compile/config/h5.d.ts | 35 ++-- .../taro/types/compile/config/harmony.d.ts | 118 +++++++++++++ packages/taro/types/compile/config/index.d.ts | 2 + packages/taro/types/compile/config/mini.d.ts | 53 +++--- .../taro/types/compile/config/plugin.d.ts | 34 ++++ .../taro/types/compile/config/project.d.ts | 70 +++++--- packages/taro/types/compile/config/rn.d.ts | 21 +++ packages/taro/types/compile/config/util.d.ts | 28 ++- packages/taro/types/compile/index.d.ts | 8 + .../types/compile/viteCompilerContext.d.ts | 159 ++++++++++++++++++ packages/taro/types/index.d.ts | 1 - packages/taro/types/taro.component.d.ts | 1 + packages/taro/types/taro.config.d.ts | 5 + 158 files changed, 927 insertions(+), 498 deletions(-) create mode 100644 packages/taro/types/compile/config/harmony.d.ts create mode 100644 packages/taro/types/compile/config/plugin.d.ts create mode 100644 packages/taro/types/compile/viteCompilerContext.d.ts diff --git a/docs/apis/base/env/env.md b/docs/apis/base/env/env.md index 03d188dc5b06..e5620cff37b0 100644 --- a/docs/apis/base/env/env.md +++ b/docs/apis/base/env/env.md @@ -10,5 +10,5 @@ sidebar_label: env ## 类型 ```tsx -{ [key: string]: string; FRAMEWORK: "react" | "preact" | "nerv" | "vue" | "vue3"; TARO_ENV: "weapp" | "h5" | "rn" | "swan" | "alipay" | "tt" | "qq" | "jd" | "quickapp"; USER_DATA_PATH?: string; } +{ [key: string]: string; FRAMEWORK: "react" | "preact" | "solid" | "vue3"; TARO_ENV: "weapp" | "h5" | "rn" | "swan" | "alipay" | "tt" | "qq" | "jd" | "quickapp"; USER_DATA_PATH?: string; } ``` diff --git a/docs/apis/base/system/getSystemInfo.md b/docs/apis/base/system/getSystemInfo.md index 8280486b1d19..db76951c65ac 100644 --- a/docs/apis/base/system/getSystemInfo.md +++ b/docs/apis/base/system/getSystemInfo.md @@ -5,7 +5,7 @@ sidebar_label: getSystemInfo 获取系统信息,支持 `Promise` 化使用。 -支持情况: +支持情况: > 微信小程序: 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。 > diff --git a/docs/apis/base/system/getSystemInfoSync.md b/docs/apis/base/system/getSystemInfoSync.md index 7fa5b114cea5..7a400d7bddbc 100644 --- a/docs/apis/base/system/getSystemInfoSync.md +++ b/docs/apis/base/system/getSystemInfoSync.md @@ -5,7 +5,7 @@ sidebar_label: getSystemInfoSync [Taro.getSystemInfo](./getSystemInfo) 的同步版本 -支持情况: +支持情况: > 微信小程序: 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。 > diff --git a/docs/apis/base/weapp/app-event/offError.md b/docs/apis/base/weapp/app-event/offError.md index eac8fc51901d..643a26df4c0c 100644 --- a/docs/apis/base/weapp/app-event/offError.md +++ b/docs/apis/base/weapp/app-event/offError.md @@ -5,7 +5,7 @@ sidebar_label: offError 取消监听音频播放错误事件 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html) diff --git a/docs/apis/base/weapp/app-event/offUnhandledRejection.md b/docs/apis/base/weapp/app-event/offUnhandledRejection.md index 059bbe3af845..bd0c9e1cc352 100644 --- a/docs/apis/base/weapp/app-event/offUnhandledRejection.md +++ b/docs/apis/base/weapp/app-event/offUnhandledRejection.md @@ -5,7 +5,7 @@ sidebar_label: offUnhandledRejection 取消监听未处理的 Promise 拒绝事件 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html) diff --git a/docs/apis/base/weapp/app-event/onError.md b/docs/apis/base/weapp/app-event/onError.md index cef630673553..75bc173484b0 100644 --- a/docs/apis/base/weapp/app-event/onError.md +++ b/docs/apis/base/weapp/app-event/onError.md @@ -5,7 +5,7 @@ sidebar_label: onError 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html) diff --git a/docs/apis/base/weapp/app-event/onUnhandledRejection.md b/docs/apis/base/weapp/app-event/onUnhandledRejection.md index 8a3bdbd0769c..a43ea7bee4c6 100644 --- a/docs/apis/base/weapp/app-event/onUnhandledRejection.md +++ b/docs/apis/base/weapp/app-event/onUnhandledRejection.md @@ -8,7 +8,7 @@ sidebar_label: onUnhandledRejection **注意** - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html) diff --git a/docs/apis/device/accelerometer/offAccelerometerChange.md b/docs/apis/device/accelerometer/offAccelerometerChange.md index 4dadacc7dc52..cba9a4a25a36 100644 --- a/docs/apis/device/accelerometer/offAccelerometerChange.md +++ b/docs/apis/device/accelerometer/offAccelerometerChange.md @@ -5,7 +5,7 @@ sidebar_label: offAccelerometerChange 取消监听加速度数据事件,参数为空,则取消所有的事件监听。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html) diff --git a/docs/apis/device/accelerometer/onAccelerometerChange.md b/docs/apis/device/accelerometer/onAccelerometerChange.md index f2f4da2692eb..1084a3aa0677 100644 --- a/docs/apis/device/accelerometer/onAccelerometerChange.md +++ b/docs/apis/device/accelerometer/onAccelerometerChange.md @@ -5,7 +5,7 @@ sidebar_label: onAccelerometerChange 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 `Taro.stopAccelerometer` 停止监听。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.onAccelerometerChange.html) diff --git a/docs/apis/device/accelerometer/startAccelerometer.md b/docs/apis/device/accelerometer/startAccelerometer.md index 68e062742ba6..7e1f11a58a75 100644 --- a/docs/apis/device/accelerometer/startAccelerometer.md +++ b/docs/apis/device/accelerometer/startAccelerometer.md @@ -5,7 +5,7 @@ sidebar_label: startAccelerometer 开始监听加速度数据。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html) diff --git a/docs/apis/device/accelerometer/stopAccelerometer.md b/docs/apis/device/accelerometer/stopAccelerometer.md index 0e3fa7b7e939..e00856810b4c 100644 --- a/docs/apis/device/accelerometer/stopAccelerometer.md +++ b/docs/apis/device/accelerometer/stopAccelerometer.md @@ -5,7 +5,7 @@ sidebar_label: stopAccelerometer 停止监听加速度数据。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html) diff --git a/docs/apis/device/battery/getBatteryInfo.md b/docs/apis/device/battery/getBatteryInfo.md index 2af346c6401b..1cafac6c99a8 100644 --- a/docs/apis/device/battery/getBatteryInfo.md +++ b/docs/apis/device/battery/getBatteryInfo.md @@ -5,7 +5,7 @@ sidebar_label: getBatteryInfo 获取设备电量。同步 API Taro.getBatteryInfoSync 在 iOS 上不可用。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html) diff --git a/docs/apis/device/battery/getBatteryInfoSync.md b/docs/apis/device/battery/getBatteryInfoSync.md index 82f54498f9d5..4d798eb0ba48 100644 --- a/docs/apis/device/battery/getBatteryInfoSync.md +++ b/docs/apis/device/battery/getBatteryInfoSync.md @@ -5,7 +5,7 @@ sidebar_label: getBatteryInfoSync Taro.getBatteryInfo 的同步版本 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html) diff --git a/docs/apis/device/clipboard/getClipboardData.md b/docs/apis/device/clipboard/getClipboardData.md index a92302f12f03..6be0dc663b30 100644 --- a/docs/apis/device/clipboard/getClipboardData.md +++ b/docs/apis/device/clipboard/getClipboardData.md @@ -5,7 +5,7 @@ sidebar_label: getClipboardData 获取系统剪贴板内容 -支持情况: +支持情况: > H5: 部分实现 diff --git a/docs/apis/device/clipboard/setClipboardData.md b/docs/apis/device/clipboard/setClipboardData.md index 66107a7505dc..c5cd0e79aadb 100644 --- a/docs/apis/device/clipboard/setClipboardData.md +++ b/docs/apis/device/clipboard/setClipboardData.md @@ -5,7 +5,7 @@ sidebar_label: setClipboardData 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s -支持情况: +支持情况: > H5: 部分实现 diff --git a/docs/apis/device/keyboard/offKeyboardHeightChange.md b/docs/apis/device/keyboard/offKeyboardHeightChange.md index 9ded00f741c0..9650bb4ea033 100644 --- a/docs/apis/device/keyboard/offKeyboardHeightChange.md +++ b/docs/apis/device/keyboard/offKeyboardHeightChange.md @@ -5,7 +5,7 @@ sidebar_label: offKeyboardHeightChange 取消监听键盘高度变化事件。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.offKeyboardHeightChange.html) diff --git a/docs/apis/device/keyboard/onKeyboardHeightChange.md b/docs/apis/device/keyboard/onKeyboardHeightChange.md index fe7c4ad1c585..6c7bfbce33f1 100644 --- a/docs/apis/device/keyboard/onKeyboardHeightChange.md +++ b/docs/apis/device/keyboard/onKeyboardHeightChange.md @@ -5,7 +5,7 @@ sidebar_label: onKeyboardHeightChange 监听键盘高度变化 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.onKeyboardHeightChange.html) diff --git a/docs/apis/device/network/getNetworkType.md b/docs/apis/device/network/getNetworkType.md index 4d41dba95040..4173e7b6fddb 100644 --- a/docs/apis/device/network/getNetworkType.md +++ b/docs/apis/device/network/getNetworkType.md @@ -5,7 +5,7 @@ sidebar_label: getNetworkType 获取网络类型。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getNetworkType.html) diff --git a/docs/apis/device/network/offNetworkStatusChange.md b/docs/apis/device/network/offNetworkStatusChange.md index bac9bffc9aa8..03c6bb181c7a 100644 --- a/docs/apis/device/network/offNetworkStatusChange.md +++ b/docs/apis/device/network/offNetworkStatusChange.md @@ -5,7 +5,7 @@ sidebar_label: offNetworkStatusChange 取消监听网络状态变化事件,参数为空,则取消所有的事件监听。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html) diff --git a/docs/apis/device/network/onNetworkStatusChange.md b/docs/apis/device/network/onNetworkStatusChange.md index 330e7a1a2931..b678c3f48f85 100644 --- a/docs/apis/device/network/onNetworkStatusChange.md +++ b/docs/apis/device/network/onNetworkStatusChange.md @@ -5,7 +5,7 @@ sidebar_label: onNetworkStatusChange 监听网络状态变化。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.onNetworkStatusChange.html) diff --git a/docs/apis/device/phone/makePhoneCall.md b/docs/apis/device/phone/makePhoneCall.md index 4e418dd7ce3d..69750be63927 100644 --- a/docs/apis/device/phone/makePhoneCall.md +++ b/docs/apis/device/phone/makePhoneCall.md @@ -5,7 +5,7 @@ sidebar_label: makePhoneCall 拨打电话 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/phone/wx.makePhoneCall.html) diff --git a/docs/apis/device/screen/getScreenBrightness.md b/docs/apis/device/screen/getScreenBrightness.md index d8296c253e98..60bfde2c04e4 100644 --- a/docs/apis/device/screen/getScreenBrightness.md +++ b/docs/apis/device/screen/getScreenBrightness.md @@ -8,7 +8,7 @@ sidebar_label: getScreenBrightness **说明** - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html) diff --git a/docs/apis/device/vibrate/vibrateLong.md b/docs/apis/device/vibrate/vibrateLong.md index 158e6fda6175..5dda75654d05 100644 --- a/docs/apis/device/vibrate/vibrateLong.md +++ b/docs/apis/device/vibrate/vibrateLong.md @@ -5,7 +5,7 @@ sidebar_label: vibrateLong 使手机发生较长时间的振动(400ms) -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/vibrate/wx.vibrateLong.html) diff --git a/docs/apis/device/vibrate/vibrateShort.md b/docs/apis/device/vibrate/vibrateShort.md index 831628dbab3a..6041a15aef01 100644 --- a/docs/apis/device/vibrate/vibrateShort.md +++ b/docs/apis/device/vibrate/vibrateShort.md @@ -7,7 +7,7 @@ sidebar_label: vibrateShort 仅微信小程序平台支持 type 参数 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/vibrate/wx.vibrateShort.html) diff --git a/docs/apis/media/image/compressImage.md b/docs/apis/media/image/compressImage.md index 33be3beb59f0..e1cbaad88083 100644 --- a/docs/apis/media/image/compressImage.md +++ b/docs/apis/media/image/compressImage.md @@ -30,7 +30,7 @@ sidebar_label: compressImage | fail | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用失败的回调函数 | | quality | `number` | 否 | 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)。 | | compressedWidth | `number` | 否 | 压缩后图片的宽度,单位为px,若不填写则默认以 compressedHeight 为准等比缩放。 | -| compressHeight | `number` | 否 | 压缩后图片的高度,单位为px,若不填写则默认以 compressedWidth 为准等比缩放。 | +| compressedHeight | `number` | 否 | 压缩后图片的高度,单位为px,若不填写则默认以 compressedWidth 为准等比缩放。 | | success | `(result: SuccessCallbackResult) => void` | 否 | 接口调用成功的回调函数 | ### SuccessCallbackResult diff --git a/docs/apis/media/image/getImageInfo.md b/docs/apis/media/image/getImageInfo.md index 4e24ea700d72..94df96b59980 100644 --- a/docs/apis/media/image/getImageInfo.md +++ b/docs/apis/media/image/getImageInfo.md @@ -5,7 +5,7 @@ sidebar_label: getImageInfo 获取图片信息。网络图片需先配置download域名才能生效。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.getImageInfo.html) diff --git a/docs/apis/network/request/request.md b/docs/apis/network/request/request.md index 3d169543c479..79441ba3fb3a 100644 --- a/docs/apis/network/request/request.md +++ b/docs/apis/network/request/request.md @@ -11,7 +11,7 @@ sidebar_label: request - 对于 `POST` 方法且 `header['content-type']` 为 `application/json` 的数据,会对数据进行 JSON 序列化 - 对于 `POST` 方法且 `header['content-type']` 为 `application/x-www-form-urlencoded` 的数据,会将数据转换成 query string `(encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...)` -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html) @@ -49,7 +49,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: 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/route/navigateBack.md b/docs/apis/route/navigateBack.md index f36563155c2a..362ea873ab31 100644 --- a/docs/apis/route/navigateBack.md +++ b/docs/apis/route/navigateBack.md @@ -5,7 +5,7 @@ sidebar_label: navigateBack 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages 获取当前的页面栈,决定需要返回几层。 -支持情况: +支持情况: > H5: 若入参 delta 大于现有页面数时,返回应用打开的第一个页面(如果想要返回首页请使用 reLaunch 方法)。 diff --git a/docs/apis/route/navigateTo.md b/docs/apis/route/navigateTo.md index d68ff18c187b..a7f3eef51b7d 100644 --- a/docs/apis/route/navigateTo.md +++ b/docs/apis/route/navigateTo.md @@ -5,7 +5,7 @@ sidebar_label: navigateTo 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。 -支持情况: +支持情况: > H5: 未针对 tabbar 页面做限制处理 diff --git a/docs/apis/route/reLaunch.md b/docs/apis/route/reLaunch.md index 9336ebbd57cc..698061d2fd88 100644 --- a/docs/apis/route/reLaunch.md +++ b/docs/apis/route/reLaunch.md @@ -5,7 +5,7 @@ sidebar_label: reLaunch 关闭所有页面,打开到应用内的某个页面 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.reLaunch.html) diff --git a/docs/apis/route/redirectTo.md b/docs/apis/route/redirectTo.md index c51a3645fb78..558f987f5439 100644 --- a/docs/apis/route/redirectTo.md +++ b/docs/apis/route/redirectTo.md @@ -5,7 +5,7 @@ sidebar_label: redirectTo 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 -支持情况: +支持情况: > H5: 未针对 tabbar 页面做限制处理 diff --git a/docs/apis/route/switchTab.md b/docs/apis/route/switchTab.md index 50d43c1f9af7..ef0a84ac3bc8 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/storage/clearStorage.md b/docs/apis/storage/clearStorage.md index d29b2ed4a6ac..fdc20d668ceb 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/getStorage.md b/docs/apis/storage/getStorage.md index df0e9a2943ef..d07b6495da1d 100644 --- a/docs/apis/storage/getStorage.md +++ b/docs/apis/storage/getStorage.md @@ -5,7 +5,7 @@ sidebar_label: getStorage 从本地缓存中异步获取指定 key 的内容 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorage.html) diff --git a/docs/apis/storage/removeStorage.md b/docs/apis/storage/removeStorage.md index c5c7e515765d..3ac6e39d1a14 100644 --- a/docs/apis/storage/removeStorage.md +++ b/docs/apis/storage/removeStorage.md @@ -5,7 +5,7 @@ sidebar_label: removeStorage 从本地缓存中移除指定 key -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorage.html) diff --git a/docs/apis/storage/setStorage.md b/docs/apis/storage/setStorage.md index a1e72f088ba5..7ad5285e2ef0 100644 --- a/docs/apis/storage/setStorage.md +++ b/docs/apis/storage/setStorage.md @@ -5,7 +5,7 @@ sidebar_label: setStorage 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorage.html) diff --git a/docs/apis/taro.extend/getAppInfo.md b/docs/apis/taro.extend/getAppInfo.md index f32b2979f945..6c339f9087ff 100644 --- a/docs/apis/taro.extend/getAppInfo.md +++ b/docs/apis/taro.extend/getAppInfo.md @@ -5,7 +5,7 @@ sidebar_label: getAppInfo 小程序获取和 Taro 相关的 App 信息 -支持情况: +支持情况: ## 类型 diff --git a/docs/apis/ui/animation/createAnimation.md b/docs/apis/ui/animation/createAnimation.md index a410f065ff8f..bd5161dd9d88 100644 --- a/docs/apis/ui/animation/createAnimation.md +++ b/docs/apis/ui/animation/createAnimation.md @@ -5,7 +5,7 @@ sidebar_label: createAnimation 创建一个动画实例 [animation](../Animation)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/wx.createAnimation.html) diff --git a/docs/apis/ui/interaction/showActionSheet.md b/docs/apis/ui/interaction/showActionSheet.md index 50c4762d033f..7c4648051bc0 100644 --- a/docs/apis/ui/interaction/showActionSheet.md +++ b/docs/apis/ui/interaction/showActionSheet.md @@ -9,7 +9,7 @@ sidebar_label: showActionSheet - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showActionSheet.html) diff --git a/docs/apis/ui/interaction/showModal.md b/docs/apis/ui/interaction/showModal.md index 1287bd1f5939..aaef1bb0358e 100644 --- a/docs/apis/ui/interaction/showModal.md +++ b/docs/apis/ui/interaction/showModal.md @@ -8,7 +8,7 @@ sidebar_label: showModal - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showModal.html) diff --git a/docs/apis/ui/interaction/showToast.md b/docs/apis/ui/interaction/showToast.md index 38d31fdce99a..db5b09aaa420 100644 --- a/docs/apis/ui/interaction/showToast.md +++ b/docs/apis/ui/interaction/showToast.md @@ -9,7 +9,7 @@ sidebar_label: showToast - Taro.showLoading 和 Taro.showToast 同时只能显示一个 - Taro.showToast 应与 Taro.hideToast 配对使用 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html) diff --git a/docs/apis/ui/navigation-bar/hideHomeButton.md b/docs/apis/ui/navigation-bar/hideHomeButton.md index f76a23ddd11c..9e815cb907d8 100644 --- a/docs/apis/ui/navigation-bar/hideHomeButton.md +++ b/docs/apis/ui/navigation-bar/hideHomeButton.md @@ -5,7 +5,7 @@ sidebar_label: hideHomeButton 隐藏返回首页按钮。微信7.0.7版本起,当用户打开的小程序最底层页面是非首页时,默认展示“返回首页”按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideHomeButton.html) diff --git a/docs/apis/ui/navigation-bar/hideNavigationBarLoading.md b/docs/apis/ui/navigation-bar/hideNavigationBarLoading.md index 2c55548c93de..2066167ff939 100644 --- a/docs/apis/ui/navigation-bar/hideNavigationBarLoading.md +++ b/docs/apis/ui/navigation-bar/hideNavigationBarLoading.md @@ -5,7 +5,7 @@ sidebar_label: hideNavigationBarLoading 在当前页面隐藏导航条加载动画 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideNavigationBarLoading.html) diff --git a/docs/apis/ui/navigation-bar/setNavigationBarColor.md b/docs/apis/ui/navigation-bar/setNavigationBarColor.md index de08853a1ebd..1e0c83bcf0de 100644 --- a/docs/apis/ui/navigation-bar/setNavigationBarColor.md +++ b/docs/apis/ui/navigation-bar/setNavigationBarColor.md @@ -5,7 +5,7 @@ sidebar_label: setNavigationBarColor 设置页面导航条颜色 -支持情况: +支持情况: > H5: 不支持 animation 参数 > diff --git a/docs/apis/ui/navigation-bar/setNavigationBarTitle.md b/docs/apis/ui/navigation-bar/setNavigationBarTitle.md index a9c7c951f3f1..76a00c92fa34 100644 --- a/docs/apis/ui/navigation-bar/setNavigationBarTitle.md +++ b/docs/apis/ui/navigation-bar/setNavigationBarTitle.md @@ -5,7 +5,7 @@ sidebar_label: setNavigationBarTitle 动态设置当前页面的标题 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.setNavigationBarTitle.html) diff --git a/docs/apis/ui/navigation-bar/showNavigationBarLoading.md b/docs/apis/ui/navigation-bar/showNavigationBarLoading.md index f554e6107d4c..1f8662171d7d 100644 --- a/docs/apis/ui/navigation-bar/showNavigationBarLoading.md +++ b/docs/apis/ui/navigation-bar/showNavigationBarLoading.md @@ -5,7 +5,7 @@ sidebar_label: showNavigationBarLoading 在当前页面显示导航条加载动画 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.showNavigationBarLoading.html) diff --git a/docs/apis/ui/pull-down-refresh/startPullDownRefresh.md b/docs/apis/ui/pull-down-refresh/startPullDownRefresh.md index 147ee2f6648b..f353ce96e9d0 100644 --- a/docs/apis/ui/pull-down-refresh/startPullDownRefresh.md +++ b/docs/apis/ui/pull-down-refresh/startPullDownRefresh.md @@ -5,7 +5,7 @@ sidebar_label: startPullDownRefresh 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 -支持情况: +支持情况: > React Native: 无动画效果 diff --git a/docs/apis/ui/pull-down-refresh/stopPullDownRefresh.md b/docs/apis/ui/pull-down-refresh/stopPullDownRefresh.md index e07a418f059e..8033ac95afbf 100644 --- a/docs/apis/ui/pull-down-refresh/stopPullDownRefresh.md +++ b/docs/apis/ui/pull-down-refresh/stopPullDownRefresh.md @@ -5,7 +5,7 @@ sidebar_label: stopPullDownRefresh 停止当前页面下拉刷新。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/pull-down-refresh/wx.stopPullDownRefresh.html) diff --git a/docs/apis/ui/scroll/pageScrollTo.md b/docs/apis/ui/scroll/pageScrollTo.md index 2a2d867bd8bd..dad4a38327ca 100644 --- a/docs/apis/ui/scroll/pageScrollTo.md +++ b/docs/apis/ui/scroll/pageScrollTo.md @@ -15,7 +15,7 @@ selector类似于 CSS 的选择器,但仅支持下列语法。 - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant - 多选择器的并集:#a-node, .some-other-nodes -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/wx.pageScrollTo.html) diff --git a/docs/apis/ui/tab-bar/hideTabBar.md b/docs/apis/ui/tab-bar/hideTabBar.md index c4458ca65f1f..082adce21453 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 2c3da47bc628..6808c96d0b48 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 d2b2a511a5ec..c53a609bedbe 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 42e6a987897d..7657d46f1a20 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 220a6fe129f1..f6468184a7d2 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 924986a4e527..471a9d0ab7a6 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 508dcd472fbb..c557074d71f3 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/apis/wxml/IntersectionObserver.md b/docs/apis/wxml/IntersectionObserver.md index 18da2ff9af4b..42f750190b1f 100644 --- a/docs/apis/wxml/IntersectionObserver.md +++ b/docs/apis/wxml/IntersectionObserver.md @@ -102,13 +102,14 @@ Taro.createIntersectionObserver().relativeToViewport({bottom: 100}).observe('.ta ### ObserveCallbackResult -| 参数 | 类型 | 说明 | -| --- | --- | --- | -| boundingClientRect | `BoundingClientRectResult` | 目标边界 | -| intersectionRatio | `number` | 相交比例 | -| intersectionRect | `IntersectionRectResult` | 相交区域的边界 | -| relativeRect | `RelativeRectResult` | 参照区域的边界 | -| time | `number` | 相交检测时的时间戳 | +| 参数 | 类型 | 必填 | 说明 | +| --- | --- | :---: | --- | +| errMsg | `string` | 否 | 错误信息,会在找不到对应元素时返回
API 支持度: harmony | +| boundingClientRect | `BoundingClientRectResult` | 否 | 目标边界 | +| intersectionRatio | `number` | 否 | 相交比例 | +| intersectionRect | `IntersectionRectResult` | 否 | 相交区域的边界 | +| relativeRect | `RelativeRectResult` | 否 | 参照区域的边界 | +| time | `number` | 否 | 相交检测时的时间戳 | ### RelativeRectResult diff --git a/docs/apis/wxml/createIntersectionObserver.md b/docs/apis/wxml/createIntersectionObserver.md index fa34f33cacdd..e16f0340c81e 100644 --- a/docs/apis/wxml/createIntersectionObserver.md +++ b/docs/apis/wxml/createIntersectionObserver.md @@ -5,7 +5,7 @@ sidebar_label: createIntersectionObserver 创建并返回一个 IntersectionObserver 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createIntersectionObserver([options])` 来代替。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createIntersectionObserver.html) diff --git a/docs/apis/wxml/createSelectorQuery.md b/docs/apis/wxml/createSelectorQuery.md index 10d8e9e143d9..78a7fac475af 100644 --- a/docs/apis/wxml/createSelectorQuery.md +++ b/docs/apis/wxml/createSelectorQuery.md @@ -5,7 +5,7 @@ sidebar_label: createSelectorQuery 返回一个 SelectorQuery 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createSelectorQuery()` 来代替。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createSelectorQuery.html) diff --git a/docs/components/base/icon.md b/docs/components/base/icon.md index 2aca96db67e2..8463df78f331 100755 --- a/docs/components/base/icon.md +++ b/docs/components/base/icon.md @@ -77,7 +77,7 @@ export default class PageView extends Component { | 参数 | 类型 | 默认值 | 必填 | 说明 | | --- | --- | :---: | :---: | --- | | type | `keyof TIconType` | | 是 | icon 的类型 | -| size | `string` | `23` | 否 | icon 的大小,单位px | +| size | `number` | `23` | 否 | icon 的大小,单位px | | color | `string` | | 否 | icon 的颜色,同 css 的 color | | ariaLabel | `string` | | 否 | 无障碍访问,(属性)元素的额外描述 | @@ -85,9 +85,9 @@ export default class PageView extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| IconProps.type | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| IconProps.type | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | IconProps.size | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| IconProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| IconProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | IconProps.ariaLabel | | | | | ✔️ | | | | | | ### TIconType diff --git a/docs/components/base/progress.md b/docs/components/base/progress.md index 5c3a46eecd3a..6d3f87724c46 100755 --- a/docs/components/base/progress.md +++ b/docs/components/base/progress.md @@ -5,7 +5,7 @@ sidebar_label: Progress 进度条。组件属性的长度单位默认为 px -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/progress.html) diff --git a/docs/components/base/text.md b/docs/components/base/text.md index bdeaa7959323..605ba7af0f7a 100755 --- a/docs/components/base/text.md +++ b/docs/components/base/text.md @@ -5,7 +5,7 @@ sidebar_label: Text 文本 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/text.html) @@ -132,7 +132,7 @@ export default { | TextProps.decode | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | (默认解码,不支持设置) | | | | | TextProps.numberOfLines | | | ✔️ | | | | | | | | | TextProps.overflow | | | | | | | | | | | -| TextProps.maxLines | ✔️ | | | | | | | | | | +| TextProps.maxLines | ✔️ | | | | | | | | ✔️ | | ### TSpace diff --git a/docs/components/forms/button.md b/docs/components/forms/button.md index c70f2b41d4a1..bbd6f28553c5 100755 --- a/docs/components/forms/button.md +++ b/docs/components/forms/button.md @@ -242,11 +242,11 @@ export default { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | ButtonProps.size | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| ButtonProps.type | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| ButtonProps.plain | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| ButtonProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| ButtonProps.loading | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| ButtonProps.formType | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | +| ButtonProps.type | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| ButtonProps.plain | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| ButtonProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| ButtonProps.loading | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| ButtonProps.formType | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | | | ButtonProps.openType | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | | ButtonProps.hoverClass | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(支持 hoverStyle 属性,但框架未支持 hoverClass) | | ✔️ | | ButtonProps.hoverStyle | | | | | | | | ✔️ | | | diff --git a/docs/components/forms/checkbox.md b/docs/components/forms/checkbox.md index 4a525b4d334b..89dd3852b499 100755 --- a/docs/components/forms/checkbox.md +++ b/docs/components/forms/checkbox.md @@ -166,11 +166,11 @@ export default { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| CheckboxProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| CheckboxProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| CheckboxProps.checked | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| CheckboxProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| CheckboxProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| CheckboxProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| CheckboxProps.checked | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| CheckboxProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | CheckboxProps.name | | | | | | | ✔️ | | ✔️ | ✔️ | | CheckboxProps.nativeProps | | | | | | | ✔️ | | | ✔️ | | CheckboxProps.ariaLabel | | | | | ✔️ | | | | | | -| CheckboxProps.onChange | | | ✔️ | | | | ✔️ | ✔️ | | ✔️ | +| CheckboxProps.onChange | | | ✔️ | | | | ✔️ | ✔️ | ✔️ | ✔️ | diff --git a/docs/components/forms/form.md b/docs/components/forms/form.md index f6ee840fda65..dedf4d076298 100755 --- a/docs/components/forms/form.md +++ b/docs/components/forms/form.md @@ -111,8 +111,8 @@ export default { | FormProps.subscribeId | | ✔️ | | | | | | | | | | FormProps.conversionTarget | | | | ✔️ | | | | | | | | FormProps.clueComponentId | | | | ✔️ | | | | | | | -| FormProps.onSubmit | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| FormProps.onReset | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| FormProps.onSubmit | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| FormProps.onReset | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ### onSubmitEventDetail diff --git a/docs/components/forms/input.md b/docs/components/forms/input.md index 435d2da11a79..1977aef19148 100755 --- a/docs/components/forms/input.md +++ b/docs/components/forms/input.md @@ -125,25 +125,25 @@ class App extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| InputProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| InputProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | InputProps.defaultValue | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.type | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.password | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.placeholder | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.placeholderStyle | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | +| InputProps.type | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| InputProps.password | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| InputProps.placeholder | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| InputProps.placeholderStyle | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | | InputProps.placeholderClass | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | -| InputProps.placeholderTextColor | | | | | | | | ✔️ | | | +| InputProps.placeholderTextColor | | | | | | | | ✔️ | ✔️ | | | InputProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.maxlength | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| InputProps.maxlength | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | InputProps.cursorSpacing | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | | | | InputProps.autoFocus | ✔️ | | | | ✔️ | ✔️ | ✔️ | | | ✔️ | | InputProps.focus | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.confirmType | ✔️ | ✔️ | ✔️(confirm-type 与 enableNative 属性冲突,若希望 confirm-type 生效,enableNative 不能设定为 false,而且不能设定 always-system) | ✔️ | ✔️ | ✔️ | | ✔️ | | | +| InputProps.confirmType | ✔️ | ✔️ | ✔️(confirm-type 与 enableNative 属性冲突,若希望 confirm-type 生效,enableNative 不能设定为 false,而且不能设定 always-system) | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | | InputProps.confirmHold | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | -| InputProps.cursor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | +| InputProps.cursor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | | InputProps.selectionStart | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | | InputProps.selectionEnd | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| InputProps.adjustPosition | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | | | +| InputProps.adjustPosition | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | ✔️ | | | InputProps.holdKeyboard | ✔️ | | | ✔️ | | | | | | | | InputProps.alwaysEmbed | ✔️ | | | | | | | | | | | InputProps.safePasswordCertPath | ✔️ | | | | | | | | | | @@ -159,11 +159,11 @@ class App extends Component { | InputProps.alwaysSystem | | | ✔️ | | | | | | | | | InputProps.ariaLabel | | | | | ✔️ | | | | | | | InputProps.clueType | | | | ✔️ | | | | | | | -| InputProps.onInput | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.onFocus | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.onBlur | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.onConfirm | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| InputProps.onKeyboardHeightChange | ✔️ | | | ✔️ | ✔️ | | | | | | +| InputProps.onInput | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| InputProps.onFocus | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| InputProps.onBlur | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| InputProps.onConfirm | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| InputProps.onKeyboardHeightChange | ✔️ | | | ✔️ | ✔️ | | | | ✔️ | | | InputProps.onNickNameReview | ✔️ | | | | | | | | | | ### Type diff --git a/docs/components/forms/label.md b/docs/components/forms/label.md index 12cb47d95d7b..6ee6f01a40f7 100755 --- a/docs/components/forms/label.md +++ b/docs/components/forms/label.md @@ -77,4 +77,4 @@ class App extends Components { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| LabelProps.for | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| LabelProps.for | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | diff --git a/docs/components/forms/picker-view-column.md b/docs/components/forms/picker-view-column.md index 22f5a47cd8f5..db4f157f4b18 100644 --- a/docs/components/forms/picker-view-column.md +++ b/docs/components/forms/picker-view-column.md @@ -6,7 +6,7 @@ sidebar_label: PickerViewColumn 滚动选择器子项 仅可放置于 `` 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html) diff --git a/docs/components/forms/picker-view.md b/docs/components/forms/picker-view.md index 2351b3e29472..2eaa66035298 100755 --- a/docs/components/forms/picker-view.md +++ b/docs/components/forms/picker-view.md @@ -6,7 +6,7 @@ sidebar_label: PickerView 嵌入页面的滚动选择器 其中只可放置 picker-view-column 组件,其它节点不会显示 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker-view.html) diff --git a/docs/components/forms/picker.md b/docs/components/forms/picker.md index c58f395b0ea0..237e27bc8a02 100755 --- a/docs/components/forms/picker.md +++ b/docs/components/forms/picker.md @@ -176,9 +176,9 @@ export default class PagePicker extends Component { | API | 微信小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | | PickerStandardProps.headerText | ✔️ | | | | | -| PickerStandardProps.mode | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerStandardProps.mode | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | PickerStandardProps.disabled | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerStandardProps.onCancel | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerStandardProps.onCancel | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ### Mode @@ -219,14 +219,14 @@ export default class PagePicker extends Component { | API | 微信小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | -| PickerSelectorProps.range | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerSelectorProps.rangeKey | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerSelectorProps.value | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerSelectorProps.range | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerSelectorProps.rangeKey | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerSelectorProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | PickerSelectorProps.defaultValue | ✔️ | ✔️ | ✔️ | | ✔️ | | PickerSelectorProps.itemStyle | | | ✔️ | | | | PickerSelectorProps.indicatorStyle | | | ✔️ | | | -| PickerSelectorProps.onChange | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerSelectorProps.textProps | | ✔️ | | | ✔️ | +| PickerSelectorProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerSelectorProps.textProps | | ✔️ | | ✔️ | ✔️ | ### ChangeEventDetail @@ -253,13 +253,13 @@ export default class PagePicker extends Component { | API | 微信小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | -| PickerMultiSelectorProps.range | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerMultiSelectorProps.rangeKey | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerMultiSelectorProps.value | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerMultiSelectorProps.range | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerMultiSelectorProps.rangeKey | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerMultiSelectorProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | PickerMultiSelectorProps.itemStyle | | | ✔️ | | | | PickerMultiSelectorProps.indicatorStyle | | | ✔️ | | | -| PickerMultiSelectorProps.onChange | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerMultiSelectorProps.onColumnChange | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerMultiSelectorProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerMultiSelectorProps.onColumnChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ### ChangeEventDetail @@ -291,11 +291,11 @@ export default class PagePicker extends Component { | API | 微信小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | -| PickerTimeProps.value | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerTimeProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | PickerTimeProps.defaultValue | ✔️ | ✔️ | ✔️ | | | -| PickerTimeProps.start | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerTimeProps.end | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerTimeProps.onChange | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerTimeProps.start | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerTimeProps.end | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerTimeProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ### ChangeEventDetail @@ -321,12 +321,12 @@ export default class PagePicker extends Component { | API | 微信小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | -| PickerDateProps.value | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerDateProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | PickerDateProps.defaultValue | ✔️ | ✔️ | ✔️ | | | -| PickerDateProps.start | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerDateProps.end | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerDateProps.start | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| PickerDateProps.end | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | PickerDateProps.fields | ✔️ | ✔️ | ✔️ | | ✔️ | -| PickerDateProps.onChange | ✔️ | ✔️ | ✔️ | | ✔️ | +| PickerDateProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ### Fields diff --git a/docs/components/forms/radio-group.md b/docs/components/forms/radio-group.md index 53f012488896..ad608f1cf09e 100644 --- a/docs/components/forms/radio-group.md +++ b/docs/components/forms/radio-group.md @@ -26,7 +26,7 @@ ComponentType | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| RadioGroupProps.name | | | ✔️ | ✔️ | | | | | | | +| RadioGroupProps.name | | | ✔️ | ✔️ | | | | | ✔️ | | | RadioGroupProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | ### onChangeEventDetail diff --git a/docs/components/forms/radio.md b/docs/components/forms/radio.md index 867a478c85a5..2512f1df9831 100755 --- a/docs/components/forms/radio.md +++ b/docs/components/forms/radio.md @@ -185,11 +185,11 @@ export default { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| RadioProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| RadioProps.checked | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| RadioProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| RadioProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | +| RadioProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| RadioProps.checked | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| RadioProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| RadioProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | | RadioProps.name | | | | | | | ✔️ | | ✔️ | ✔️ | | RadioProps.nativeProps | | | | | | | ✔️ | | | ✔️ | | RadioProps.ariaLabel | | | | | ✔️ | | | | | | -| RadioProps.onChange | | | | | | | ✔️ | ✔️ | | ✔️ | +| RadioProps.onChange | | | | | | | ✔️ | ✔️ | ✔️ | ✔️ | diff --git a/docs/components/forms/slider.md b/docs/components/forms/slider.md index 563a89a4144c..2273f3fe8d41 100755 --- a/docs/components/forms/slider.md +++ b/docs/components/forms/slider.md @@ -93,25 +93,25 @@ export default class PageView extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| SliderProps.min | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.max | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.step | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SliderProps.min | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.max | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.step | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SliderProps.defaultValue | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.color | ✔️ | | | ✔️ | ✔️ | ✔️ | | | | | -| SliderProps.selectedColor | ✔️ | | | ✔️ | ✔️ | ✔️ | | | | | -| SliderProps.activeColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.backgroundColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.blockSize | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | -| SliderProps.blockColor | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.showValue | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SliderProps.color | ✔️ | | | ✔️ | ✔️ | ✔️ | | | ✔️ | | +| SliderProps.selectedColor | ✔️ | | | ✔️ | ✔️ | ✔️ | | | ✔️ | | +| SliderProps.activeColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.backgroundColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.blockSize | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | +| SliderProps.blockColor | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.showValue | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SliderProps.name | | | ✔️ | | | | | | | | | SliderProps.trackSize | | | ✔️ | | | | | | | | | SliderProps.handleSize | | | ✔️ | | | | | | | | | SliderProps.handleColor | | | ✔️ | | | | | | | | | SliderProps.ariaLabel | | | | | ✔️ | | | | | | -| SliderProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SliderProps.onChanging | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SliderProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SliderProps.onChanging | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ### onChangeEventDetail diff --git a/docs/components/forms/switch.md b/docs/components/forms/switch.md index e2c92947017d..18863b5f7e89 100755 --- a/docs/components/forms/switch.md +++ b/docs/components/forms/switch.md @@ -83,16 +83,16 @@ export default class PageView extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| SwitchProps.checked | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwitchProps.checked | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SwitchProps.defaultChecked | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwitchProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | ✔️ | -| SwitchProps.type | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwitchProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwitchProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | +| SwitchProps.type | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwitchProps.color | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SwitchProps.nativeProps | | | | | | | ✔️ | | | ✔️ | | SwitchProps.name | | | ✔️ | | | | | | | | | SwitchProps.controlled | | | ✔️ | | | | | | | | | SwitchProps.ariaLabel | | | | | ✔️ | | | | | | -| SwitchProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwitchProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ### onChangeEventDetail diff --git a/docs/components/forms/textarea.md b/docs/components/forms/textarea.md index e080e2a4b7a7..bc503de22fb0 100755 --- a/docs/components/forms/textarea.md +++ b/docs/components/forms/textarea.md @@ -102,10 +102,10 @@ export default class PageView extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| TextareaProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| TextareaProps.value | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | TextareaProps.defaultValue | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| TextareaProps.placeholder | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| TextareaProps.placeholderStyle | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | +| TextareaProps.placeholder | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| TextareaProps.placeholderStyle | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | | | TextareaProps.placeholderClass | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | | TextareaProps.disabled | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | TextareaProps.maxlength | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | @@ -129,12 +129,12 @@ export default class PageView extends Component { | TextareaProps.controlled | | | ✔️ | | | | | | | | | TextareaProps.ariaLabel | | | | | ✔️ | | | | | | | TextareaProps.adjustKeyboardTo | ✔️ | | | | | | | | | | -| TextareaProps.onFocus | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| TextareaProps.onBlur | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| TextareaProps.onFocus | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| TextareaProps.onBlur | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | TextareaProps.onLineChange | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | ✔️ | | | -| TextareaProps.onInput | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| TextareaProps.onInput | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | TextareaProps.onConfirm | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| TextareaProps.onKeyboardHeightChange | ✔️ | | | ✔️ | | | | | | | +| TextareaProps.onKeyboardHeightChange | ✔️ | | | ✔️ | | | | | ✔️ | | ### onFocusEventDetail diff --git a/docs/components/media/camera.md b/docs/components/media/camera.md index b38d2cbe6ac7..0f6dd3f94728 100755 --- a/docs/components/media/camera.md +++ b/docs/components/media/camera.md @@ -5,7 +5,7 @@ sidebar_label: Camera 系统相机 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html) diff --git a/docs/components/media/image.md b/docs/components/media/image.md index b3295f6d0154..228596bb55a0 100755 --- a/docs/components/media/image.md +++ b/docs/components/media/image.md @@ -97,8 +97,8 @@ export default class PageView extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| ImageProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| ImageProps.mode | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(部分支持 scaleToFill, aspectFit, aspectFill, widthFix) | | ✔️ | +| ImageProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| ImageProps.mode | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(部分支持 scaleToFill, aspectFit, aspectFill, widthFix) | ✔️(部分支持 scaleToFill, aspectFit, aspectFill, widthFix, heightFix) | ✔️ | | ImageProps.webp | ✔️ | ✔️ | | | | | | | | | | ImageProps.svg | | | | | | | | ✔️ | | | | ImageProps.lazyLoad | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | ✔️ | diff --git a/docs/components/media/video.md b/docs/components/media/video.md index 18eb5077e7ac..b872c2ae4bcc 100755 --- a/docs/components/media/video.md +++ b/docs/components/media/video.md @@ -177,15 +177,15 @@ export default class PageView extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| VideoProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.duration | ✔️ | | ✔️ | | ✔️ | | ✔️ | ✔️ | | ✔️ | -| VideoProps.controls | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| VideoProps.src | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.duration | ✔️ | | ✔️ | | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.controls | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | VideoProps.danmuList | ✔️ | ✔️ | | | ✔️ | | ✔️ | | | ✔️ | | VideoProps.danmuBtn | ✔️ | ✔️ | | | ✔️ | | ✔️ | | | ✔️ | | VideoProps.enableDanmu | ✔️ | ✔️ | | | ✔️ | | ✔️ | | | ✔️ | -| VideoProps.autoplay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.loop | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.muted | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| VideoProps.autoplay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.loop | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.muted | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | VideoProps.initialTime | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | VideoProps.pageGesture | ✔️ | ✔️ | | | ✔️ | | | | | | | VideoProps.direction | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | | | | @@ -194,7 +194,7 @@ export default class PageView extends Component { | VideoProps.showPlayBtn | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | ✔️ | | VideoProps.showCenterPlayBtn | ✔️ | ✔️ | ✔️ | | ✔️ | | ✔️ | ✔️ | | ✔️ | | VideoProps.enableProgressGesture | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | ✔️ | -| VideoProps.objectFit | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| VideoProps.objectFit | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | VideoProps.poster | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | VideoProps.showMuteBtn | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | | ✔️ | | VideoProps.title | ✔️ | ✔️ | | | ✔️ | | | | | | @@ -238,15 +238,15 @@ export default class PageView extends Component { | VideoProps.preferredPeakBitRate | ✔️ | | | | | | | | | | | VideoProps.isLive | ✔️ | | | | | | | | | | | VideoProps.definition | | | | ✔️ | | | | | | | -| VideoProps.onPlay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.onPause | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.onEnded | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.onTimeUpdate | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.onFullscreenChange | | | ✔️ | | | | ✔️ | ✔️ | | ✔️ | +| VideoProps.onPlay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.onPause | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.onEnded | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.onTimeUpdate | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| VideoProps.onFullscreenChange | | | ✔️ | | | | ✔️ | ✔️ | ✔️ | ✔️ | | VideoProps.onWaiting | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | | | | | | VideoProps.onError | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| VideoProps.onProgress | ✔️ | | | ✔️ | ✔️ | | ✔️ | | | ✔️ | -| VideoProps.onLoadedMetaData | ✔️ | ✔️ | | ✔️ | | ✔️ | | ✔️ | | | +| VideoProps.onProgress | ✔️ | | | ✔️ | ✔️ | | ✔️ | | ✔️ | ✔️ | +| VideoProps.onLoadedMetaData | ✔️ | ✔️ | | ✔️ | | ✔️ | | ✔️ | ✔️ | | | VideoProps.onEnterPictureInPicture | ✔️ | | | | | | | | | | | VideoProps.onLeavePictureInPicture | ✔️ | | | | | | | | | | | VideoProps.onSeekComplete | ✔️ | | | ✔️ | | | | | | | @@ -269,8 +269,8 @@ export default class PageView extends Component { | VideoProps.onLeaveBackground | | | | ✔️ | | | | | | | | VideoProps.onLoadedData | | | | | | ✔️ | | | | | | VideoProps.onLoadStart | | | | | | ✔️ | | | | | -| VideoProps.onSeeked | | | | | | ✔️ | | | | | -| VideoProps.onSeeking | | | | | | ✔️ | | | | | +| VideoProps.onSeeked | | | | | | ✔️ | | | ✔️ | | +| VideoProps.onSeeking | | | | | | ✔️ | | | ✔️ | | | VideoProps.onAdLoad | | | | ✔️ | | | | | | | | VideoProps.onCastingUserSelect | ✔️ | | | | | | | | | | | VideoProps.onCastingStateChange | ✔️ | | | | | | | | | | diff --git a/docs/components/navig/navigation-bar.md b/docs/components/navig/navigation-bar.md index 2f4dd6a82810..f203cc905b69 100644 --- a/docs/components/navig/navigation-bar.md +++ b/docs/components/navig/navigation-bar.md @@ -36,9 +36,9 @@ ComponentType | API | 微信小程序 | H5 | React Native | Harmony | | :---: | :---: | :---: | :---: | :---: | -| NavigationBarProps.title | ✔️ | | | | -| NavigationBarProps.loading | ✔️ | | | | -| NavigationBarProps.frontColor | ✔️ | | | | -| NavigationBarProps.backgroundColor | ✔️ | | | | +| NavigationBarProps.title | ✔️ | | | ✔️ | +| NavigationBarProps.loading | ✔️ | | | ✔️ | +| NavigationBarProps.frontColor | ✔️ | | | ✔️ | +| NavigationBarProps.backgroundColor | ✔️ | | | ✔️ | | NavigationBarProps.colorAnimationDuration | ✔️ | | | | | NavigationBarProps.colorAnimationTimingFunc | ✔️ | | | | diff --git a/docs/components/navig/navigator.md b/docs/components/navig/navigator.md index 067d31853ff2..eaed65c66531 100755 --- a/docs/components/navig/navigator.md +++ b/docs/components/navig/navigator.md @@ -5,7 +5,7 @@ sidebar_label: Navigator 页面链接 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html) diff --git a/docs/components/page-meta.md b/docs/components/page-meta.md index 7a6732593785..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) @@ -94,14 +94,14 @@ function Index () { | API | 微信小程序 | 支付宝小程序 | H5 | React Native | Harmony | | :---: | :---: | :---: | :---: | :---: | :---: | | PageMetaProps.backgroundTextStyle | ✔️ | | | | | -| PageMetaProps.backgroundColor | ✔️ | ✔️ | | | | -| PageMetaProps.backgroundColorTop | ✔️ | ✔️ | | | | -| PageMetaProps.backgroundColorBottom | ✔️ | ✔️ | | | | -| PageMetaProps.scrollTop | ✔️ | ✔️ | | | | -| PageMetaProps.scrollDuration | ✔️ | ✔️ | | | | +| PageMetaProps.backgroundColor | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.backgroundColorTop | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.backgroundColorBottom | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.scrollTop | ✔️ | ✔️ | | | ✔️ | +| PageMetaProps.scrollDuration | ✔️ | ✔️ | | | ✔️ | | PageMetaProps.pageStyle | ✔️ | ✔️ | | | | | PageMetaProps.rootFontSize | ✔️ | ✔️ | | | | -| PageMetaProps.rootBackgroundColor | ✔️ | ✔️ | | | | +| PageMetaProps.rootBackgroundColor | ✔️ | ✔️ | | | ✔️ | | PageMetaProps.pageFontSize | ✔️ | ✔️ | | | | | PageMetaProps.pageOrientation | ✔️ | | | | | | PageMetaProps.onResize | ✔️ | | | | | diff --git a/docs/components/skyline/list-view.md b/docs/components/skyline/list-view.md index 0f724dae8a3e..0901161fc57a 100644 --- a/docs/components/skyline/list-view.md +++ b/docs/components/skyline/list-view.md @@ -5,7 +5,7 @@ sidebar_label: ListView 列表布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/list-view.html) diff --git a/docs/components/skyline/sticky-header.md b/docs/components/skyline/sticky-header.md index 352ae5ef161e..5ff655e580b7 100644 --- a/docs/components/skyline/sticky-header.md +++ b/docs/components/skyline/sticky-header.md @@ -5,7 +5,7 @@ sidebar_label: StickyHeader 吸顶布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/sticky-header.html) diff --git a/docs/components/skyline/sticky-section.md b/docs/components/skyline/sticky-section.md index e516acbd2012..1875c7a54019 100644 --- a/docs/components/skyline/sticky-section.md +++ b/docs/components/skyline/sticky-section.md @@ -5,7 +5,7 @@ sidebar_label: StickySection 吸顶布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点。仅 Skyline 支持。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/sticky-section.html) diff --git a/docs/components/viewContainer/cover-image.md b/docs/components/viewContainer/cover-image.md index 58afbc97f4e6..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) diff --git a/docs/components/viewContainer/scroll-view.md b/docs/components/viewContainer/scroll-view.md index cf23ddbec1ba..0a31adc1b574 100755 --- a/docs/components/viewContainer/scroll-view.md +++ b/docs/components/viewContainer/scroll-view.md @@ -246,8 +246,8 @@ typeof ScrollViewProps | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| ScrollViewProps.scrollX | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | | ✔️ | -| ScrollViewProps.scrollY | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | | ✔️ | +| ScrollViewProps.scrollX | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | ✔️ | ✔️ | +| ScrollViewProps.scrollY | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️(二选一) | ✔️ | ✔️ | | ScrollViewProps.upperThreshold | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | ScrollViewProps.lowerThreshold | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | ScrollViewProps.scrollTop | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | @@ -265,7 +265,7 @@ typeof ScrollViewProps | ScrollViewProps.enhanced | ✔️ | ✔️ | | | | | | | | | | ScrollViewProps.usingSticky | ✔️ | | | | | | | | | | | ScrollViewProps.bounces | ✔️ | ✔️ | | | | | | | | | -| ScrollViewProps.showScrollbar | ✔️ | | | | | | | | | | +| ScrollViewProps.showScrollbar | ✔️ | | | | | | | | ✔️ | | | ScrollViewProps.pagingEnabled | ✔️ | | | | | | | | | | | ScrollViewProps.fastDeceleration | ✔️ | | | | | | | | | | | ScrollViewProps.scrollAnimationDuration | | | ✔️ | | | | | | | | @@ -274,7 +274,7 @@ typeof ScrollViewProps | ScrollViewProps.disableUpperScroll | | | ✔️ | | | | | | | | | ScrollViewProps.ariaLabel | | | | | ✔️ | | | | | | | ScrollViewProps.enablePassive | ✔️ | | | | | | | | | | -| ScrollViewProps.type | ✔️ | | | | | | | | | | +| ScrollViewProps.type | ✔️ | | | | | | | | ✔️ | | | ScrollViewProps.reverse | ✔️ | | | | | | | | | | | ScrollViewProps.clip | ✔️ | | | | | | | | | | | ScrollViewProps.cacheExtent | ✔️ | | | | | | | | | | @@ -291,7 +291,7 @@ typeof ScrollViewProps | ScrollViewProps.refresherTwoLevelPinned | ✔️ | | | | | | | | | | | ScrollViewProps.onScrollToUpper | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | ScrollViewProps.onScrollToLower | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| ScrollViewProps.onScroll | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ScrollViewProps.onScroll | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ScrollViewProps.onScrollStart | ✔️ | | | | | | | | | | | ScrollViewProps.onScrollEnd | ✔️ | | | | | | | | | | | ScrollViewProps.onRefresherPulling | ✔️ | | | | | | | | | | diff --git a/docs/components/viewContainer/slot.md b/docs/components/viewContainer/slot.md index dcc8de7292e1..9b43404f2a2f 100644 --- a/docs/components/viewContainer/slot.md +++ b/docs/components/viewContainer/slot.md @@ -5,7 +5,7 @@ sidebar_label: Slot slot 插槽 -支持情况: +支持情况: ## 类型 diff --git a/docs/components/viewContainer/swiper-item.md b/docs/components/viewContainer/swiper-item.md index 34e2745654fd..ccc584415f78 100644 --- a/docs/components/viewContainer/swiper-item.md +++ b/docs/components/viewContainer/swiper-item.md @@ -94,6 +94,6 @@ class App extends Component { | API | 微信小程序 | 百度小程序 | 抖音小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| SwiperItemProps.itemId | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwiperItemProps.itemId | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SwiperItemProps.skipHiddenItemLayout | ✔️ | | | | | | | | | SwiperItemProps.deep | | | | | ✔️ | | | | diff --git a/docs/components/viewContainer/swiper.md b/docs/components/viewContainer/swiper.md index 47f27044fd83..81e6e3e35223 100755 --- a/docs/components/viewContainer/swiper.md +++ b/docs/components/viewContainer/swiper.md @@ -126,16 +126,16 @@ class App extends Component { | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| SwiperProps.indicatorDots | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwiperProps.indicatorColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwiperProps.indicatorActiveColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwiperProps.autoplay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwiperProps.current | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwiperProps.indicatorDots | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.indicatorColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.indicatorActiveColor | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.autoplay | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.current | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SwiperProps.currentItemId | (deprecated) | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | -| SwiperProps.interval | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwiperProps.duration | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | +| SwiperProps.interval | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | +| SwiperProps.duration | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | ✔️ | | SwiperProps.circular | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | -| SwiperProps.vertical | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwiperProps.vertical | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SwiperProps.previousMargin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | | SwiperProps.nextMargin | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | ✔️ | | SwiperProps.snapToEdge | ✔️ | | ✔️ | | | | | | | | @@ -157,7 +157,7 @@ class App extends Component { | SwiperProps.disableTouchmove | | ✔️ | | | | | | | | | | SwiperProps.scrollWithAnimation | ✔️ | | | | | | | | | | | SwiperProps.cacheExtent | ✔️ | | | | | | | | | | -| SwiperProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| SwiperProps.onChange | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | SwiperProps.onTransition | ✔️ | | ✔️ | ✔️ | ✔️ | | | | | | | SwiperProps.onAnimationFinish | ✔️ | ✔️ | | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | | SwiperProps.onAnimationEnd | | | ✔️ | | | | | | | | diff --git a/packages/taro-components/types/Button.d.ts b/packages/taro-components/types/Button.d.ts index 022bd9127252..eda7e182ac28 100644 --- a/packages/taro-components/types/Button.d.ts +++ b/packages/taro-components/types/Button.d.ts @@ -8,27 +8,27 @@ interface ButtonProps extends StandardProps { */ size?: keyof ButtonProps.Size /** 按钮的样式类型 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @default default */ type?: keyof ButtonProps.Type /** 按钮是否镂空,背景色透明 - * @supported weapp, alipay, swan, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, qq, jd, h5, rn, harmony, harmony_hybrid * @default false */ plain?: boolean /** 是否禁用 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @default false */ disabled?: boolean /** 名称前是否带 loading 图标 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @default false */ loading?: boolean /** 用于 `
` 组件,点击分别会触发 `` 组件的 submit/reset 事件 - * @supported weapp, alipay, swan, tt, qq, jd + * @supported weapp, alipay, swan, tt, qq, jd, harmony */ formType?: keyof ButtonProps.FormType /** 微信开放能力 diff --git a/packages/taro-components/types/Camera.d.ts b/packages/taro-components/types/Camera.d.ts index 0b0207e271e3..8c82f7ba4080 100644 --- a/packages/taro-components/types/Camera.d.ts +++ b/packages/taro-components/types/Camera.d.ts @@ -121,7 +121,7 @@ declare namespace CameraProps { } /** 系统相机 * @classification media - * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony + * @supported weapp, alipay, swan, tt, qq, jd, rn * @see https://developers.weixin.qq.com/miniprogram/dev/component/camera.html */ declare const Camera: ComponentType diff --git a/packages/taro-components/types/Checkbox.d.ts b/packages/taro-components/types/Checkbox.d.ts index 172e3cef0943..ea468c9e5a67 100644 --- a/packages/taro-components/types/Checkbox.d.ts +++ b/packages/taro-components/types/Checkbox.d.ts @@ -2,21 +2,21 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface CheckboxProps extends StandardProps { /** ``标识,选中时触发``的 change 事件,并携带 `` 的 value - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ value: string /** 是否禁用 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @default false */ disabled?: boolean /** 当前是否选中,可用来设置默认选中 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @default false */ checked?: boolean /** checkbox的颜色,同 css 的 color - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ color?: string /** @@ -33,7 +33,7 @@ interface CheckboxProps extends StandardProps { */ ariaLabel?: string /** 选中项发生变化时触发 change 事件,小程序无此 API - * @supported alipay, h5, rn, harmony_hybrid + * @supported alipay, h5, rn, harmony, harmony_hybrid */ onChange?: CommonEventFunction<{ value: string[] diff --git a/packages/taro-components/types/CoverImage.d.ts b/packages/taro-components/types/CoverImage.d.ts index f4e6b43d15b9..e1cc2a628991 100644 --- a/packages/taro-components/types/CoverImage.d.ts +++ b/packages/taro-components/types/CoverImage.d.ts @@ -48,7 +48,7 @@ interface CoverImageProps extends StandardProps { } /** 覆盖在原生组件之上的图片视图。可覆盖的原生组件同cover-view,支持嵌套在cover-view里。 * @classification viewContainer - * @supported weapp, alipay, swan, qq, jd, h5, harmony, harmony_hybrid + * @supported weapp, alipay, swan, qq, jd, h5, harmony_hybrid * @example_react * ```tsx * // js diff --git a/packages/taro-components/types/Form.d.ts b/packages/taro-components/types/Form.d.ts index 7b612900944b..2539ee20a554 100644 --- a/packages/taro-components/types/Form.d.ts +++ b/packages/taro-components/types/Form.d.ts @@ -43,11 +43,11 @@ interface FormProps extends StandardProps { */ clueComponentId?: string /** 携带 form 中的数据触发 submit 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onSubmit?: CommonEventFunction /** 表单重置时会触发 reset 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onReset?: CommonEventFunction } diff --git a/packages/taro-components/types/Icon.d.ts b/packages/taro-components/types/Icon.d.ts index 54cbed3cc001..7ff5d5d19317 100644 --- a/packages/taro-components/types/Icon.d.ts +++ b/packages/taro-components/types/Icon.d.ts @@ -2,16 +2,16 @@ import { ComponentType } from 'react' import { StandardProps } from './common' interface IconProps extends StandardProps { /** icon 的类型 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ type: keyof IconProps.TIconType /** icon 的大小,单位px * @default 23 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid */ - size?: string + size?: number /** icon 的颜色,同 css 的 color - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ color?: string /** 无障碍访问,(属性)元素的额外描述 diff --git a/packages/taro-components/types/Image.d.ts b/packages/taro-components/types/Image.d.ts index 971cfbf07071..f0cc0fafe5c2 100644 --- a/packages/taro-components/types/Image.d.ts +++ b/packages/taro-components/types/Image.d.ts @@ -2,13 +2,14 @@ import { ComponentType, ImgHTMLAttributes } from 'react' import { StandardProps, CommonEventFunction } from './common' interface ImageProps extends StandardProps { /** 图片资源地址 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ src: string /** 图片裁剪、缩放的模式 * @default "scaleToFill" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @rn 部分支持 scaleToFill, aspectFit, aspectFill, widthFix + * @harmony 部分支持 scaleToFill, aspectFit, aspectFill, widthFix, heightFix */ mode?: keyof ImageProps.Mode /** 默认不解析 webP 格式,只支持网络资源 diff --git a/packages/taro-components/types/Input.d.ts b/packages/taro-components/types/Input.d.ts index 375c9a59d50a..69efb7ad8692 100644 --- a/packages/taro-components/types/Input.d.ts +++ b/packages/taro-components/types/Input.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface InputProps extends StandardProps, FormItemProps { /** 输入框的初始内容 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ value?: string /** 设置 React 非受控输入框的初始内容 @@ -12,20 +12,20 @@ interface InputProps extends StandardProps, FormItemProps { defaultValue?: string /** input 的类型 * @default "text" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ type?: keyof InputProps.Type /** 是否是密码类型 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ password?: boolean /** 输入框为空时占位符 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ placeholder?: string /** 指定 placeholder 的样式 - * @supported weapp, alipay, swan, tt, qq, jd, rn + * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony */ placeholderStyle?: string /** 指定 placeholder 的样式类 @@ -34,7 +34,7 @@ interface InputProps extends StandardProps, FormItemProps { */ placeholderClass?: string /** 指定 placeholder 的文本颜色 - * @supported rn + * @supported rn, harmony */ placeholderTextColor?: string /** 是否禁用 @@ -44,7 +44,7 @@ interface InputProps extends StandardProps, FormItemProps { disabled?: boolean /** 最大输入长度,设置为 -1 的时候不限制最大长度 * @default 140 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ maxlength?: number /** 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 @@ -66,7 +66,7 @@ interface InputProps extends StandardProps, FormItemProps { /** 设置键盘右下角按钮的文字,仅在type='text'时生效 * @alipay confirm-type 与 enableNative 属性冲突,若希望 confirm-type 生效,enableNative 不能设定为 false,而且不能设定 always-system * @default done - * @supported weapp, alipay, swan, tt, qq, jd, rn + * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony */ confirmType?: keyof InputProps.ConfirmType /** 点击键盘右下角按钮时是否保持键盘不收起 @@ -75,7 +75,7 @@ interface InputProps extends StandardProps, FormItemProps { */ confirmHold?: boolean /** 指定focus时的光标位置 - * @supported weapp, alipay, swan, tt, qq, jd, rn + * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony */ cursor?: number /** 光标起始位置,自动聚集时有效,需与selection-end搭配使用 @@ -90,7 +90,7 @@ interface InputProps extends StandardProps, FormItemProps { selectionEnd?: number /** 键盘弹起时,是否自动上推页面 * @default true - * @supported weapp, swan, tt, qq, jd + * @supported weapp, swan, tt, qq, jd, harmony */ adjustPosition?: boolean /** focus 时,点击页面的时候不收起键盘 @@ -171,23 +171,23 @@ interface InputProps extends StandardProps, FormItemProps { */ clueType?: number /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onInput?: CommonEventFunction /** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onFocus?: CommonEventFunction /** 输入框失去焦点时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onBlur?: CommonEventFunction /** 点击完成按钮时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onConfirm?: CommonEventFunction /** 键盘高度发生变化的时候触发此事件 - * @supported weapp, tt, qq + * @supported weapp, tt, qq, harmony */ onKeyboardHeightChange?: CommonEventFunction /** 用户昵称审核完毕后触发,仅在 type 为 "nickname" 时有效,event.detail = { pass, timeout } diff --git a/packages/taro-components/types/Label.d.ts b/packages/taro-components/types/Label.d.ts index c212f3411c80..273ae03f566f 100644 --- a/packages/taro-components/types/Label.d.ts +++ b/packages/taro-components/types/Label.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps } from './common' interface LabelProps extends StandardProps { /** 绑定控件的 id - * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid */ for?: string } diff --git a/packages/taro-components/types/ListView.d.ts b/packages/taro-components/types/ListView.d.ts index cb1234947e01..32d5f6ff1d93 100644 --- a/packages/taro-components/types/ListView.d.ts +++ b/packages/taro-components/types/ListView.d.ts @@ -12,7 +12,7 @@ interface ListViewProps extends StandardProps { /** * 列表布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。 * @classification skyline - * @supported weapp + * @supported weapp, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/component/list-view.html */ declare const ListView: ComponentType diff --git a/packages/taro-components/types/NavigationBar.d.ts b/packages/taro-components/types/NavigationBar.d.ts index a2a1c575a9b8..254ce2877fd4 100644 --- a/packages/taro-components/types/NavigationBar.d.ts +++ b/packages/taro-components/types/NavigationBar.d.ts @@ -2,19 +2,19 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction } from './common' interface NavigationBarProps extends StandardProps { /** 导航条标题 - * @supported weapp + * @supported weapp, harmony */ title?: string /** 是否在导航条显示 loading 加载提示 - * @supported weapp + * @supported weapp, harmony */ loading?: boolean /** 导航条前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 - * @supported weapp + * @supported weapp, harmony */ frontColor?: string /** 导航条背景颜色值,有效值为十六进制颜色 - * @supported weapp + * @supported weapp, harmony */ backgroundColor?: string /** 改变导航栏颜色时的动画时长,默认为 0 (即没有动画效果) diff --git a/packages/taro-components/types/Navigator.d.ts b/packages/taro-components/types/Navigator.d.ts index d5d6d1050af1..dc0da4f41827 100644 --- a/packages/taro-components/types/Navigator.d.ts +++ b/packages/taro-components/types/Navigator.d.ts @@ -111,7 +111,7 @@ declare namespace NavigatorProps { } /** 页面链接 * @classification navig - * @supported weapp, alipay, swan, tt, qq, jd, harmony, h5, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html */ declare const Navigator: ComponentType diff --git a/packages/taro-components/types/PageMeta.d.ts b/packages/taro-components/types/PageMeta.d.ts index 72b44b73473d..f4054679eec5 100644 --- a/packages/taro-components/types/PageMeta.d.ts +++ b/packages/taro-components/types/PageMeta.d.ts @@ -6,25 +6,25 @@ interface PageMetaProps extends StandardProps { */ backgroundTextStyle?: string /** 窗口的背景色,必须为十六进制颜色值 - * @supported weapp, alipay + * @supported weapp, alipay, harmony */ backgroundColor?: string /** 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 - * @supported weapp, alipay + * @supported weapp, alipay, harmony */ backgroundColorTop?: string /** 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 - * @supported weapp, alipay + * @supported weapp, alipay, harmony */ backgroundColorBottom?: string /** 滚动位置,可以使用 px 或者 rpx 为单位,在被设置时,页面会滚动到对应位置 * @default "" - * @supported weapp, alipay + * @supported weapp, alipay, harmony */ scrollTop?: string /** 滚动动画时长 * @default 300 - * @supported weapp, alipay + * @supported weapp, alipay, harmony */ scrollDuration?: number /** 页面根节点样式,页面根节点是所有页面节点的祖先节点,相当于 HTML 中的 body 节点 @@ -38,7 +38,7 @@ interface PageMetaProps extends StandardProps { */ rootFontSize?: string /** 页面内容的背景色,用于页面中的空白部分和页面大小变化 resize 动画期间的临时空闲区域 - * @supported weapp, alipay + * @supported weapp, alipay, harmony */ rootBackgroundColor?: string /** 页面 page 的字体大小,可以设置为 system ,表示使用当前用户设置的微信字体大小 @@ -92,7 +92,7 @@ declare namespace PageMetaProps { * 开发者需要在页面配置里添加:`enablePageMeta: true` * ::: * - * @supported weapp, alipay + * @supported weapp, alipay, harmony * @example_react * ```tsx * // page.config.ts diff --git a/packages/taro-components/types/Picker.d.ts b/packages/taro-components/types/Picker.d.ts index a4e9af9f3679..3bcecd0a1ad8 100644 --- a/packages/taro-components/types/Picker.d.ts +++ b/packages/taro-components/types/Picker.d.ts @@ -11,7 +11,7 @@ interface PickerStandardProps extends StandardProps, FormItemProps { /** * 选择器类型,默认是普通选择器 * @default "selector" - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ mode?: keyof PickerStandardProps.Mode /** @@ -22,7 +22,7 @@ interface PickerStandardProps extends StandardProps, FormItemProps { disabled?: boolean /** * 取消选择或点遮罩层收起 picker 时触发 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ onCancel?: CommonEventFunction } @@ -51,18 +51,18 @@ interface PickerSelectorProps extends PickerStandardProps { mode?: 'selector' /** * mode为 selector 或 multiSelector 时,range 有效 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid * @default [] */ range: string[] | number[] | Record[] /** * 当 range 是一个 Object Array 时,通过 rangeKey 来指定 Object 中 key 的值作为选择器显示内容 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ rangeKey?: string /** * 表示选择了 range 中的第几个(下标从 0 开始) - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid * @default 0 */ value?: number @@ -84,12 +84,12 @@ interface PickerSelectorProps extends PickerStandardProps { indicatorStyle?: StyleProp /** * value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ onChange?: CommonEventFunction /** * 用于替换组件内部文本 - * @supported h5, harmony_hybrid + * @supported h5, harmony, harmony_hybrid */ textProps?: PickerStandardProps.PickerText } @@ -105,18 +105,18 @@ interface PickerMultiSelectorProps extends PickerStandardProps { mode: 'multiSelector' /** * mode为 selector 或 multiSelector 时,range 有效 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid * @default [] */ range: Array | Array | Array[]> /** * 当 range 是一个 Object Array 时,通过 rangeKey 来指定 Object 中 key 的值作为选择器显示内容 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ rangeKey?: string /** * 表示选择了 range 中的第几个(下标从 0 开始) - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid * @default [] */ value: number[] | string[] | Record[] @@ -134,12 +134,12 @@ interface PickerMultiSelectorProps extends PickerStandardProps { indicatorStyle?: StyleProp /** * 当 value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ onChange: CommonEventFunction /** * 列改变时触发 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ onColumnChange?: CommonEventFunction } @@ -161,7 +161,7 @@ interface PickerTimeProps extends PickerStandardProps { mode: 'time' /** * value 的值表示选择了 range 中的第几个(下标从 0 开始) - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ value?: string /** 设置 React 非受控状态下的初始取值 @@ -170,17 +170,17 @@ interface PickerTimeProps extends PickerStandardProps { defaultValue?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的开始,字符串格式为"hh:mm" - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ start?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的结束,字符串格式为"hh:mm" - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ end?: string /** * value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ onChange: CommonEventFunction } @@ -196,7 +196,7 @@ interface PickerDateProps extends PickerStandardProps { mode: 'date' /** * 表示选中的日期,格式为"YYYY-MM-DD" - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid * @default 0 */ value: string @@ -206,12 +206,12 @@ interface PickerDateProps extends PickerStandardProps { defaultValue?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的开始,字符串格式为"YYYY-MM-DD" - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ start?: string /** * 仅当 mode 为 "time" 或 "date" 时有效,表示有效时间范围的结束,字符串格式为"YYYY-MM-DD" - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ end?: string /** @@ -222,7 +222,7 @@ interface PickerDateProps extends PickerStandardProps { fields?: keyof PickerDateProps.Fields /** * value 改变时触发 change 事件 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony, harmony_hybrid */ onChange: CommonEventFunction } diff --git a/packages/taro-components/types/PickerView.d.ts b/packages/taro-components/types/PickerView.d.ts index 1f9724666895..1e203d0f0aa5 100644 --- a/packages/taro-components/types/PickerView.d.ts +++ b/packages/taro-components/types/PickerView.d.ts @@ -60,7 +60,7 @@ declare namespace PickerViewProps { /** 嵌入页面的滚动选择器 * 其中只可放置 picker-view-column 组件,其它节点不会显示 * @classification forms - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @example_react * ```tsx * export default class Picks extends Component { diff --git a/packages/taro-components/types/PickerViewColumn.d.ts b/packages/taro-components/types/PickerViewColumn.d.ts index 767785f68697..ad4ea1f132aa 100644 --- a/packages/taro-components/types/PickerViewColumn.d.ts +++ b/packages/taro-components/types/PickerViewColumn.d.ts @@ -5,7 +5,7 @@ type PickerViewColumnProps = StandardProps /** 滚动选择器子项 * 仅可放置于 `` 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致 * @classification forms - * @supported weapp, swan, alipay, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, swan, alipay, tt, h5, rn, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html */ declare const PickerViewColumn: ComponentType diff --git a/packages/taro-components/types/Progress.d.ts b/packages/taro-components/types/Progress.d.ts index 6c4cb35a2ba5..2eeb570345fa 100644 --- a/packages/taro-components/types/Progress.d.ts +++ b/packages/taro-components/types/Progress.d.ts @@ -68,7 +68,7 @@ interface ProgressProps extends StandardProps { } /** 进度条。组件属性的长度单位默认为 px * @classification base - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid * @example_react * ```tsx * export default class PageView extends Component { diff --git a/packages/taro-components/types/Radio.d.ts b/packages/taro-components/types/Radio.d.ts index 16658650f3b2..5941710b4226 100644 --- a/packages/taro-components/types/Radio.d.ts +++ b/packages/taro-components/types/Radio.d.ts @@ -2,22 +2,22 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface RadioProps extends StandardProps { /** `` 标识。当该`` 选中时,``的 change 事件会携带``的 value - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ value?: string /** 当前是否选中 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ checked?: boolean /** 是否禁用 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ disabled?: boolean /** Radio 的颜色,同 css 的 color * @default "#09BB07" - * @supported weapp, alipay, swan, tt, qq, jd, rn + * @supported weapp, alipay, swan, tt, qq, jd, rn, harmony */ color?: string /** @@ -34,7 +34,7 @@ interface RadioProps extends StandardProps { */ ariaLabel?: string /** 中的选中项发生变化时触发 change 事件 - * @supported h5, rn, harmony_hybrid + * @supported h5, rn, harmony, harmony_hybrid */ onChange?: CommonEventFunction<{ value?: string diff --git a/packages/taro-components/types/RadioGroup.d.ts b/packages/taro-components/types/RadioGroup.d.ts index 34bba0cf0456..18adf213afce 100644 --- a/packages/taro-components/types/RadioGroup.d.ts +++ b/packages/taro-components/types/RadioGroup.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface RadioGroupProps extends StandardProps, FormItemProps { /** 组件名字,用于表单提交获取数据。 - * @supported alipay, tt + * @supported alipay, tt, harmony */ name?: string /** RadioGroup 中选中项发生改变时触发 change 事件,detail = {value:[选中的radio的value的数组]} diff --git a/packages/taro-components/types/ScrollView.d.ts b/packages/taro-components/types/ScrollView.d.ts index 0e1124ca3885..61183a1207ad 100644 --- a/packages/taro-components/types/ScrollView.d.ts +++ b/packages/taro-components/types/ScrollView.d.ts @@ -3,13 +3,13 @@ import { BaseEventOrigFunction, CommonEventFunction, StandardProps } from './com interface ScrollViewProps extends StandardProps { /** 允许横向滚动 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @rn 二选一 */ scrollX?: boolean /** 允许纵向滚动 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @rn 二选一 */ scrollY?: boolean @@ -96,7 +96,7 @@ interface ScrollViewProps extends StandardProps { */ bounces?: boolean /** 滚动条显隐控制 (同时开启 enhanced 属性后生效) - * @supported weapp + * @supported weapp, harmony * @default true */ showScrollbar?: boolean @@ -140,7 +140,7 @@ interface ScrollViewProps extends StandardProps { * list - 列表模式。只会渲染在屏节点,会根据直接子节点是否在屏来按需渲染,若只有一个直接子节点则性能会退化 * custom - 自定义模式。只会渲染在屏节点,子节点可以是 sticky-section list-view grid-view 等组件 * nested - 嵌套模式。用于处理父子 scroll-view 间的嵌套滚动,子节点可以是 nested-scroll-header nested-scroll-body 组件或自定义 refresher - * @supported weapp + * @supported weapp, harmony * @default 'list' */ type?: 'list' | 'custom' | 'nested' @@ -226,7 +226,7 @@ interface ScrollViewProps extends StandardProps { */ onScrollToLower?: CommonEventFunction /** 滚动时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onScroll?: BaseEventOrigFunction /** 滚动开始事件 diff --git a/packages/taro-components/types/Slider.d.ts b/packages/taro-components/types/Slider.d.ts index 6d95bd3ec4a5..7fa28d638be8 100644 --- a/packages/taro-components/types/Slider.d.ts +++ b/packages/taro-components/types/Slider.d.ts @@ -3,27 +3,27 @@ import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface SliderProps extends StandardProps, FormItemProps { /** 最小值 * @default 0 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ min?: number /** 最大值 * @default 100 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ max?: number /** 步长,取值必须大于 0,并且可被(max - min)整除 * @default 1 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ step?: number /** 是否禁用 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ disabled?: boolean /** 当前取值 * @default 0 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ value?: number /** 设置 React 非受控状态下的初始取值 @@ -33,37 +33,37 @@ interface SliderProps extends StandardProps, FormItemProps { defaultValue?: string /** 背景条的颜色(请使用 backgroundColor) * @default "#e9e9e9" - * @supported weapp, tt, qq, jd + * @supported weapp, tt, qq, jd, harmony */ color?: string /** 已选择的颜色(请使用 activeColor) * @default "#1aad19" - * @supported weapp, tt, qq, jd + * @supported weapp, tt, qq, jd, harmony */ selectedColor?: string /** 已选择的颜色 * @default "#1aad19" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ activeColor?: string /** 背景条的颜色 * @default "#e9e9e9" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ backgroundColor?: string /** 滑块的大小,取值范围为 12 - 28 * @default 28 - * @supported weapp, swan, tt, qq, jd, h5, harmony_hybrid + * @supported weapp, swan, tt, qq, jd, h5, harmony, harmony_hybrid */ blockSize?: number /** 滑块的颜色 * @default "#ffffff" - * @supported weapp, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ blockColor?: string /** 是否显示当前 value * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ showValue?: boolean /** 组件名字,用于表单提交获取数据。 @@ -89,11 +89,11 @@ interface SliderProps extends StandardProps, FormItemProps { */ ariaLabel?: string /** 完成一次拖动后触发的事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onChange?: CommonEventFunction /** 拖动过程中触发的事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onChanging?: CommonEventFunction } diff --git a/packages/taro-components/types/Slot.d.ts b/packages/taro-components/types/Slot.d.ts index f3a47059392a..5739ea151900 100644 --- a/packages/taro-components/types/Slot.d.ts +++ b/packages/taro-components/types/Slot.d.ts @@ -17,7 +17,7 @@ interface SlotProps extends StandardProps { /** slot 插槽 * @classification viewContainer - * @supported weapp, swan, alipay, tt, jd, qq, harmony, h5, harmony_hybrid + * @supported weapp, swan, alipay, tt, jd, qq, h5, harmony_hybrid * @example * ```tsx * import { Slot, View, Text } from '@tarojs/components' diff --git a/packages/taro-components/types/StickyHeader.d.ts b/packages/taro-components/types/StickyHeader.d.ts index 87cc3c6f0860..2e08d996922d 100644 --- a/packages/taro-components/types/StickyHeader.d.ts +++ b/packages/taro-components/types/StickyHeader.d.ts @@ -18,7 +18,7 @@ interface StickyHeaderProps extends StandardProps { /** * 吸顶布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点或 sticky-section 组件直接子节点。仅 Skyline 支持。 * @classification skyline - * @supported weapp + * @supported weapp, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/component/sticky-header.html */ declare const StickyHeader: ComponentType diff --git a/packages/taro-components/types/StickySection.d.ts b/packages/taro-components/types/StickySection.d.ts index 8c1e7e2d6a16..d7396a026bff 100644 --- a/packages/taro-components/types/StickySection.d.ts +++ b/packages/taro-components/types/StickySection.d.ts @@ -16,7 +16,7 @@ interface StickySectionProps extends StandardProps { /** * 吸顶布局容器,仅支持作为 scroll-view 自定义模式下的直接子节点。仅 Skyline 支持。 * @classification skyline - * @supported weapp + * @supported weapp, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/component/sticky-section.html */ declare const StickySection: ComponentType diff --git a/packages/taro-components/types/Swiper.d.ts b/packages/taro-components/types/Swiper.d.ts index e3e546204cb6..d3a19e585f34 100644 --- a/packages/taro-components/types/Swiper.d.ts +++ b/packages/taro-components/types/Swiper.d.ts @@ -3,27 +3,27 @@ import { StandardProps, CommonEventFunction } from './common' interface SwiperProps extends StandardProps { /** 是否显示面板指示点 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ indicatorDots?: boolean /** 指示点颜色 * @default "rgba(0, 0, 0, .3)" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ indicatorColor?: string /** 当前选中的指示点颜色 * @default "#000000" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ indicatorActiveColor?: string /** 是否自动切换 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ autoplay?: boolean /** 当前所在滑块的 index * @default 0 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ current?: number /** 当前所在滑块的 item-id ,不能与 current 被同时指定 @@ -34,12 +34,12 @@ interface SwiperProps extends StandardProps { currentItemId?: string /** 自动切换时间间隔 * @default 5000 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ interval?: number /** 滑动动画时长 * @default 500 - * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid */ duration?: number /** 是否采用衔接滑动 @@ -49,7 +49,7 @@ interface SwiperProps extends StandardProps { circular?: boolean /** 滑动方向是否为纵向 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ vertical?: boolean /** 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值 @@ -152,7 +152,7 @@ interface SwiperProps extends StandardProps { */ cacheExtent?: number /** current 改变时会触发 change 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onChange?: CommonEventFunction /** swiper-item 的位置发生改变时会触发 transition 事件 diff --git a/packages/taro-components/types/SwiperItem.d.ts b/packages/taro-components/types/SwiperItem.d.ts index c8908eea1440..18f2e6421615 100644 --- a/packages/taro-components/types/SwiperItem.d.ts +++ b/packages/taro-components/types/SwiperItem.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps } from './common' interface SwiperItemProps extends StandardProps { /** 该 swiper-item 的标识符 - * @supported weapp, swan, tt, jd, h5, rn, harmony_hybrid + * @supported weapp, swan, tt, jd, h5, rn, harmony, harmony_hybrid */ itemId?: string /** 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息 diff --git a/packages/taro-components/types/Switch.d.ts b/packages/taro-components/types/Switch.d.ts index e3bd221ed737..199d4fb4f377 100644 --- a/packages/taro-components/types/Switch.d.ts +++ b/packages/taro-components/types/Switch.d.ts @@ -3,7 +3,7 @@ import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface SwitchProps extends StandardProps, FormItemProps { /** 是否选中 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ checked?: boolean /** 设置在 React 非受控状态下,当前是否选中 @@ -13,17 +13,17 @@ interface SwitchProps extends StandardProps, FormItemProps { defaultChecked?: boolean /** 是否禁用 * @default false - * @supported weapp, alipay, swan, tt, qq, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid */ disabled?: boolean /** 样式,有效值:switch, checkbox * @default "switch" - * @supported weapp, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ type?: 'switch' | 'checkbox' /** switch 的颜色,同 css 的 color * @default "#04BE02" - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ color?: string /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上 @@ -44,7 +44,7 @@ interface SwitchProps extends StandardProps, FormItemProps { */ ariaLabel?: string /** checked 改变时触发 change 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onChange?: CommonEventFunction } diff --git a/packages/taro-components/types/Text.d.ts b/packages/taro-components/types/Text.d.ts index eb8fa9b4be12..b93e11dbadd7 100644 --- a/packages/taro-components/types/Text.d.ts +++ b/packages/taro-components/types/Text.d.ts @@ -32,7 +32,7 @@ interface TextProps extends StandardProps { */ overflow?: keyof TextProps.Overflow /** 限制文本最大行数 - * @supported weapp + * @supported weapp, harmony */ maxLines?: number } @@ -59,7 +59,7 @@ declare namespace TextProps { } /** 文本 * @classification base - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid * @example_react * ```tsx * export default class PageView extends Component { diff --git a/packages/taro-components/types/Textarea.d.ts b/packages/taro-components/types/Textarea.d.ts index f9fb83a96bd9..be1322484e7e 100644 --- a/packages/taro-components/types/Textarea.d.ts +++ b/packages/taro-components/types/Textarea.d.ts @@ -2,7 +2,7 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction, FormItemProps } from './common' interface TextareaProps extends StandardProps, FormItemProps { /** 输入框的内容 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ value?: string /** 设置 React 非受控输入框的初始内容 @@ -11,11 +11,11 @@ interface TextareaProps extends StandardProps, FormItemProps { */ defaultValue?: string /** 输入框为空时占位符 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ placeholder?: string /** 指定 placeholder 的样式 - * @supported weapp, alipay, swan, tt, qq, jd + * @supported weapp, alipay, swan, tt, qq, jd, harmony */ placeholderStyle?: string /** 指定 placeholder 的样式类 @@ -129,11 +129,11 @@ interface TextareaProps extends StandardProps, FormItemProps { */ adjustKeyboardTo?: boolean /** 输入框聚焦时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onFocus?: CommonEventFunction /** 输入框失去焦点时触发 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onBlur?: CommonEventFunction /** 输入框行数变化时调用 @@ -143,7 +143,7 @@ interface TextareaProps extends StandardProps, FormItemProps { /** 当键盘输入时,触发 input 事件 * * **onInput 处理函数的返回值并不会反映到 textarea 上** - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onInput?: CommonEventFunction /** 点击完成时, 触发 confirm 事件 @@ -151,7 +151,7 @@ interface TextareaProps extends StandardProps, FormItemProps { */ onConfirm?: CommonEventFunction /** 键盘高度发生变化的时候触发此事件 - * @supported weapp, tt + * @supported weapp, tt, harmony */ onKeyboardHeightChange?: CommonEventFunction } diff --git a/packages/taro-components/types/Video.d.ts b/packages/taro-components/types/Video.d.ts index a6d4e77022fa..fe40bded39e2 100644 --- a/packages/taro-components/types/Video.d.ts +++ b/packages/taro-components/types/Video.d.ts @@ -2,16 +2,16 @@ import { ComponentType } from 'react' import { StandardProps, CommonEventFunction } from './common' interface VideoProps extends StandardProps { /** 要播放视频的资源地址 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ src: string /** 指定视频时长 - * @supported weapp, alipay, qq, h5, rn, harmony_hybrid + * @supported weapp, alipay, qq, h5, rn, harmony, harmony_hybrid */ duration?: number /** 是否显示默认播放控件(播放/暂停按钮、播放进度、时间) * @default true - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ controls?: boolean /** 弹幕列表 @@ -30,17 +30,17 @@ interface VideoProps extends StandardProps { enableDanmu?: boolean /** 是否自动播放 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ autoplay?: boolean /** 是否循环播放 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ loop?: boolean /** 是否静音播放 * @default false - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ muted?: boolean /** 指定视频初始播放位置 @@ -83,7 +83,7 @@ interface VideoProps extends StandardProps { enableProgressGesture?: boolean /** 当视频大小与 video 容器大小不一致时,视频的表现形式 * @default "contain" - * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, harmony, harmony_hybrid */ objectFit?: keyof VideoProps.ObjectFit /** 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效 @@ -298,24 +298,24 @@ interface VideoProps extends StandardProps { */ definition?: string /** 当开始/继续播放时触发 play 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onPlay?: CommonEventFunction /** 当暂停播放时触发 pause 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onPause?: CommonEventFunction /** 当播放到末尾时触发 ended 事件 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onEnded?: CommonEventFunction /** 播放进度变化时触发, 触发频率 250ms 一次 - * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ onTimeUpdate?: CommonEventFunction /** 当视频进入和退出全屏时触发 * - * @supported alipay, h5, rn, harmony_hybrid + * @supported alipay, h5, rn, harmony, harmony_hybrid */ onFullscreenChange?: CommonEventFunction /** 视频出现缓冲时触发 @@ -328,11 +328,11 @@ interface VideoProps extends StandardProps { */ onError?: CommonEventFunction /** 加载进度变化时触发,只支持一段加载 - * @supported weapp, tt, qq, h5, harmony_hybrid + * @supported weapp, tt, qq, h5, harmony, harmony_hybrid */ onProgress?: CommonEventFunction /** 视频元数据加载完成时触发 - * @supported weapp, swan, tt, jd, rn + * @supported weapp, swan, tt, jd, rn, harmony */ onLoadedMetaData?: CommonEventFunction /** @@ -433,11 +433,11 @@ interface VideoProps extends StandardProps { */ onLoadStart?: CommonEventFunction /** 否 - * @supported jd + * @supported jd, harmony */ onSeeked?: CommonEventFunction /** 否 - * @supported jd + * @supported jd, harmony */ onSeeking?: CommonEventFunction /** 贴片广告加载成功时触发,event.detail = { adType: 'preRollAd' | 'postRollAd' } diff --git a/packages/taro-components/types/common.d.ts b/packages/taro-components/types/common.d.ts index ccd56263e377..1095225b39c5 100644 --- a/packages/taro-components/types/common.d.ts +++ b/packages/taro-components/types/common.d.ts @@ -3,7 +3,7 @@ import { CSSProperties, LegacyRef, ReactNode } from 'react' export interface StandardProps = ITouchEvent> extends EventProps { /** 组件的唯一标示, 保持整个页面唯一 */ id?: string - /** 同 `class`,在 React/Nerv 里一般使用 `className` 作为 `class` 的代称 */ + /** 同 `class`,在 React/Preact 里一般使用 `className` 作为 `class` 的代称 */ className?: string /** 组件的内联样式, 可以动态设置的内联样式 */ style?: string | CSSProperties @@ -30,7 +30,12 @@ export interface StandardProps = * 是否开启编译模式 * @supported weapp, harmony */ - compileMode?: boolean + compileMode?: boolean | string + /** + * 自定义容器组件的方向 + * @supported harmony + */ + harmonyDirection?: 'row' | 'column' | 'flex' } export interface FormItemProps { diff --git a/packages/taro/types/api/base/env.d.ts b/packages/taro/types/api/base/env.d.ts index 4af6ec22599a..2eb5a32b346f 100644 --- a/packages/taro/types/api/base/env.d.ts +++ b/packages/taro/types/api/base/env.d.ts @@ -9,7 +9,7 @@ declare module '../../index' { env: { [key: string]: string | undefined /** 框架 */ - FRAMEWORK: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3' + FRAMEWORK: 'react' | 'preact' | 'solid' | 'vue3' /** Taro 环境变量 */ TARO_ENV: 'weapp' | 'h5' | 'rn' | 'swan' | 'alipay' | 'tt' | 'qq' | 'jd' | 'quickapp' /** 文件系统中的用户目录路径 (本地路径) */ diff --git a/packages/taro/types/api/base/system.d.ts b/packages/taro/types/api/base/system.d.ts index 09bd8430117f..3e20b53b49f8 100644 --- a/packages/taro/types/api/base/system.d.ts +++ b/packages/taro/types/api/base/system.d.ts @@ -546,7 +546,7 @@ declare module '../../index' { getSystemSetting(): getSystemSetting.Result /** [Taro.getSystemInfo](./getSystemInfo) 的同步版本 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。 * @example @@ -591,7 +591,7 @@ declare module '../../index' { getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise /** 获取系统信息,支持 `Promise` 化使用。 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。 * @example diff --git a/packages/taro/types/api/base/weapp/app-event.d.ts b/packages/taro/types/api/base/weapp/app-event.d.ts index 9613b3c9c72d..b67bd4bfca12 100644 --- a/packages/taro/types/api/base/weapp/app-event.d.ts +++ b/packages/taro/types/api/base/weapp/app-event.d.ts @@ -113,7 +113,7 @@ declare module '../../../index' { * * **注意** * - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。 - * @supported weapp, tt, h5, harmony_hybrid + * @supported weapp, tt, h5, harmony, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html */ onUnhandledRejection(callback: onUnhandledRejection.Callback): void @@ -137,7 +137,7 @@ declare module '../../../index' { onPageNotFound(callback: onPageNotFound.Callback): void /** 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。 - * @supported weapp, tt, h5, harmony_hybrid + * @supported weapp, tt, h5, harmony, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html */ onError(callback: onError.Callback): void @@ -196,7 +196,7 @@ declare module '../../../index' { ): void /** 取消监听未处理的 Promise 拒绝事件 - * @supported weapp, tt, h5, harmony_hybrid + * @supported weapp, tt, h5, harmony, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html */ offUnhandledRejection(callback: onUnhandledRejection.Callback): void @@ -217,7 +217,7 @@ declare module '../../../index' { ): void /** 取消监听音频播放错误事件 - * @supported weapp, tt, h5, harmony_hybrid + * @supported weapp, tt, h5, harmony, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html */ diff --git a/packages/taro/types/api/device/accelerometer.d.ts b/packages/taro/types/api/device/accelerometer.d.ts index 02cf4b7a0e2c..3d5e8bbba23f 100644 --- a/packages/taro/types/api/device/accelerometer.d.ts +++ b/packages/taro/types/api/device/accelerometer.d.ts @@ -56,7 +56,7 @@ declare module '../../index' { * ```tsx * Taro.startAccelerometer({ interval: 'game' }) * ``` - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html */ startAccelerometer (res?: startAccelerometer.Option): Promise @@ -67,14 +67,14 @@ declare module '../../index' { * ```tsx * Taro.stopAccelerometer() * ``` - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html */ stopAccelerometer (res?: stopAccelerometer.Option): Promise /** * 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 `Taro.stopAccelerometer` 停止监听。 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony * @example * ```tsx * Taro.onAccelerometerChange(res => { @@ -91,7 +91,7 @@ declare module '../../index' { /** * 取消监听加速度数据事件,参数为空,则取消所有的事件监听。 - * @supported weapp, alipay, swan, jd, tt, h5, rn + * @supported weapp, alipay, swan, jd, tt, h5, rn, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html */ offAccelerometerChange( diff --git a/packages/taro/types/api/device/battery.d.ts b/packages/taro/types/api/device/battery.d.ts index 58baf1180378..516bd4695435 100644 --- a/packages/taro/types/api/device/battery.d.ts +++ b/packages/taro/types/api/device/battery.d.ts @@ -32,13 +32,13 @@ declare module '../../index' { interface TaroStatic { /** Taro.getBatteryInfo 的同步版本 - * @supported weapp, alipay, swan, jd, qq + * @supported weapp, alipay, swan, jd, qq, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html */ getBatteryInfoSync(): getBatteryInfoSync.Result /** 获取设备电量。同步 API Taro.getBatteryInfoSync 在 iOS 上不可用。 - * @supported weapp, alipay, swan, jd, qq, h5, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, h5, harmony, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html */ getBatteryInfo(option?: getBatteryInfo.Option): Promise diff --git a/packages/taro/types/api/device/clipboard.d.ts b/packages/taro/types/api/device/clipboard.d.ts index 6294af99e554..37d3bf314e05 100644 --- a/packages/taro/types/api/device/clipboard.d.ts +++ b/packages/taro/types/api/device/clipboard.d.ts @@ -43,7 +43,7 @@ declare module '../../index' { interface TaroStatic { /** 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s - * @supported weapp, swan, jd, qq, h5, rn, tt, harmony_hybrid + * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid * @h5 部分实现 * @example * ```tsx @@ -63,19 +63,19 @@ declare module '../../index' { setClipboardData(option: setClipboardData.Option): Promise /** - * 获取系统剪贴板内容 - * @supported weapp, swan, jd, qq, h5, rn, tt, harmony_hybrid - * @h5 部分实现 - * @example - * ```tsx - * Taro.getClipboardData({ - * success: function (res){ - * console.log(res.data) - * } - * }) - * ``` - * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html - */ + * 获取系统剪贴板内容 + * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @h5 部分实现 + * @example + * ```tsx + * Taro.getClipboardData({ + * success: function (res){ + * console.log(res.data) + * } + * }) + * ``` + * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html + */ getClipboardData(res?: getClipboardData.Option): Promise } } diff --git a/packages/taro/types/api/device/keyboard.d.ts b/packages/taro/types/api/device/keyboard.d.ts index a49f6830adfc..bf6f1bbae5f9 100644 --- a/packages/taro/types/api/device/keyboard.d.ts +++ b/packages/taro/types/api/device/keyboard.d.ts @@ -71,7 +71,7 @@ declare module '../../index' { getSelectedTextRange(option?: getSelectedTextRange.Option): Promise /** 监听键盘高度变化 - * @supported weapp, swan, jd, qq, rn + * @supported weapp, swan, jd, qq, rn, harmony * @example * ```tsx * Taro.onKeyboardHeightChange(res => { @@ -86,7 +86,7 @@ declare module '../../index' { /** * 取消监听键盘高度变化事件。 - * @supported weapp, swan, jd, rn + * @supported weapp, swan, jd, rn, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.offKeyboardHeightChange.html */ offKeyboardHeightChange( diff --git a/packages/taro/types/api/device/network.d.ts b/packages/taro/types/api/device/network.d.ts index 82fa43b82583..7864bba8bc52 100644 --- a/packages/taro/types/api/device/network.d.ts +++ b/packages/taro/types/api/device/network.d.ts @@ -107,7 +107,7 @@ declare module '../../index' { ): void /** 监听网络状态变化。 - * @supported weapp, swan, h5, rn, tt, harmony_hybrid + * @supported weapp, swan, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * Taro.onNetworkStatusChange(function (res) { @@ -132,7 +132,7 @@ declare module '../../index' { ): void /** 取消监听网络状态变化事件,参数为空,则取消所有的事件监听。 - * @supported weapp, swan, h5, rn, harmony_hybrid + * @supported weapp, swan, h5, rn, harmony, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html */ offNetworkStatusChange( @@ -141,7 +141,7 @@ declare module '../../index' { ): void /** 获取网络类型。 - * @supported weapp, swan, qq, h5, rn, tt, harmony_hybrid + * @supported weapp, swan, qq, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * Taro.getNetworkType({ diff --git a/packages/taro/types/api/device/phone.d.ts b/packages/taro/types/api/device/phone.d.ts index 72e268820c1e..a7062e35dda0 100644 --- a/packages/taro/types/api/device/phone.d.ts +++ b/packages/taro/types/api/device/phone.d.ts @@ -16,7 +16,7 @@ declare module '../../index' { interface TaroStatic { /** 拨打电话 - * @supported weapp, swan, jd, qq, tt, h5, rn, harmony_hybrid + * @supported weapp, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid * @example * ```tsx * Taro.makePhoneCall({ diff --git a/packages/taro/types/api/device/screen.d.ts b/packages/taro/types/api/device/screen.d.ts index 4851daaa0137..6f539167aba3 100644 --- a/packages/taro/types/api/device/screen.d.ts +++ b/packages/taro/types/api/device/screen.d.ts @@ -179,7 +179,7 @@ declare module '../../index' { /** 取消用户录屏事件的监听函数 * @supported weapp - * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html + * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html */ offScreenRecordingStateChanged( /** 用户录屏事件的监听函数 */ @@ -207,7 +207,7 @@ declare module '../../index' { * * **说明** * - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。 - * @supported weapp, alipay, swan, jd, qq, rn + * @supported weapp, alipay, swan, jd, qq, rn, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html */ getScreenBrightness( diff --git a/packages/taro/types/api/device/vibrate.d.ts b/packages/taro/types/api/device/vibrate.d.ts index 7e3838b5d3de..9acbd72220ac 100644 --- a/packages/taro/types/api/device/vibrate.d.ts +++ b/packages/taro/types/api/device/vibrate.d.ts @@ -29,7 +29,7 @@ declare module '../../index' { /** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效 * * 仅微信小程序平台支持 type 参数 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony * @example * ```tsx * Taro.vibrateShort(params).then(...) @@ -39,7 +39,7 @@ declare module '../../index' { vibrateShort(option?: vibrateShort.Option): Promise /** 使手机发生较长时间的振动(400ms) - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony * @example * ```tsx * Taro.vibrateLong(params).then(...) diff --git a/packages/taro/types/api/media/image.d.ts b/packages/taro/types/api/media/image.d.ts index 8648583e25c0..ac84ec340f36 100644 --- a/packages/taro/types/api/media/image.d.ts +++ b/packages/taro/types/api/media/image.d.ts @@ -221,7 +221,7 @@ declare module '../../index' { /** 压缩后图片的宽度,单位为px,若不填写则默认以 compressedHeight 为准等比缩放。 */ compressedWidth?: number /** 压缩后图片的高度,单位为px,若不填写则默认以 compressedWidth 为准等比缩放。 */ - compressHeight?: number + compressedHeight?: number /** 接口调用成功的回调函数 */ success?: (result: SuccessCallbackResult) => void } @@ -361,7 +361,7 @@ declare module '../../index' { previewImage(option: previewImage.Option): Promise /** 获取图片信息。网络图片需先配置download域名才能生效。 - * @supported weapp, alipay, swan, tt, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, tt, h5, rn, harmony, harmony_hybrid * @example * ```tsx * Taro.getImageInfo({ diff --git a/packages/taro/types/api/network/request.d.ts b/packages/taro/types/api/network/request.d.ts index 416a73fba41c..4fac0617ef1a 100644 --- a/packages/taro/types/api/network/request.d.ts +++ b/packages/taro/types/api/network/request.d.ts @@ -78,7 +78,7 @@ declare module '../../index' { /** 接口调用失败的回调函数 */ fail?: (res: TaroGeneral.CallbackResult) => void /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: (res: TaroGeneral.CallbackResult) => void + complete?: (res: Partial & TaroGeneral.CallbackResult) => void /** 设置是否使用 jsonp 方式获取数据 * @default false * @supported h5 @@ -400,7 +400,7 @@ declare module '../../index' { * - 对于 `GET` 方法的数据,会将数据转换成 query string(`encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...`) * - 对于 `POST` 方法且 `header['content-type']` 为 `application/json` 的数据,会对数据进行 JSON 序列化 * - 对于 `POST` 方法且 `header['content-type']` 为 `application/x-www-form-urlencoded` 的数据,会将数据转换成 query string `(encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...)` - * @supported weapp, h5, rn, alipay, swan, tt, qq, harmony_hybrid + * @supported weapp, h5, rn, alipay, swan, tt, qq, harmony, harmony_hybrid * @example * ```tsx * Taro.request({ diff --git a/packages/taro/types/api/route/index.d.ts b/packages/taro/types/api/route/index.d.ts index 5d908282c434..4d5cbf8e4e84 100644 --- a/packages/taro/types/api/route/index.d.ts +++ b/packages/taro/types/api/route/index.d.ts @@ -117,7 +117,7 @@ declare module '../../index' { interface TaroStatic { /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @example * ```json * { @@ -143,7 +143,7 @@ declare module '../../index' { switchTab(option: switchTab.Option): Promise /** 关闭所有页面,打开到应用内的某个页面 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * Taro.reLaunch({ @@ -155,7 +155,7 @@ declare module '../../index' { reLaunch(option: reLaunch.Option): Promise /** 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @h5 未针对 tabbar 页面做限制处理 * @example * ```tsx @@ -168,7 +168,7 @@ declare module '../../index' { redirectTo(option: redirectTo.Option): Promise /** 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 Taro.navigateBack 可以返回到原页面。小程序中页面栈最多十层。 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @h5 未针对 tabbar 页面做限制处理 * @example * ```tsx @@ -195,7 +195,7 @@ declare module '../../index' { navigateTo(option: navigateTo.Option): Promise /** 关闭当前页面,返回上一页面或多级页面。可通过 getCurrentPages 获取当前的页面栈,决定需要返回几层。 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @h5 若入参 delta 大于现有页面数时,返回应用打开的第一个页面(如果想要返回首页请使用 reLaunch 方法)。 * @example * ```tsx diff --git a/packages/taro/types/api/storage/index.d.ts b/packages/taro/types/api/storage/index.d.ts index 7d7389b46fa6..120b4227e090 100644 --- a/packages/taro/types/api/storage/index.d.ts +++ b/packages/taro/types/api/storage/index.d.ts @@ -177,7 +177,7 @@ declare module '../../index' { ): void /** 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid * @example * ```tsx * Taro.setStorage({ @@ -221,7 +221,7 @@ declare module '../../index' { ): void /** 从本地缓存中移除指定 key - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid * @example * ```tsx * Taro.removeStorage({ @@ -289,7 +289,7 @@ declare module '../../index' { getStorageInfo(option?: getStorageInfo.Option): Promise /** 从本地缓存中异步获取指定 key 的内容 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid * @example * ```tsx * Taro.getStorage({ @@ -327,7 +327,7 @@ declare module '../../index' { clearStorageSync(): void /** 清理本地数据缓存 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid * @example * ```tsx * Taro.clearStorage() diff --git a/packages/taro/types/api/swan/pay.d.ts b/packages/taro/types/api/swan/pay.d.ts index 1ebbc2f25164..8c4611c91453 100644 --- a/packages/taro/types/api/swan/pay.d.ts +++ b/packages/taro/types/api/swan/pay.d.ts @@ -1,4 +1,4 @@ -import { Interface } from 'readline' +import { Interface } from 'node:readline' import Taro from '../../index' declare module '../../index' { @@ -117,12 +117,12 @@ declare module '../../index' { } interface TaroStatic { - /** + /** * 1)百度收银台,聚合了主流的百度钱包、微信、支付宝、网银等多种支付渠道,方便开发者一站式快速接入多种支付渠道,让百度用户能在智能小程序场景下,直接完成支付、交易闭环,提升用户支付体验的同时,提高智能小程序的订单转化率。 * 2)上述支付渠道在 C 端收银台有两种展示方式,开发者可以选择其中一种实现。 * 方式一:将支付渠道内嵌在小程序提单页面中,实现方式参考文档[inline-payment-panel内嵌支付组件](https://smartprogram.baidu.com/docs/develop/component/inline_payment_panel/)。 * 方式二:在用户确认订单后,调起收银台半屏面板承载支付渠道,实现方式参考文档调起[百度收银台](https://smartprogram.baidu.com/docs/develop/function/tune_up_2.0/#%E7%99%BE%E5%BA%A6%E6%94%B6%E9%93%B6%E5%8F%B0%E6%8E%A5%E5%8F%A32-0-%E8%AF%B4%E6%98%8E)。 - * + * * Web 态说明:为了保证用户交易行为全流程闭环体验,在 Web 态下调用该方法会做打开百度 App 对应小程序页面的降级处理。 * @supported swan * @see https://smartprogram.baidu.com/docs/develop/api/open/payment_swan-requestPolymerPayment/ @@ -136,4 +136,4 @@ declare module '../../index' { */ getOptimalPriceInfo(option: getOptimalPriceInfo.Option): void } -} \ No newline at end of file +} diff --git a/packages/taro/types/api/taro.extend.d.ts b/packages/taro/types/api/taro.extend.d.ts index 9a948e318d7a..4519a77168a8 100644 --- a/packages/taro/types/api/taro.extend.d.ts +++ b/packages/taro/types/api/taro.extend.d.ts @@ -38,13 +38,15 @@ declare module '../index' { /** @ignore */ interface TARO_ENV_TYPE { [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP - [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB - [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD + [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB + [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN + [TaroGeneral.ENV_TYPE.HARMONY]: TaroGeneral.ENV_TYPE.HARMONY + [TaroGeneral.ENV_TYPE.QUICKAPP]: TaroGeneral.ENV_TYPE.QUICKAPP [TaroGeneral.ENV_TYPE.HARMONYHYBRID]: TaroGeneral.ENV_TYPE.HARMONYHYBRID } @@ -98,7 +100,7 @@ declare module '../index' { }): void /** 小程序获取和 Taro 相关的 App 信息 - * @supported weapp, alipay, jd, qq, swan, tt, h5, harmony_hybrid + * @supported weapp, alipay, jd, qq, swan, tt, h5, harmony, harmony_hybrid */ getAppInfo(): getAppInfo.AppInfo diff --git a/packages/taro/types/api/ui/animation.d.ts b/packages/taro/types/api/ui/animation.d.ts index d527889114b6..5339ffd7bef4 100644 --- a/packages/taro/types/api/ui/animation.d.ts +++ b/packages/taro/types/api/ui/animation.d.ts @@ -410,7 +410,7 @@ declare module '../../index' { interface TaroStatic { /** 创建一个动画实例 [animation](../Animation)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。 - * @supported weapp, h5, tt, harmony_hybrid + * @supported weapp, tt, h5, harmony, harmony_hybrid * @example * ```tsx * var animation = Taro.createAnimation({ diff --git a/packages/taro/types/api/ui/interaction.d.ts b/packages/taro/types/api/ui/interaction.d.ts index e14e9b19b9db..d5682a10554f 100644 --- a/packages/taro/types/api/ui/interaction.d.ts +++ b/packages/taro/types/api/ui/interaction.d.ts @@ -160,7 +160,7 @@ declare module '../../index' { * **注意** * - Taro.showLoading 和 Taro.showToast 同时只能显示一个 * - Taro.showToast 应与 Taro.hideToast 配对使用 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * Taro.showToast({ @@ -177,7 +177,7 @@ declare module '../../index' { * **注意** * - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; * - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 - * @supported weapp, swan, h5, rn, tt, harmony_hybrid + * @supported weapp, swan, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * Taro.showModal({ @@ -220,7 +220,7 @@ declare module '../../index' { * **注意** * - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; * - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * Taro.showActionSheet({ diff --git a/packages/taro/types/api/ui/navigation-bar.d.ts b/packages/taro/types/api/ui/navigation-bar.d.ts index 8da578bc504d..d978a3fe2642 100644 --- a/packages/taro/types/api/ui/navigation-bar.d.ts +++ b/packages/taro/types/api/ui/navigation-bar.d.ts @@ -79,13 +79,13 @@ declare module '../../index' { interface TaroStatic { /** 在当前页面显示导航条加载动画 - * @supported weapp, rn, tt + * @supported weapp, rn, tt, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.showNavigationBarLoading.html */ showNavigationBarLoading(option?: showNavigationBarLoading.Option): void /** 动态设置当前页面的标题 - * @supported weapp, alipay, h5, rn, tt, harmony_hybrid + * @supported weapp, alipay, tt, h5, rn, harmony, harmony_hybrid * @example * ```tsx * Taro.setNavigationBarTitle({ @@ -97,7 +97,7 @@ declare module '../../index' { setNavigationBarTitle(option: setNavigationBarTitle.Option): Promise /** 设置页面导航条颜色 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, tt, h5, rn, harmony, harmony_hybrid * @h5 不支持 animation 参数 * @rn 不支持 animation 参数 * @example @@ -116,13 +116,13 @@ declare module '../../index' { setNavigationBarColor(option: setNavigationBarColor.Option): Promise /** 在当前页面隐藏导航条加载动画 - * @supported weapp, rn, tt + * @supported weapp, rn, tt, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideNavigationBarLoading.html */ hideNavigationBarLoading(option?: hideNavigationBarLoading.Option): void /** 隐藏返回首页按钮。微信7.0.7版本起,当用户打开的小程序最底层页面是非首页时,默认展示“返回首页”按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。 - * @supported weapp, tt + * @supported weapp, tt, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideHomeButton.html */ hideHomeButton(option?: hideHomeButton.Option): Promise diff --git a/packages/taro/types/api/ui/pull-down-refresh.d.ts b/packages/taro/types/api/ui/pull-down-refresh.d.ts index 129b9985faf5..ed28fd8a551d 100644 --- a/packages/taro/types/api/ui/pull-down-refresh.d.ts +++ b/packages/taro/types/api/ui/pull-down-refresh.d.ts @@ -25,7 +25,7 @@ declare module '../../index' { interface TaroStatic { /** 停止当前页面下拉刷新。 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * onPullDownRefresh: function (){ @@ -37,7 +37,7 @@ declare module '../../index' { stopPullDownRefresh(option?: stopPullDownRefresh.Option): void /** 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @rn 无动画效果 * @example * ```tsx diff --git a/packages/taro/types/api/ui/scroll.d.ts b/packages/taro/types/api/ui/scroll.d.ts index 3153696825cb..cbc7ae854972 100644 --- a/packages/taro/types/api/ui/scroll.d.ts +++ b/packages/taro/types/api/ui/scroll.d.ts @@ -99,7 +99,7 @@ declare module '../../index' { * - 后代选择器:.the-ancestor .the-descendant * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant * - 多选择器的并集:#a-node, .some-other-nodes - * @supported weapp, h5, rn, tt, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony, harmony_hybrid * @example * ```tsx * Taro.pageScrollTo({ diff --git a/packages/taro/types/api/ui/tab-bar.d.ts b/packages/taro/types/api/ui/tab-bar.d.ts index afca2e227aa8..57e3be1292b6 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_hybrid + * @supported weapp, h5, rn, tt, harmony, 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_hybrid + * @supported weapp, h5, rn, tt, harmony, 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_hybrid + * @supported weapp, h5, rn, tt, harmony, 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_hybrid + * @supported weapp, h5, rn, tt, harmony, 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_hybrid + * @supported weapp, h5, rn, tt, harmony, 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_hybrid + * @supported weapp, h5, rn, tt, harmony, 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_hybrid + * @supported weapp, h5, rn, tt, harmony, 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/api/wxml/index.d.ts b/packages/taro/types/api/wxml/index.d.ts index dc033bf72154..79dabc91e51a 100644 --- a/packages/taro/types/api/wxml/index.d.ts +++ b/packages/taro/types/api/wxml/index.d.ts @@ -66,19 +66,25 @@ declare module '../../index' { } namespace IntersectionObserver { - /** 监听相交状态变化的回调函数 */ + /** 监听相交状态变化的回调函数 + * @description Harmony 找不到对应元素时,回调会返回一个 Error 对象 + */ type ObserveCallback = (result: ObserveCallbackResult) => void - interface ObserveCallbackResult { + interface ObserveCallbackResult extends TaroGeneral.CallbackResult { + /** 错误信息,会在找不到对应元素时返回 + * @supported harmony + */ + errMsg?: string /** 目标边界 */ - boundingClientRect: BoundingClientRectResult + boundingClientRect?: BoundingClientRectResult /** 相交比例 */ - intersectionRatio: number + intersectionRatio?: number /** 相交区域的边界 */ - intersectionRect: IntersectionRectResult + intersectionRect?: IntersectionRectResult /** 参照区域的边界 */ - relativeRect: RelativeRectResult + relativeRect?: RelativeRectResult /** 相交检测时的时间戳 */ - time: number + time?: number } /** 参照区域的边界 */ interface RelativeRectResult { @@ -484,7 +490,7 @@ declare module '../../index' { interface TaroStatic { /** 返回一个 SelectorQuery 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createSelectorQuery()` 来代替。 - * @supported weapp, h5, tt, harmony_hybrid + * @supported weapp, h5, tt, harmony, harmony_hybrid * @example * ```tsx * const query = Taro.createSelectorQuery() @@ -500,7 +506,7 @@ declare module '../../index' { createSelectorQuery(): SelectorQuery /** 创建并返回一个 IntersectionObserver 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createIntersectionObserver([options])` 来代替。 - * @supported weapp, h5, tt, harmony_hybrid + * @supported weapp, h5, tt, harmony, harmony_hybrid * @example * ```tsx * const observer = Taro.createIntersectionObserver(this, { thresholds: [0], observeAll: true }) diff --git a/packages/taro/types/compile/compiler.d.ts b/packages/taro/types/compile/compiler.d.ts index 148fdc9000fe..8a82fc30175e 100644 --- a/packages/taro/types/compile/compiler.d.ts +++ b/packages/taro/types/compile/compiler.d.ts @@ -1,7 +1,11 @@ import type { swc } from '@tarojs/helper' import type Webpack from 'webpack' -type CompilerTypes = 'webpack4' | 'webpack5' +export type CompilerViteTypes = 'vite' + +export type CompilerWebpackTypes = 'webpack5' + +export type CompilerTypes = CompilerWebpackTypes | CompilerViteTypes interface IPrebundle { enable?: boolean @@ -17,11 +21,12 @@ interface IPrebundle { } } -interface ICompiler { - type: CompilerTypes +interface ICompiler { + type: T prebundle?: IPrebundle + vitePlugins?: any /** 错误处理级别。可选值:0、1 */ errorLevel?: number } -export type Compiler = CompilerTypes | ICompiler +export type Compiler = T | ICompiler diff --git a/packages/taro/types/compile/config/h5.d.ts b/packages/taro/types/compile/config/h5.d.ts index 5aeaec609640..088d4164c5c1 100644 --- a/packages/taro/types/compile/config/h5.d.ts +++ b/packages/taro/types/compile/config/h5.d.ts @@ -2,7 +2,10 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' import type webpackDevServer from 'webpack-dev-server' import type HtmlWebpackPlugin from 'html-webpack-plugin' -import type { IOption, IPostcssOption } from './util' +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' export interface IH5RouterConfig { /** 配置路由模式 */ @@ -14,9 +17,11 @@ export interface IH5RouterConfig { lazyload?: boolean | ((pagename: string) => boolean) renamePagename?: (pagename: string) => string forcePath?: string + /** 加上这个参数,可以解决返回页面的时候白屏的问题,但是某些不支持 :has() 选择器的浏览器会有问题 */ + enhanceAnimation?: boolean } -export interface IH5Config { +export interface IH5Config { /** 设置输出解析文件的目录(默认值:'/')*/ publicPath?: string @@ -35,8 +40,12 @@ export interface IH5Config { */ webpackChain?: (chain: Chain, webpack: typeof Webpack) => void - /** 可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/) */ - output?: Webpack.Configuration['output'] + /** webpack 编译模式下,可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/) + * vite 编译模式下,用于修改、扩展 rollup 的 output,目前仅适配 chunkFileNames 和 assetFileNames 两个配置,修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/) + */ + output?: T extends 'vite' + ? Pick & OutputExt + : Webpack.Configuration['output'] /** 路由相关的配置 */ router?: IH5RouterConfig @@ -82,13 +91,13 @@ export interface IH5Config { stylusLoaderOption?: IOption /** 针对 mp4 | webm | ogg | mp3 | wav | flac | aac 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - mediaUrlLoaderOption?: IOption + mediaUrlLoaderOption?: IUrlLoaderOption /** 针对 woff | woff2 | eot | ttf | otf 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - fontUrlLoaderOption?: IOption + fontUrlLoaderOption?: IUrlLoaderOption /** 针对 png | jpg | jpeg | gif | bpm | svg 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - imageUrlLoaderOption?: IOption + imageUrlLoaderOption?: IUrlLoaderOption /** [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) 的附加配置 */ miniCssExtractPluginOption?: IOption @@ -103,14 +112,20 @@ export interface IH5Config { useDeprecatedAdapterComponent?: boolean /** 配置 postcss 相关插件 */ - postcss?: IPostcssOption + postcss?: IPostcssOption<'h5'> /** html-webpack-plugin 的具体配置 */ htmlPluginOption?: HtmlWebpackPlugin.Options /** Web 编译过程的相关配置 */ compile?: { - exclude?: any[] - include?: any[] + exclude?: (string | RegExp)[] + include?: (string | RegExp)[] + filter?: (filename: string) => boolean } + /** 生成的代码是否要兼容旧版浏览器,值为 true 时,会去读取 package.json 的 browserslist 字段。只在 vite 编译模式下有效 */ + legacy?: T extends 'vite' ? boolean : undefined + + /** 使用的编译工具。可选值:webpack5、vite */ + compiler?: Compiler } diff --git a/packages/taro/types/compile/config/harmony.d.ts b/packages/taro/types/compile/config/harmony.d.ts new file mode 100644 index 000000000000..f042e22c576c --- /dev/null +++ b/packages/taro/types/compile/config/harmony.d.ts @@ -0,0 +1,118 @@ +import type { OutputOptions as RollupOutputOptions } from 'rollup' +import type Webpack from 'webpack' +import type Chain from 'webpack-chain' + +import type { IOption, IPostcssOption, IUrlLoaderOption } from './util' +import type { CompilerTypes, CompilerWebpackTypes } from '../compiler' +import type { OutputExt } from './project' + +export interface IHarmonyRouterConfig { + /** 配置自定义路由 */ + customRoutes?: IOption +} + +export interface IHarmonyConfig { + /** Harmony 项目地址 */ + projectPath: string + + /** hap 名 + * @default "entry" + */ + hapName?: string + + /** 应用名称 + * @default "default" + */ + name?: string + + /** oh-package.json 配置 */ + ohPackage?: { + dependencies?: { [name: string]: string } + devDependencies?: { [name: string]: string } + main?: string + [k: string]: any + } + + /** ohpm-cli + * @default "~/Library/Huawei/ohpm/bin/ohpm" + */ + ohpm?: string + + /** 核心依赖前缀 + * @description 用于告诉编译内容如何解析核心依赖,传入时将直接使用依赖前缀,同时不会为工程导入核心依赖 + */ + chorePackagePrefix?: string + + /** 用于告诉 Taro 编译器需要抽取的公共文件 */ + commonChunks?: string[] | ((commonChunks: string[]) => string[]) + + /** Harmony 编译过程的相关配置 */ + compile?: { + exclude?: any[] + include?: any[] + filter?: (filename: string) => boolean + } + + /** 用于配置半编译模式下的选项 */ + compileModeSetting?: { + componentReplace?: { + [key: string]: { + current_init: string + dependency_define: string + } + } + } + + /** 用于控制是否生成 js、css 对应的 sourceMap (默认值:watch 模式下为 true,否则为 false) */ + enableSourceMap?: boolean + + /** 默认值:'cheap-module-source-map', 具体参考[Webpack devtool 配置](https://webpack.js.org/configuration/devtool/#devtool) */ + sourceMapType?: string + + /** 指定 React 框架相关的代码是否使用开发环境(未压缩)代码,默认使用生产环境(压缩后)代码 */ + debugReact?: boolean + + /** + * 自定义 Webpack 配置 + * @param chain [webpackChain](https://github.com/neutrinojs/webpack-chain) 对象 + * @param webpack webpack 实例 + */ + webpackChain?: (chain: Chain, webpack: typeof Webpack) => void + + /** webpack 编译模式下,可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/) + * vite 编译模式下,用于修改、扩展 rollup 的 output,目前仅适配 chunkFileNames 和 assetFileNames 两个配置,修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/) + */ + output?: T extends 'vite' + ? Pick & OutputExt + : Webpack.Configuration['output'] & OutputExt + + /** 路由相关的配置 */ + router?: IHarmonyRouterConfig + + /** 配置 postcss 相关插件 */ + postcss?: IPostcssOption<'harmony'> + + /** [css-loader](https://github.com/webpack-contrib/css-loader) 的附加配置 */ + cssLoaderOption?: IOption + + /** [sass-loader](https://github.com/webpack-contrib/sass-loader) 的附加配置 */ + sassLoaderOption?: IOption + + /** [less-loader](https://github.com/webpack-contrib/less-loader) 的附加配置 */ + lessLoaderOption?: IOption + + /** [stylus-loader](https://github.com/shama/stylus-loader) 的附加配置 */ + stylusLoaderOption?: IOption + + /** 针对 mp4 | webm | ogg | mp3 | wav | flac | aac 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ + mediaUrlLoaderOption?: IUrlLoaderOption + + /** 针对 woff | woff2 | eot | ttf | otf 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ + fontUrlLoaderOption?: IUrlLoaderOption + + /** 针对 png | jpg | jpeg | gif | bpm | svg 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ + imageUrlLoaderOption?: IUrlLoaderOption + + /** [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) 的附加配置 */ + miniCssExtractPluginOption?: IOption +} diff --git a/packages/taro/types/compile/config/index.d.ts b/packages/taro/types/compile/config/index.d.ts index 97fb95fc56a9..543da6a95253 100644 --- a/packages/taro/types/compile/config/index.d.ts +++ b/packages/taro/types/compile/config/index.d.ts @@ -1,5 +1,7 @@ export * from './h5' +export * from './harmony' export * from './mini' +export * from './rn' export * from './manifest' export * from './project' diff --git a/packages/taro/types/compile/config/mini.d.ts b/packages/taro/types/compile/config/mini.d.ts index 04c1ff3f8312..d3cad4e908b6 100644 --- a/packages/taro/types/compile/config/mini.d.ts +++ b/packages/taro/types/compile/config/mini.d.ts @@ -1,6 +1,9 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' -import type { IOption, IPostcssOption } from './util' +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' interface Runtime { enableInnerHTML?: boolean @@ -12,7 +15,7 @@ interface Runtime { enableMutationObserver?: boolean } -export interface IMiniAppConfig { +export interface IMiniAppConfig { /** 用于控制是否生成 js、css 对应的 sourceMap (默认值:watch 模式下为 true,否则为 false) */ enableSourceMap?: boolean @@ -40,24 +43,15 @@ export interface IMiniAppConfig { */ webpackChain?: (chain: Chain, webpack: typeof Webpack, PARSE_AST_TYPE: any) => void - /** 可用于修改、拓展 Webpack 的 [output](https://webpack.js.org/configuration/output/) 选项 */ - output?: Webpack.Configuration['output'] & { - /** - * 编译前清空输出目录 - * @since Taro v3.6.9 - * @description - * - 默认清空输出目录,可设置 clean: false 不清空 - * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件 - * - 注意 clean.keep 不支持函数 - */ - clean?: boolean | { - /** 保留指定文件不删除 */ - keep?: Array | string | RegExp - } - } + /** webpack 编译模式下,可用于修改、拓展 Webpack 的 output 选项,配置项参考[官方文档](https://webpack.js.org/configuration/output/) + * vite 编译模式下,用于修改、扩展 rollup 的 output,目前仅适配 chunkFileNames 和 assetFileNames 两个配置,修改其他配置请使用 vite 插件进行修改。配置想参考[官方文档](https://rollupjs.org/configuration-options/) + */ + output?: T extends 'vite' + ? Pick & OutputExt + : Webpack.Configuration['output'] & OutputExt /** 配置 postcss 相关插件 */ - postcss?: IPostcssOption + postcss?: IPostcssOption<'mini'> /** [css-loader](https://github.com/webpack-contrib/css-loader) 的附加配置 */ cssLoaderOption?: IOption @@ -72,13 +66,13 @@ export interface IMiniAppConfig { stylusLoaderOption?: IOption /** 针对 mp4 | webm | ogg | mp3 | wav | flac | aac 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - mediaUrlLoaderOption?: IOption + mediaUrlLoaderOption?: IUrlLoaderOption /** 针对 woff | woff2 | eot | ttf | otf 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - fontUrlLoaderOption?: IOption + fontUrlLoaderOption?: IUrlLoaderOption /** 针对 png | jpg | jpeg | gif | bpm | svg 文件的 [url-loader](https://github.com/webpack-contrib/url-loader) 配置 */ - imageUrlLoaderOption?: IOption + imageUrlLoaderOption?: IUrlLoaderOption /** [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) 的附加配置 */ miniCssExtractPluginOption?: IOption @@ -97,16 +91,27 @@ export interface IMiniAppConfig { /** 小程序编译过程的相关配置 */ compile?: { - exclude?: any[] - include?: any[] + exclude?: (string | RegExp)[] + include?: (string | RegExp)[] + filter?: (filename: string) => boolean } /** 插件内部使用 */ runtime?: Runtime + /** 使用的编译工具。可选值:webpack5、vite */ + compiler?: Compiler + /** 体验式功能 */ experimental?: { /** 是否开启编译模式 */ - compileMode?: boolean + compileMode?: boolean | string + } +} + +export interface IMiniFilesConfig { + [configName: string]: { + content: any + path: string } } diff --git a/packages/taro/types/compile/config/plugin.d.ts b/packages/taro/types/compile/config/plugin.d.ts new file mode 100644 index 000000000000..f8c82c6776d5 --- /dev/null +++ b/packages/taro/types/compile/config/plugin.d.ts @@ -0,0 +1,34 @@ +import type { CustomPluginOptions, ResolvedId, ResolveIdResult } from 'rollup' + +interface IRollupPluginResolveIdOptions { + assertions?: Record + custom?: CustomPluginOptions + isEntry?: boolean + skipSelf?: boolean +} + +export type TRollupResolveMethod = ( + source: string, + importer?: string, + options?: IRollupPluginResolveIdOptions +) => Promise + +export interface ILoaderMeta { + importFrameworkStatement: string + importFrameworkName: string + creator: string + creatorLocation: string + extraImportForWeb: string + execBeforeCreateWebApp: string + frameworkArgs: string + isNeedRawLoader?: boolean + mockAppStatement: string + modifyConfig?: (config: Record, source: string) => void + modifyResolveId?: (res: { + source?: string + importer?: string + options?: IRollupPluginResolveIdOptions + name?: string + resolve: TRollupResolveMethod + }) => Promise | ResolveIdResult +} diff --git a/packages/taro/types/compile/config/project.d.ts b/packages/taro/types/compile/config/project.d.ts index 12ef67dd465f..6905e408cd9b 100644 --- a/packages/taro/types/compile/config/project.d.ts +++ b/packages/taro/types/compile/config/project.d.ts @@ -1,13 +1,14 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' -import { type Input } from 'postcss' -import type { Compiler } from '../compiler' +import type { Input } from 'postcss' +import type { AppConfig } from '../../index' +import type { Compiler, CompilerTypes, CompilerWebpackTypes } from '../compiler' import type { IModifyChainData } from '../hooks' import type { ICopyOptions, IOption, ISassOptions, TogglableOptions } from './util' import type { IH5Config } from './h5' -import type { IMiniAppConfig } from './mini' -import { IRNConfig } from './rn' -import { AppConfig } from '../..' +import type { IHarmonyConfig } from './harmony' +import type { IMiniAppConfig, IMiniFilesConfig } from './mini' +import type { IRNConfig } from './rn' export type PluginItem = string | [string, T] | [string, () => T | Promise] @@ -115,7 +116,7 @@ export interface IProjectBaseConfig { jsMinimizer?: 'terser' | 'esbuild' /** 配置 CSS 压缩工具 (默认 csso) */ - cssMinimizer?: 'csso' | 'esbuild' | 'parcelCss' + cssMinimizer?: 'csso' | 'esbuild' | 'lightningcss' /** 配置 csso 工具以压缩 CSS 代码 */ csso?: TogglableOptions @@ -139,11 +140,11 @@ export interface IProjectBaseConfig { /** 模板循环次数 */ baseLevel?: number - /** 使用的开发框架。可选值:react、preact、nerv、vue、vue3 */ - framework?: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3' + /** 使用的开发框架。可选值:react、preact、vue3 */ + framework?: 'react' | 'preact' | 'solid' | 'vue3' frameworkExts?: string[] - /** 使用的编译工具。可选值:webpack4、webpack5 */ + /** 使用的编译工具。可选值:webpack5 */ compiler?: Compiler /** Webpack5 持久化缓存配置。具体配置请参考 [WebpackConfig.cache](https://webpack.js.org/configuration/cache/#cache) */ @@ -185,18 +186,28 @@ export interface IProjectBaseConfig { modifyWebpackChain?: (chain: Chain, webpack: typeof Webpack, data: IModifyChainData) => Promise /** - * 修改编译过程中的页面组件配置 + * 编译中修改 vite 配置 */ - modifyMiniConfigs?: (configMap: any) => Promise + modifyViteConfig?: (viteConfig: any, data: IModifyChainData) => void /** * 修改编译后的结果 */ modifyBuildAssets?: (assets: any, miniPlugin?: any) => Promise + + /** + * 修改编译过程中的页面组件配置 + */ + modifyMiniConfigs?: (configMap: IMiniFilesConfig) => Promise + + /** + * 修改 Taro 编译配置 + */ + modifyRunnerOpts?: (opts: any) => Promise } /** 暴露出来给 config/index 使用的配置类型,参考 https://github.com/NervJS/taro-doctor/blob/main/assets/config_schema.json */ -export interface IProjectConfig { +export interface IProjectConfig { /** 项目名称 */ projectName?: string @@ -266,7 +277,7 @@ export interface IProjectConfig { jsMinimizer?: 'terser' | 'esbuild' /** 配置 CSS 压缩工具 (默认 csso) */ - cssMinimizer?: 'csso' | 'esbuild' | 'parcelCss' + cssMinimizer?: 'csso' | 'esbuild' | 'lightningcss' /** 配置 csso 工具以压缩 CSS 代码 */ csso?: TogglableOptions @@ -285,11 +296,8 @@ export interface IProjectConfig { /** 一个 preset 是一系列 Taro 插件的集合,配置语法同 plugins */ presets?: PluginItem[] - /** 使用的开发框架。可选值:react、preact、nerv、vue、vue3 */ - framework?: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3' - - /** 使用的编译工具。可选值:webpack4、webpack5 */ - compiler?: Compiler + /** 使用的开发框架。可选值:react、preact、solid、vue3、 none */ + framework?: 'react' | 'preact' | 'solid' | 'vue3' | 'none' /** Webpack5 持久化缓存配置。具体配置请参考 [WebpackConfig.cache](https://webpack.js.org/configuration/cache/#cache) */ cache?: ICache @@ -297,14 +305,34 @@ export interface IProjectConfig { /** 控制 Taro 编译日志的输出方式 */ logger?: ILogger - /** 专属于小程序的配置 */ - mini?: IMiniAppConfig + /** 使用的编译工具。可选值:webpack5、vite */ + compiler?: Compiler /** 专属于 H5 的配置 */ - h5?: IH5Config + h5?: IH5Config + + /** 专属于小程序的配置 */ + mini?: IMiniAppConfig /** 专属于 RN 的配置 */ rn?: IRNConfig + harmony?: IHarmonyConfig + [key: string]: any } + +export interface OutputExt { + /** + * 编译前清空输出目录 + * @since Taro v3.6.9 + * @description + * - 默认清空输出目录,可设置 clean: false 不清空 + * - 可设置 clean: { keep: ['project.config.json'] } 保留指定文件 + * - 注意 clean.keep 不支持函数 + */ + clean?: boolean | { + /** 保留指定文件不删除 */ + keep?: Array | string | RegExp + } +} diff --git a/packages/taro/types/compile/config/rn.d.ts b/packages/taro/types/compile/config/rn.d.ts index a7a481e261fd..90d16d586272 100644 --- a/packages/taro/types/compile/config/rn.d.ts +++ b/packages/taro/types/compile/config/rn.d.ts @@ -2,6 +2,7 @@ import type Webpack from 'webpack' import type Chain from 'webpack-chain' import type webpackDevServer from 'webpack-dev-server' import type HtmlWebpackPlugin from 'html-webpack-plugin' +import type { RollupOptions } from 'rollup' import type { IOption, IPostcssOption } from './util' export interface IRNConfig { @@ -61,4 +62,24 @@ export interface IRNConfig { /** 设计稿尺寸换算规则 */ deviceRatio?: TaroGeneral.TDeviceRatio + + /** 原生组件编译配置 */ + nativeComponents?: { + /** + * 外部依赖 + */ + external?: Array | ((arr: Array) => Array) + /** + * 设置外部依赖,如果返回 string, 则将该值作为 external, 我们默认将 node_modules 路径下的文件设置为外部依赖 + */ + exteranlResolve?: (importee: string, importer: string) => string + /** + * 组件输出路径,默认值为 'dist' + */ + output?: string + /** + * 修改 Rollup 打包配置 + */ + modifyRollupConfig?: (config: RollupOptions, innerPlugins: { taroResolver: typeof taroResolver, styleTransformer: typeof styleTransformer }) => RollupOptions + } } diff --git a/packages/taro/types/compile/config/util.d.ts b/packages/taro/types/compile/config/util.d.ts index 7729464a10a6..3643c5e58c2b 100644 --- a/packages/taro/types/compile/config/util.d.ts +++ b/packages/taro/types/compile/config/util.d.ts @@ -1,4 +1,5 @@ -import { type Input } from 'postcss' +import type { Input } from 'postcss' +import type { Options as PostcssUrlOption } from 'postcss-url' export type Func = (...args: any[]) => any @@ -9,6 +10,11 @@ export type TogglableOptions = { config?: T } +export interface IUrlLoaderOption extends IOption { + limit?: number | boolean + name?: ((moduleId: string) => string) | string +} + export namespace PostcssOption { export type cssModules = TogglableOptions<{ /** 转换模式,取值为 global/module */ @@ -16,10 +22,7 @@ export namespace PostcssOption { /** 自定义生成的class名称规则 */ generateScopedName: string | ((localName: string, absoluteFilePath: string) => string) }> - export type url = TogglableOptions<{ - limit: number - basePath?: string | string[] - }> + export type url = TogglableOptions } export interface IHtmlTransformOption { @@ -72,18 +75,29 @@ export interface IPxTransformOption { designWidth?: number | ((size?: string | number | Input) => number) /** 设计稿尺寸换算规则 */ deviceRatio?: TaroGeneral.TDeviceRatio + /** 平台 */ + platform?: 'weapp' | 'h5' | string + /** 启用的能力 Scope 默认为 ['platform', 'size'] */ + methods?: string[] + /** filter 回调函数,可 exclude 不处理的文件 */ + exclude?: (fileName: string) => boolean } -export interface IPostcssOption { +interface IBasePostcssOption { autoprefixer?: TogglableOptions pxtransform?: TogglableOptions cssModules?: PostcssOption.cssModules - url?: PostcssOption.url /** 插件 postcss-html-transform 相关配置, 一般启用了 @tarojs/plugin-html 插件才配置 */ htmltransform?: IHtmlTransformOption [key: string]: any } +export type IPostcssOption = T extends 'h5' + ? IBasePostcssOption & { url?: PostcssOption.url } + : IBasePostcssOption + +export type Config = ViteConfig | WebpackConfig + export interface ICopyOptions { patterns: { from: string diff --git a/packages/taro/types/compile/index.d.ts b/packages/taro/types/compile/index.d.ts index 8d887a2d88bc..8310943aace3 100644 --- a/packages/taro/types/compile/index.d.ts +++ b/packages/taro/types/compile/index.d.ts @@ -1,3 +1,11 @@ export { Current } from '@tarojs/runtime' +export interface IFileType { + style: string + script: string + templ: string + config: string + xs?: string +} + export * from './config' diff --git a/packages/taro/types/compile/viteCompilerContext.d.ts b/packages/taro/types/compile/viteCompilerContext.d.ts new file mode 100644 index 000000000000..48f11ede8203 --- /dev/null +++ b/packages/taro/types/compile/viteCompilerContext.d.ts @@ -0,0 +1,159 @@ +import type { RecursiveTemplate, UnRecursiveTemplate } from '@tarojs/shared/dist/template' + +import type { PluginContext } from 'rollup' +import type { IMiniFilesConfig, IH5Config, IHarmonyConfig, IMiniAppConfig } from './config' +import type { IProjectConfig } from './config/project' +import type { IComponentConfig } from './hooks' +import type { IFileType } from './index' +import type { AppConfig, PageConfig } from '../index' + +export interface ViteNativeCompMeta { + name: string + scriptPath: string + configPath: string + config: PageConfig + isNative: true + templatePath: string + cssPath?: string + isPackage?: boolean +} + +export interface ViteFileType { + config: string + script: string + templ: string + style: string + xs?: string +} + +export interface ViteAppMeta { + name: string + scriptPath: string + configPath: string + config: AppConfig + isNative: false +} + +export interface VitePageMeta { + name: string + scriptPath: string + configPath: string + config: PageConfig + isNative: boolean + templatePath?: string + cssPath?: string +} + +export interface ViteH5BuildConfig extends CommonBuildConfig, IH5Config<'vite'> { + entryFileName?: string + runtimePath?: string | string[] +} + +export interface ViteHarmonyBuildConfig extends CommonBuildConfig, IHarmonyConfig { + fileType: IFileType + useETS?: boolean + useJSON5?: boolean + blended?: boolean + runtimePath?: string | string[] + isPure?: boolean + taroComponentsPath: string +} + +export interface CommonBuildConfig extends IProjectConfig<'vite'> { + entry: { + app: string | string[] + } + mode: 'production' | 'development' | 'none' + buildAdapter: string // weapp | swan | alipay | tt | qq | jd | h5 + platformType: string // mini | web + /** special mode */ + isBuildNativeComp?: boolean + /** hooks */ + onCompilerMake: (compilation) => Promise + onParseCreateElement: (nodeName, componentConfig) => Promise +} + + +export interface ViteMiniBuildConfig extends CommonBuildConfig, IMiniAppConfig<'vite'> { + isBuildPlugin: boolean + isSupportRecursive: boolean + isSupportXS: boolean + nodeModulesPath: string + fileType: ViteFileType + globalObject: string + template: RecursiveTemplate | UnRecursiveTemplate + runtimePath?: string | string[] + taroComponentsPath: string + blended?: boolean + hot?: boolean + injectOptions?: { + include?: Record + exclude?: string[] + } + /** hooks */ + modifyComponentConfig: (componentConfig: IComponentConfig, config: Partial) => Promise +} + +export interface ViteCompilerContext { + cwd: string + sourceDir: string + taroConfig: T + rawTaroConfig: T + frameworkExts: string[] + app: ViteAppMeta + pages: VitePageMeta[] + components?: VitePageMeta[] + loaderMeta: any + logger + filesConfig: IMiniFilesConfig + configFileList: string[] + compilePage: (pageName: string) => VitePageMeta + watchConfigFile: (rollupCtx: PluginContext) => void + getAppScriptPath: () => string + getApp: () => ViteAppMeta + getPages: () => VitePageMeta[] + isApp: (id: string) => boolean + isPage: (id: string) => boolean + isComponent: (id: string) => boolean + isNativePageORComponent: (templatePath: string) => boolean + getPageById: (id: string) => VitePageMeta| undefined + getComponentById: (id: string) => VitePageMeta| undefined + getConfigFilePath: (filePath: string) => string + getTargetFilePath: (filePath: string, targetExtName: string) => string +} + +export interface ViteH5CompilerContext extends ViteCompilerContext { + getBrowserslist: () => void + routerMeta: { + routerCreator: string + getRoutesConfig: (pageName?: string) => string + } + browserslist: string[] +} + +export interface ViteHarmonyCompilerContext extends ViteCompilerContext { + nativeExt: string[] + fileType: ViteFileType + commonChunks: string[] + extraComponents: string[] + nativeComponents : Map + getCommonChunks: () => string[] + modifyHarmonyConfig: (config: Partial) => void + modifyHostPackage: (deps?: Record, devDeps?: Record) => Exclude + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + getScriptPath: (filePath: string) => string + getStylePath: (filePath: string) => string + getConfigPath: (filePath: string) => string +} + +export interface ViteMiniCompilerContext extends ViteCompilerContext { + fileType: ViteFileType + commonChunks: string[] + nativeComponents : Map + getCommonChunks: () => string[] + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + getScriptPath: (filePath: string) => string + getTemplatePath: (filePath: string) => string + getStylePath: (filePath: string) => string + getConfigPath: (filePath: string) => string +} diff --git a/packages/taro/types/index.d.ts b/packages/taro/types/index.d.ts index 5623c3254ae0..da8ec8360884 100644 --- a/packages/taro/types/index.d.ts +++ b/packages/taro/types/index.d.ts @@ -187,7 +187,6 @@ export as namespace Taro declare const Taro: Taro.TaroStatic declare namespace Taro { - // eslint-disable-next-line @typescript-eslint/no-empty-interface interface TaroStatic {} } declare global { diff --git a/packages/taro/types/taro.component.d.ts b/packages/taro/types/taro.component.d.ts index 0d0a4c502728..d1d36c31a059 100644 --- a/packages/taro/types/taro.component.d.ts +++ b/packages/taro/types/taro.component.d.ts @@ -19,6 +19,7 @@ declare module './index' { shareTicket: string | undefined scene: number | undefined exitState?: any + $taroPath?: string } interface Show { diff --git a/packages/taro/types/taro.config.d.ts b/packages/taro/types/taro.config.d.ts index d5681eb0c0ba..1bae7fbde63f 100644 --- a/packages/taro/types/taro.config.d.ts +++ b/packages/taro/types/taro.config.d.ts @@ -32,6 +32,11 @@ declare module './index' { * @default: "#ffffff" */ backgroundColor?: string + /** 页面容器背景色, HexColor + * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html#%E8%AE%BE%E7%BD%AE%E9%A1%B5%E9%9D%A2%E9%80%8F%E6%98%8E + * @default: "#ffffff" + */ + backgroundColorContent?: string /** 下拉背景字体、loading 图的样式,仅支持 dark/light * 当 app.json 中配置 darkmode 为 true 时可通过变量的形式配置 * @see: https://developers.weixin.qq.com/miniprogram/dev/framework/ability/darkmode.html