├── versions.json ├── static ├── img │ ├── favicon.ico │ ├── logo-taro.png │ ├── o2logo@2x.png │ ├── platform │ │ ├── h5.png │ │ ├── jd.png │ │ ├── qq.png │ │ ├── rn.png │ │ ├── tt.png │ │ ├── alipay.png │ │ ├── swan.png │ │ ├── weapp.png │ │ ├── harmony.png │ │ └── quickapp.png │ ├── taroLogo180.png │ ├── taroLogo@2x.png │ ├── favicon │ │ └── favicon.ico │ ├── team-structure.png │ └── icons │ │ ├── icon-48x48.png │ │ ├── icon-72x72.png │ │ ├── icon-96x96.png │ │ ├── icon-128x128.png │ │ ├── icon-144x144.png │ │ ├── icon-152x152.png │ │ ├── icon-192x192.png │ │ ├── icon-196x196.png │ │ ├── icon-384x384.png │ │ ├── icon-512x512.png │ │ └── maskable_icon.png └── css │ └── platform.css ├── typings ├── modules.d.ts └── github.d.ts ├── babel.config.js ├── docs ├── apis │ ├── framework │ │ ├── App.md │ │ └── Page.md │ ├── base │ │ ├── env.md │ │ ├── preload.md │ │ ├── env │ │ │ └── env.md │ │ └── crypto │ │ │ └── getUserCryptoManager.md │ ├── canvas │ │ ├── createContext.md │ │ ├── drawCanvas.md │ │ ├── Path2D.md │ │ └── createOffscreenCanvas.md │ ├── about │ │ └── env.md │ ├── device │ │ ├── ibeacon │ │ │ └── IBeaconInfo.md │ │ ├── wifi │ │ │ └── WifiInfo.md │ │ └── nfc │ │ │ └── getNFCAdapter.md │ ├── ui │ │ └── interaction │ │ │ └── enableAlertBeforeUnload.md │ ├── media │ │ ├── video-decoder │ │ │ └── createVideoDecoder.md │ │ ├── video-processing │ │ │ └── createMediaContainer.md │ │ └── media-recorder │ │ │ └── createMediaRecorder.md │ ├── open-api │ │ └── card │ │ │ └── card.md │ ├── network │ │ └── udp │ │ │ └── createUDPSocket.md │ └── payment │ │ └── faceVerifyForPay.md ├── components │ ├── event.md │ └── open │ │ └── others.md ├── team │ ├── team-community.mdx │ ├── role-collaborator.mdx │ ├── role-committer.mdx │ ├── role-committee.mdx │ ├── team-innovate.mdx │ ├── role-triage.mdx │ ├── team-core.mdx │ ├── team-plugin.mdx │ └── team-platform.mdx ├── specials.md ├── mini-troubleshooting.md ├── taroize.md └── mdx │ └── image-list.tsx ├── versioned_docs ├── version-2.x │ ├── apis │ │ ├── framework │ │ │ ├── App.md │ │ │ ├── Page.md │ │ │ └── getCurrentPages.md │ │ ├── canvas │ │ │ ├── createContext.md │ │ │ ├── drawCanvas.md │ │ │ ├── createOffscreenCanvas.md │ │ │ └── RenderingContext.md │ │ ├── base │ │ │ ├── env │ │ │ │ └── env.md │ │ │ ├── debug │ │ │ │ └── getRealtimeLogManager.md │ │ │ └── weapp │ │ │ │ └── life-cycle │ │ │ │ └── getLaunchOptionsSync.md │ │ ├── about │ │ │ └── env.md │ │ ├── files │ │ │ └── getFileSystemManager.md │ │ ├── media │ │ │ ├── video-processing │ │ │ │ └── createMediaContainer.md │ │ │ ├── camera │ │ │ │ └── createCameraContext.md │ │ │ └── live │ │ │ │ └── createLivePusherContext.md │ │ ├── alipay │ │ │ └── getOpenUserInfo.md │ │ ├── network │ │ │ └── udp │ │ │ │ └── createUDPSocket.md │ │ ├── open-api │ │ │ ├── payment │ │ │ │ └── faceVerifyForPay.md │ │ │ └── card │ │ │ │ └── card.md │ │ ├── storage │ │ │ └── clearStorageSync.md │ │ └── device │ │ │ └── wifi │ │ │ └── WifiInfo.md │ ├── learn.md │ ├── hybrid.md │ ├── specials.md │ ├── components │ │ ├── open │ │ │ └── others.md │ │ └── forms │ │ │ └── picker-view-column.md │ └── envs-debug.md ├── version-3.x │ ├── apis │ │ ├── framework │ │ │ ├── App.md │ │ │ └── Page.md │ │ ├── base │ │ │ ├── env.md │ │ │ ├── preload.md │ │ │ ├── env │ │ │ │ └── env.md │ │ │ └── crypto │ │ │ │ └── getUserCryptoManager.md │ │ ├── canvas │ │ │ ├── createContext.md │ │ │ ├── drawCanvas.md │ │ │ ├── Path2D.md │ │ │ └── createOffscreenCanvas.md │ │ ├── about │ │ │ └── env.md │ │ ├── device │ │ │ ├── ibeacon │ │ │ │ └── IBeaconInfo.md │ │ │ └── wifi │ │ │ │ └── WifiInfo.md │ │ ├── ui │ │ │ └── interaction │ │ │ │ └── enableAlertBeforeUnload.md │ │ ├── media │ │ │ ├── video-decoder │ │ │ │ └── createVideoDecoder.md │ │ │ ├── video-processing │ │ │ │ └── createMediaContainer.md │ │ │ └── media-recorder │ │ │ │ └── createMediaRecorder.md │ │ └── open-api │ │ │ └── card │ │ │ └── card.md │ ├── components │ │ ├── event.md │ │ └── open │ │ │ └── others.md │ ├── team │ │ ├── team-community.mdx │ │ ├── role-collaborator.mdx │ │ ├── role-committer.mdx │ │ ├── role-committee.mdx │ │ ├── team-innovate.mdx │ │ ├── role-triage.mdx │ │ ├── team-core.mdx │ │ ├── team-plugin.mdx │ │ └── team-platform.mdx │ ├── specials.md │ ├── mini-troubleshooting.md │ ├── taroize.md │ └── mdx │ │ └── image-list.tsx └── version-1.x │ ├── apis │ ├── interface │ │ ├── interactives │ │ │ ├── hideToast.md │ │ │ └── hideLoading.md │ │ ├── canvas │ │ │ ├── createContext.md │ │ │ ├── drawCanvas.md │ │ │ └── createCanvasContext.md │ │ ├── navigationbar │ │ │ ├── hideNavigationBarLoading.md │ │ │ └── showNavigationBarLoading.md │ │ ├── navigation │ │ │ ├── reLaunch.md │ │ │ ├── navigateBack.md │ │ │ ├── switchTab.md │ │ │ ├── navigateTo.md │ │ │ ├── redirectTo.md │ │ │ └── getCurrentPages.md │ │ ├── topbar │ │ │ └── setTopBarText.md │ │ ├── tabbar │ │ │ ├── setTabBarItem.md │ │ │ ├── setTabBarBadge.md │ │ │ ├── setTabBarStyle.md │ │ │ ├── hideTabBar.md │ │ │ ├── hideTabBarRedDot.md │ │ │ ├── showTabBar.md │ │ │ ├── showTabBarRedDot.md │ │ │ └── removeTabBarBadge.md │ │ ├── window │ │ │ ├── offWindowResize.md │ │ │ └── onWindowResize.md │ │ ├── animation │ │ │ └── createAnimation.md │ │ ├── wxml │ │ │ ├── selectorQuery_exec.md │ │ │ ├── createIntersectionObserver.md │ │ │ ├── selectorQuery_selectViewport.md │ │ │ └── selectorQuery_selectAll.md │ │ └── pulldownrefresh │ │ │ └── stopPullDownRefresh.md │ ├── multimedia │ │ ├── backgroundaudio │ │ │ ├── onBackgroundAudioPlay.md │ │ │ ├── onBackgroundAudioStop.md │ │ │ ├── onBackgroundAudioPause.md │ │ │ ├── stopBackgroundAudio.md │ │ │ ├── pauseBackgroundAudio.md │ │ │ ├── getBackgroundAudioManager.md │ │ │ ├── playBackgroundAudio.md │ │ │ ├── seekBackgroundAudio.md │ │ │ └── getBackgroundAudioPlayerState.md │ │ ├── audio │ │ │ ├── playVoice.md │ │ │ ├── stopVoice.md │ │ │ ├── createAudioContext.md │ │ │ └── pauseVoice.md │ │ ├── map │ │ │ └── createMapContext.md │ │ ├── camera │ │ │ └── createCameraContext.md │ │ ├── video │ │ │ ├── saveVideoToPhotosAlbum.md │ │ │ └── chooseVideo.md │ │ ├── images │ │ │ └── saveImageToPhotosAlbum.md │ │ └── recording │ │ │ └── stopRecord.md │ ├── about │ │ └── env.md │ ├── device │ │ ├── nfc │ │ │ ├── onHCEMessage.md │ │ │ ├── stopHCE.md │ │ │ ├── startHCE.md │ │ │ ├── getHCEState.md │ │ │ └── sendHCEMessage.md │ │ ├── wifi │ │ │ ├── onGetWifiList.md │ │ │ ├── onWifiConnected.md │ │ │ ├── stopWifi.md │ │ │ ├── startWifi.md │ │ │ ├── connectWifi.md │ │ │ ├── setWifiList.md │ │ │ ├── getConnectedWifi.md │ │ │ └── getWifiList.md │ │ ├── ibeacon │ │ │ ├── onBeaconUpdate.md │ │ │ ├── onBeaconServiceChange.md │ │ │ ├── getBeacons.md │ │ │ ├── stopBeaconDiscovery.md │ │ │ └── startBeaconDiscovery.md │ │ ├── ble │ │ │ ├── closeBLEConnection.md │ │ │ ├── createBLEConnection.md │ │ │ ├── getBLEDeviceServices.md │ │ │ ├── getBLEDeviceCharacteristics.md │ │ │ ├── readBLECharacteristicValue.md │ │ │ ├── writeBLECharacteristicValue.md │ │ │ ├── notifyBLECharacteristicValueChange.md │ │ │ └── onBLEConnectionStateChange.md │ │ ├── bluetooth │ │ │ ├── openBluetoothAdapter.md │ │ │ ├── getBluetoothDevices.md │ │ │ ├── closeBluetoothAdapter.md │ │ │ ├── getBluetoothAdapterState.md │ │ │ ├── getConnectedBluetoothDevices.md │ │ │ ├── stopBluetoothDevicesDiscovery.md │ │ │ ├── startBluetoothDevicesDiscovery.md │ │ │ ├── onBluetoothDeviceFound.md │ │ │ └── onBluetoothAdapterStateChange.md │ │ ├── screenshot │ │ │ └── onUserCaptureScreen.md │ │ ├── phone │ │ │ └── makePhoneCall.md │ │ ├── contacts │ │ │ └── addPhoneContact.md │ │ ├── brightness │ │ │ ├── setKeepScreenOn.md │ │ │ ├── getScreenBrightness.md │ │ │ └── setScreenBrightness.md │ │ ├── scancode │ │ │ └── scancode.md │ │ ├── deviceMotion │ │ │ └── stopDeviceMotionListening.md │ │ ├── compass │ │ │ ├── stopCompass.md │ │ │ └── startCompass.md │ │ ├── accelerometer │ │ │ └── stopAccelerometer.md │ │ └── netstat │ │ │ └── onNetworkStatusChange.md │ ├── network │ │ └── socket │ │ │ ├── closeSocket.md │ │ │ ├── onSocketOpen.md │ │ │ ├── onSocketClose.md │ │ │ ├── onSocketError.md │ │ │ ├── onSocketMessage.md │ │ │ └── sendSocketMessage.md │ ├── storage │ │ ├── clearStorageSync.md │ │ ├── clearStorage.md │ │ ├── getStorageInfoSync.md │ │ ├── removeStorageSync.md │ │ ├── getStorageSync.md │ │ ├── setStorageSync.md │ │ └── removeStorage.md │ ├── extend-apis │ │ ├── arrayBufferToBase64.md │ │ └── base64ToArrayBuffer.md │ ├── location │ │ ├── getLocation.md │ │ └── openLocation.md │ ├── open-api │ │ ├── login │ │ │ ├── login.md │ │ │ └── checkSession.md │ │ ├── card │ │ │ ├── addCard.md │ │ │ ├── openCard.md │ │ │ └── card.md │ │ ├── auth │ │ │ └── authorize.md │ │ ├── settings │ │ │ ├── getSetting.md │ │ │ └── openSetting.md │ │ ├── userinfo │ │ │ └── getUserInfo.md │ │ ├── werun │ │ │ └── getWeRunData.md │ │ ├── address │ │ │ └── chooseAddress.md │ │ ├── invoice │ │ │ ├── chooseInvoice.md │ │ │ └── chooseInvoiceTitle.md │ │ ├── payment │ │ │ ├── faceVerifyForPay.md │ │ │ └── requestPayment.md │ │ ├── redirect │ │ │ ├── navigateToMiniProgram.md │ │ │ └── navigateBackMiniProgram.md │ │ └── bioauth │ │ │ ├── startSoterAuthentication.md │ │ │ ├── checkIsSoterEnrolledInDevice.md │ │ │ └── checkIsSupportSoterAuthentication.md │ ├── updates │ │ ├── manager.md │ │ └── getUpdateManager.md │ └── files │ │ ├── saveFile.md │ │ ├── openDocument.md │ │ ├── getFileInfo.md │ │ ├── removeSavedFile.md │ │ ├── getSavedFileInfo.md │ │ └── getSavedFileList.md │ ├── hybrid.md │ ├── specials.md │ ├── components │ ├── open │ │ ├── others.md │ │ ├── open-data.md │ │ └── ad.md │ ├── media │ │ ├── camera.md │ │ ├── live-player.md │ │ └── live-pusher.md │ └── maps │ │ └── map.md │ ├── async-await.md │ ├── envs-debug.md │ └── nerv.md ├── scripts ├── tsconfig.json ├── output │ └── json.ts └── write.ts ├── packages ├── taro-components │ └── types │ │ ├── event.d.ts │ │ ├── Block.d.ts │ │ ├── PickerViewColumn.d.ts │ │ ├── PullToRefresh.d.ts │ │ └── RadioGroup.d.ts └── taro │ └── types │ └── api │ ├── base │ └── env.d.ts │ └── alipay │ └── index.d.ts ├── .npmrc ├── i18n └── en │ ├── docusaurus-plugin-content-docs │ ├── current │ │ ├── apis │ │ │ ├── framework │ │ │ │ ├── App.md │ │ │ │ └── Page.md │ │ │ ├── base │ │ │ │ ├── env │ │ │ │ │ └── env.md │ │ │ │ └── debug │ │ │ │ │ └── getRealtimeLogManager.md │ │ │ ├── files │ │ │ │ └── getFileSystemManager.md │ │ │ ├── canvas │ │ │ │ ├── createOffscreenCanvas.md │ │ │ │ └── RenderingContext.md │ │ │ ├── about │ │ │ │ └── env.md │ │ │ ├── open-api │ │ │ │ ├── card │ │ │ │ │ └── card.md │ │ │ │ └── payment │ │ │ │ │ └── faceVerifyForPay.md │ │ │ ├── network │ │ │ │ └── udp │ │ │ │ │ └── createUDPSocket.md │ │ │ ├── media │ │ │ │ ├── video-processing │ │ │ │ │ └── createMediaContainer.md │ │ │ │ ├── camera │ │ │ │ │ └── createCameraContext.md │ │ │ │ └── live │ │ │ │ │ └── createLivePusherContext.md │ │ │ ├── storage │ │ │ │ └── clearStorageSync.md │ │ │ └── alipay │ │ │ │ └── getOpenUserInfo.md │ │ ├── components │ │ │ └── forms │ │ │ │ └── picker-view-column.md │ │ └── mdx │ │ │ └── image-list.tsx │ └── version-3.x │ │ ├── apis │ │ ├── framework │ │ │ ├── App.md │ │ │ └── Page.md │ │ ├── base │ │ │ ├── env │ │ │ │ └── env.md │ │ │ └── debug │ │ │ │ └── getRealtimeLogManager.md │ │ ├── files │ │ │ └── getFileSystemManager.md │ │ ├── canvas │ │ │ ├── createOffscreenCanvas.md │ │ │ └── RenderingContext.md │ │ ├── about │ │ │ └── env.md │ │ ├── open-api │ │ │ ├── card │ │ │ │ └── card.md │ │ │ └── payment │ │ │ │ └── faceVerifyForPay.md │ │ ├── network │ │ │ └── udp │ │ │ │ └── createUDPSocket.md │ │ ├── media │ │ │ ├── camera │ │ │ │ └── createCameraContext.md │ │ │ ├── video-processing │ │ │ │ └── createMediaContainer.md │ │ │ └── live │ │ │ │ └── createLivePusherContext.md │ │ ├── storage │ │ │ └── clearStorageSync.md │ │ └── alipay │ │ │ └── getOpenUserInfo.md │ │ ├── components │ │ └── forms │ │ │ └── picker-view-column.md │ │ └── mdx │ │ └── image-list.tsx │ ├── docusaurus-plugin-content-blog │ └── options.json │ └── docusaurus-theme-classic │ └── footer.json ├── .editorconfig ├── src ├── pages │ └── index.js ├── theme │ └── navbar.module.css └── sw.js ├── .vscode └── settings.json ├── .gitignore ├── tsconfig.json └── .github └── PULL_REQUEST_TEMPLATE ├── pull_request_template.md ├── triager_pull_request_template.md ├── collaborator_pull_request_template.md └── committee_pull_request_template.md /versions.json: -------------------------------------------------------------------------------- 1 | [ 2 | "3.x", 3 | "2.x", 4 | "1.x" 5 | ] 6 | -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/favicon.ico -------------------------------------------------------------------------------- /static/img/logo-taro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/logo-taro.png -------------------------------------------------------------------------------- /static/img/o2logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/o2logo@2x.png -------------------------------------------------------------------------------- /static/img/platform/h5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/h5.png -------------------------------------------------------------------------------- /static/img/platform/jd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/jd.png -------------------------------------------------------------------------------- /static/img/platform/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/qq.png -------------------------------------------------------------------------------- /static/img/platform/rn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/rn.png -------------------------------------------------------------------------------- /static/img/platform/tt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/tt.png -------------------------------------------------------------------------------- /static/img/taroLogo180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/taroLogo180.png -------------------------------------------------------------------------------- /static/img/taroLogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/taroLogo@2x.png -------------------------------------------------------------------------------- /typings/modules.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.png" { 2 | const value: string 3 | export default value 4 | } 5 | -------------------------------------------------------------------------------- /static/img/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/favicon/favicon.ico -------------------------------------------------------------------------------- /static/img/platform/alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/alipay.png -------------------------------------------------------------------------------- /static/img/platform/swan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/swan.png -------------------------------------------------------------------------------- /static/img/platform/weapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/weapp.png -------------------------------------------------------------------------------- /static/img/team-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/team-structure.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /static/img/icons/icon-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-48x48.png -------------------------------------------------------------------------------- /static/img/icons/icon-72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-72x72.png -------------------------------------------------------------------------------- /static/img/icons/icon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-96x96.png -------------------------------------------------------------------------------- /static/img/platform/harmony.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/harmony.png -------------------------------------------------------------------------------- /static/img/platform/quickapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/platform/quickapp.png -------------------------------------------------------------------------------- /static/img/icons/icon-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-128x128.png -------------------------------------------------------------------------------- /static/img/icons/icon-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-144x144.png -------------------------------------------------------------------------------- /static/img/icons/icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-152x152.png -------------------------------------------------------------------------------- /static/img/icons/icon-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-192x192.png -------------------------------------------------------------------------------- /static/img/icons/icon-196x196.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-196x196.png -------------------------------------------------------------------------------- /static/img/icons/icon-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-384x384.png -------------------------------------------------------------------------------- /static/img/icons/icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/icon-512x512.png -------------------------------------------------------------------------------- /static/img/icons/maskable_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aliuq/taro-docs/master/static/img/icons/maskable_icon.png -------------------------------------------------------------------------------- /docs/apis/framework/App.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: App 3 | sidebar_label: App 4 | --- 5 | 6 | 注册小程序。接受一个 `Object` 参数,其指定小程序的生命周期回调等。 7 | 8 | ## 方法 9 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/framework/App.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: App 3 | sidebar_label: App 4 | --- 5 | 6 | 注册小程序。接受一个 `Object` 参数,其指定小程序的生命周期回调等。 7 | 8 | ## 方法 9 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/framework/App.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: App 3 | sidebar_label: App 4 | --- 5 | 6 | 注册小程序。接受一个 `Object` 参数,其指定小程序的生命周期回调等。 7 | 8 | ## 方法 9 | -------------------------------------------------------------------------------- /static/css/platform.css: -------------------------------------------------------------------------------- 1 | .icon_platform { 2 | width: 25px; 3 | height: 25px; 4 | vertical-align: middle; 5 | } 6 | 7 | .icon_platform--not-support { 8 | filter: grayscale(100%); 9 | } 10 | -------------------------------------------------------------------------------- /scripts/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "module": "umd", 5 | "moduleResolution": "Node", 6 | "rootDir": ".", 7 | "resolveJsonModule": false, 8 | }, 9 | } 10 | -------------------------------------------------------------------------------- /packages/taro-components/types/event.d.ts: -------------------------------------------------------------------------------- 1 | export type EventHandler = (ev: Event) => void 2 | 3 | export interface TaroEvent extends Event { 4 | srcElement: T | null 5 | target: T 6 | detail: D 7 | } 8 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | public-hoist-pattern[]=@docusaurus/* 2 | public-hoist-pattern[]=workbox-* 3 | public-hoist-pattern[]=*eslint* 4 | public-hoist-pattern[]=*prettier* 5 | registry="https://registry.yarnpkg.com/" 6 | 7 | {SCOPE}:registry=https://npm.pkg.github.com 8 | -------------------------------------------------------------------------------- /docs/apis/base/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: env 3 | sidebar_label: env 4 | --- 5 | 6 | 环境变量 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.env.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | TaroGeneral.IAnyObject 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/apis/framework/Page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page 3 | sidebar_label: Page 4 | --- 5 | 6 | 注册小程序中的一个页面。接受一个 `Object` 类型参数,其指定页面的初始数据、生命周期回调、事件处理函数等。 7 | 8 | ## 方法 9 | 10 | | 参数 | 类型 | 说明 | 11 | | --- | --- | --- | 12 | | route | `string` | 当前页面的路径 | 13 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/framework/App.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: App 3 | sidebar_label: App 4 | --- 5 | 6 | Registers a Mini Program, and accepts an `Object` parameter to specify the lifecycle callbacks for the Mini Program 7 | 8 | ## Methods 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/framework/App.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: App 3 | sidebar_label: App 4 | --- 5 | 6 | Registers a Mini Program, and accepts an `Object` parameter to specify the lifecycle callbacks for the Mini Program 7 | 8 | ## Methods 9 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/base/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: env 3 | sidebar_label: env 4 | --- 5 | 6 | 环境变量 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.env.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | TaroGeneral.IAnyObject 14 | ``` 15 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/framework/Page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page 3 | sidebar_label: Page 4 | --- 5 | 6 | 注册小程序中的一个页面。接受一个 `Object` 类型参数,其指定页面的初始数据、生命周期回调、事件处理函数等。 7 | 8 | ## 方法 9 | 10 | | 参数 | 类型 | 说明 | 11 | | --- | --- | --- | 12 | | route | `string` | 当前页面的路径 | 13 | -------------------------------------------------------------------------------- /docs/apis/canvas/createContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createContext(不推荐使用) 3 | sidebar_label: createContext 4 | --- 5 | 6 | 7 | 创建并返回绘图上下文。 8 | 9 | ## API支持度 10 | 11 | | API | 微信小程序 | H5 | React Native | 12 | | :-: | :-: | :-: | :-: | 13 | | Taro.createContext | ✔️ | | | 14 | -------------------------------------------------------------------------------- /src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Redirect} from '@docusaurus/router'; 3 | import useBaseUrl from '@docusaurus/useBaseUrl'; 4 | 5 | function Home() { 6 | const url = useBaseUrl('/docs') 7 | return ; 8 | } 9 | 10 | export default Home 11 | -------------------------------------------------------------------------------- /docs/components/event.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: event 3 | sidebar_label: event 4 | --- 5 | 6 | ## TaroEvent 7 | 8 | | 参数 | 类型 | 说明 | 9 | | --- | --- | --- | 10 | | srcElement | `T` | | 11 | | target | `T` | Returns the object to which event is dispatched (its target). | 12 | | detail | `D` | | 13 | -------------------------------------------------------------------------------- /packages/taro-components/types/Block.d.ts: -------------------------------------------------------------------------------- 1 | import { ComponentType } from 'react' 2 | import { StandardProps } from './common' 3 | 4 | type BlockProps = StandardProps 5 | 6 | /** 7 | * @ignore 8 | */ 9 | declare const Block: ComponentType 10 | 11 | export { Block, BlockProps } 12 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/canvas/createContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createContext(不推荐使用) 3 | sidebar_label: createContext 4 | --- 5 | 6 | 7 | 创建并返回绘图上下文。 8 | 9 | ## API支持度 10 | 11 | | API | 微信小程序 | H5 | React Native | 12 | | :-: | :-: | :-: | :-: | 13 | | Taro.createContext | ✔️ | | | 14 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/canvas/createContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createContext(不推荐使用) 3 | sidebar_label: createContext 4 | --- 5 | 6 | 7 | 创建并返回绘图上下文。 8 | 9 | ## API支持度 10 | 11 | | API | 微信小程序 | H5 | React Native | 12 | | :-: | :-: | :-: | :-: | 13 | | Taro.createContext | ✔️ | | | 14 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/components/event.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: event 3 | sidebar_label: event 4 | --- 5 | 6 | ## TaroEvent 7 | 8 | | 参数 | 类型 | 说明 | 9 | | --- | --- | --- | 10 | | srcElement | `T` | | 11 | | target | `T` | Returns the object to which event is dispatched (its target). | 12 | | detail | `D` | | 13 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/interactives/hideToast.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.hideToast() 3 | sidebar_label: hideToast 4 | --- 5 | 6 | 7 | 隐藏消息提示框 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.hideToast | ✔️ | ✔️ | ✔️ | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/learn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 社区贡献的学习教程 3 | --- 4 | 5 | ## 系列教程 6 | 7 | - [Taro 小程序大型实战系列](https://mp.weixin.qq.com/mp/homepage?__biz=MzA5NTcxOTcyMg==&hid=2&sn=0a87f540e1c09afae1db4d1f9add979c&scene=1&devicetype=android-29&version=27000d37&lang=zh_CN&nettype=WIFI&ascene=7&session_us=gh_99d83437df31&wx_header=1) -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/canvas/createContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createContext(不推荐使用) 3 | sidebar_label: createContext 4 | --- 5 | 6 | 7 | 创建并返回绘图上下文。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.createContext | ✔️ | | | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/interactives/hideLoading.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.hideLoading() 3 | sidebar_label: hideLoading 4 | --- 5 | 6 | 7 | 隐藏 loading 提示框 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.hideLoading | ✔️ | ✔️ | ✔️ | 17 | 18 | -------------------------------------------------------------------------------- /docs/apis/canvas/drawCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.drawCanvas(不推荐使用) 3 | sidebar_label: drawCanvas 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.drawCanvas`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/draw-canvas.html)。 8 | 9 | ## API支持度 10 | 11 | | API | 微信小程序 | H5 | React Native | 12 | | :-: | :-: | :-: | :-: | 13 | | Taro.drawCanvas | ✔️ | | | 14 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.validate": [ 3 | "javascript", 4 | "javascriptreact", 5 | { 6 | "language": "typescript", 7 | "autoFix": true 8 | }, 9 | { 10 | "language": "typescriptreact", 11 | "autoFix": true 12 | } 13 | ], 14 | "jest.autoEnable": false, 15 | "typescript.tsdk": "node_modules/typescript/lib" 16 | } 17 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/canvas/drawCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.drawCanvas(不推荐使用) 3 | sidebar_label: drawCanvas 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.drawCanvas`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/draw-canvas.html)。 8 | 9 | ## API支持度 10 | 11 | | API | 微信小程序 | H5 | React Native | 12 | | :-: | :-: | :-: | :-: | 13 | | Taro.drawCanvas | ✔️ | | | 14 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/canvas/drawCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.drawCanvas(不推荐使用) 3 | sidebar_label: drawCanvas 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.drawCanvas`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/draw-canvas.html)。 8 | 9 | ## API支持度 10 | 11 | | API | 微信小程序 | H5 | React Native | 12 | | :-: | :-: | :-: | :-: | 13 | | Taro.drawCanvas | ✔️ | | | 14 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigationbar/hideNavigationBarLoading.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.hideNavigationBarLoading() 3 | sidebar_label: hideNavigationBarLoading 4 | --- 5 | 6 | 7 | 隐藏导航条加载动画。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.hideNavigationBarLoading | ✔️ | | ✔️ | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigationbar/showNavigationBarLoading.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.showNavigationBarLoading() 3 | sidebar_label: showNavigationBarLoading 4 | --- 5 | 6 | 7 | 在当前页面显示导航条加载动画。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.showNavigationBarLoading | ✔️ | | ✔️ | 17 | 18 | -------------------------------------------------------------------------------- /docs/team/team-community.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 社区团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责 Taro 生态与运营,和 Taro 社区的运营推广工作。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/base/env/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.env() 3 | sidebar_label: env 4 | --- 5 | 6 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/env/envObj.html) 7 | 8 | ## 类型 9 | 10 | ```tsx 11 | typeof env 12 | ``` 13 | 14 | ## API 支持度 15 | 16 | | API | 微信小程序 | H5 | React Native | 17 | | :---: | :---: | :---: | :---: | 18 | | Taro.env | ✔️ | | | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/onBackgroundAudioPlay.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBackgroundAudioPlay(CALLBACK) 3 | sidebar_label: onBackgroundAudioPlay 4 | --- 5 | 6 | 7 | 监听音乐播放。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | Taro.onBackgroundAudioPlay | ✔️ | | | 17 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/onBackgroundAudioStop.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBackgroundAudioStop(CALLBACK) 3 | sidebar_label: onBackgroundAudioStop 4 | --- 5 | 6 | 7 | 监听音乐停止。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | Taro.onBackgroundAudioStop | ✔️ | | | 17 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/about/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 环境判断 3 | --- 4 | 5 | ## Taro.ENV_TYPE 6 | 7 | `ENV_TYPE.WEAPP` 微信小程序环境 8 | 9 | `ENV_TYPE.SWAN` 百度小程序环境 10 | 11 | `ENV_TYPE.ALIPAY` 支付宝小程序环境 12 | 13 | `ENV_TYPE.TT` 字节跳动小程序环境 14 | 15 | `ENV_TYPE.WEB` WEB(H5)环境 16 | 17 | `ENV_TYPE.RN` ReactNative 环境 18 | 19 | ## Taro.getEnv() 20 | 21 | 获取当前环境值,具体值如上 `Taro.ENV_TYPE` 22 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/onBackgroundAudioPause.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBackgroundAudioPause(CALLBACK) 3 | sidebar_label: onBackgroundAudioPause 4 | --- 5 | 6 | 7 | 监听音乐暂停。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | Taro.onBackgroundAudioPause | ✔️ | | | 17 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/hybrid.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro 代码与小程序代码混写 3 | --- 4 | 5 | Taro 项目 支持 Taro 的代码与小程序(微信/百度/支付宝/字节跳动)原生的页面、组件代码混合存在,只需要将原生的页面、组件代码放入 `src` 目录下,随后在 入口文件 `app.js` 中定义好 `pages` 配置指向对应的原生的页面即可,在原生页面的配置中,你可以通过 `usingComponents` 来定义需要引入的组件,这里可以指定 Taro 组件同时也可以指定小程序原生的组件。 6 | 7 | `usingComponents` 指定的小程序原生组件名字需要以**小写**开头。 8 | 9 | > 请参考示例项目:https://github.com/NervJS/taro-sample-weapp 10 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/hybrid.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro 代码与小程序代码混写 3 | --- 4 | 5 | Taro 项目 支持 Taro 的代码与小程序(微信/百度/支付宝/字节跳动)原生的页面、组件代码混合存在,只需要将原生的页面、组件代码放入 `src` 目录下,随后在 入口文件 `app.js` 中定义好 `pages` 配置指向对应的原生的页面即可,在原生页面的配置中,你可以通过 `usingComponents` 来定义需要引入的组件,这里可以指定 Taro 组件同时也可以指定小程序原生的组件。 6 | 7 | `usingComponents` 指定的小程序原生组件名字需要以**小写**开头。 8 | 9 | > 请参考示例项目:https://github.com/NervJS/taro-sample-weapp 10 | -------------------------------------------------------------------------------- /docs/team/role-collaborator.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 合作者 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 感谢为 Taro 贡献过代码的每一位开发者。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /scripts/output/json.ts: -------------------------------------------------------------------------------- 1 | import { DocEntry } from '../parser' 2 | import { childrenMerge } from '../parser/utils' 3 | import writeFile from '../write' 4 | 5 | export async function writeJson (routePath: string, doc: DocEntry[]) { 6 | const merge = await childrenMerge(doc, []) 7 | const Taro = merge.find(e => e.name === 'Taro') 8 | 9 | writeFile(`${routePath}.json`, JSON.stringify(Taro, undefined, 2)) 10 | } -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/canvas/drawCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.drawCanvas(不推荐使用) 3 | sidebar_label: drawCanvas 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.drawCanvas`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/draw-canvas.html)。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.drawCanvas | ✔️ | | | 17 | 18 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-blog/options.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": { 3 | "message": "Blog", 4 | "description": "The title for the blog used in SEO" 5 | }, 6 | "description": { 7 | "message": "Blog", 8 | "description": "The description for the blog used in SEO" 9 | }, 10 | "sidebar.title": { 11 | "message": "全部", 12 | "description": "The label for the left sidebar" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/nfc/onHCEMessage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onHCEMessage(CALLBACK) 3 | sidebar_label: onHCEMessage 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.onHCEMessage`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.onHCEMessage.html)。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.onHCEMessage | ✔️ | | | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/team-community.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 社区团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责 Taro 生态与运营,和 Taro 社区的运营推广工作。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/onGetWifiList.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onGetWifiList(CALLBACK) 3 | sidebar_label: onGetWifiList 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.onGetWifiList`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.onGetWifiList.html)。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.onGetWifiList | ✔️ | | | 17 | 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # dependencies 2 | /node_modules 3 | 4 | # production 5 | /build 6 | 7 | # generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # environment 12 | .env 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | .now 25 | dist 26 | .history/ 27 | .idea/ 28 | .vscode 29 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/network/socket/closeSocket.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.closeSocket 3 | sidebar_label: closeSocket 4 | --- 5 | 6 | 7 | `@Deprecated` 请使用 **SocketTask.close** 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | SocketTask | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 17 | | Taro.closeSocket | ✔️ | | | ✔️ | ✔️ | 18 | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ibeacon/onBeaconUpdate.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBeaconUpdate(CALLBACK) 3 | sidebar_label: onBeaconUpdate 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.onBeaconUpdate`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.onBeaconUpdate.html)。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.onBeaconUpdate | ✔️ | | | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/network/socket/onSocketOpen.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onSocketOpen 3 | sidebar_label: onSocketOpen 4 | --- 5 | 6 | 7 | `@Deprecated` 请使用 **SocketTask.onOpen** 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | SocketTask | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 17 | | Taro.onSocketOpen | ✔️ | | | ✔️ | ✔️ | 18 | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/role-collaborator.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 合作者 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 感谢为 Taro 贡献过代码的每一位开发者。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/onWifiConnected.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onWifiConnected(CALLBACK) 3 | sidebar_label: onWifiConnected 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.onWifiConnected`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.onWifiConnected.html)。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | Taro.onWifiConnected | ✔️ | | | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/network/socket/onSocketClose.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onSocketClose 3 | sidebar_label: onSocketClose 4 | --- 5 | 6 | 7 | `@Deprecated` 请使用 **SocketTask.onClose** 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | SocketTask | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 17 | | Taro.onSocketClose | ✔️ | | | ✔️ | ✔️ | 18 | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/network/socket/onSocketError.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onSocketError 3 | sidebar_label: onSocketError 4 | --- 5 | 6 | 7 | `@Deprecated` 请使用 **SocketTask.onError** 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | SocketTask | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 17 | | Taro.onSocketError | ✔️ | | | ✔️ | ✔️ | 18 | 19 | -------------------------------------------------------------------------------- /packages/taro/types/api/base/env.d.ts: -------------------------------------------------------------------------------- 1 | import Taro from '../../index' 2 | 3 | declare module '../../index' { 4 | interface TaroStatic { 5 | /** 6 | * @supported weapp, h5, rn 7 | * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/env/envObj.html 8 | */ 9 | env: { 10 | [key: string]: string | undefined 11 | /** 文件系统中的用户目录路径 (本地路径) */ 12 | USER_DATA_PATH: string 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/network/socket/onSocketMessage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onSocketMessage 3 | sidebar_label: onSocketMessage 4 | --- 5 | 6 | 7 | `@Deprecated` 请使用 **SocketTask.onMessage** 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | SocketTask | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 17 | | Taro.onSocketMessage | ✔️ | | | ✔️ | ✔️ | 18 | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/network/socket/sendSocketMessage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.sendSocketMessage 3 | sidebar_label: sendSocketMessage 4 | --- 5 | 6 | 7 | `@Deprecated` 请使用 **SocketTask.send** 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 15 | | :-: | :-: | :-: | :-: | :-: | :-: | 16 | | SocketTask | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | 17 | | Taro.sendSocketMessage | ✔️ | | | ✔️ | ✔️ | 18 | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/storage/clearStorageSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.clearStorageSync() 3 | sidebar_label: clearStorageSync 4 | --- 5 | 6 | 7 | 同步清理本地数据缓存 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.clearStorageSync() 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.clearStorageSync | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /docs/specials.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 常见问题 3 | --- 4 | 5 | - [Issue #46](https://github.com/NervJS/taro/issues/46),`redux-saga` 的引入问题处理 6 | 7 | - 在 H5 模式下,tabBar 可能会挡住页面 fixed 元素问题:这是因为与小程序的 tabBar 不同,在 H5 下 tabBar 是一个普通的组件,当页面中存在 `fixed(bottom)` 定位的元素时,其表现会与小程序中不一致。Taro 提供了一个适配的方法: 8 | 9 | 例如: 10 | 11 | ```css 12 | .fixed { 13 | bottom: 0; 14 | /* 在 H5 模式下将会编译成 margin-bottom: 50px,在小程序模式下则会忽略 */ 15 | margin-bottom: taro-tabbar-height; 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /packages/taro/types/api/alipay/index.d.ts: -------------------------------------------------------------------------------- 1 | import Taro from '../../index' 2 | 3 | declare module '../../index' { 4 | interface TaroStatic { 5 | /** 6 | * 此接口可获取支付宝会员的基础信息(头像图片地址、昵称、性别、国家码、省份、所在市区),接入方法请参考 获取会员基础信息介绍。如需获取支付宝会员标识(user_id),请调用 my.getAuthCode 和 alipay.system.oauth.token 接口。 7 | * @supported alipay 8 | * @see https://docs.alipay.com/mini/api/ch8chh 9 | */ 10 | getOpenUserInfo(): Promise 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/team/role-committer.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 贡献者 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责技术方向、项目管理、项目发布、贡献政策、仓库托管、行为准则、维护合作者列表,定期参加 TSC 活动,主席(主持人)会在线上主持活动,并做好活动记录并公布。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/closeBLEConnection.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.closeBLEConnection(OBJECT) 3 | sidebar_label: closeBLEConnection 4 | --- 5 | 6 | 使用方式同 [`wx.closeBLEConnection`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.closeBLEConnection.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.closeBLEConnection(params).then(...) 14 | ``` 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/openBluetoothAdapter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.openBluetoothAdapter(OBJECT) 3 | sidebar_label: openBluetoothAdapter 4 | --- 5 | 6 | 使用方式同 [`wx.openBluetoothAdapter`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openBluetoothAdapter.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.openBluetoothAdapter(params).then(...) 14 | ``` 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ibeacon/onBeaconServiceChange.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBeaconServiceChange(CALLBACK) 3 | sidebar_label: onBeaconServiceChange 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.onBeaconServiceChange`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.onBeaconServiceChange.html)。 8 | 9 | ## API支持度 10 | 11 | 12 | | API | 微信小程序 | H5 | React Native | 13 | | :-: | :-: | :-: | :-: | 14 | | Taro.onBeaconServiceChange | ✔️ | | | 15 | 16 | -------------------------------------------------------------------------------- /docs/team/role-committee.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 技术委员会 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责技术方向、项目管理、项目发布、贡献政策、仓库托管、行为准则、维护合作者列表,定期参加 TSC 活动,主席(主持人)会在线上主持活动,并做好活动记录并公布。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/base/env/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.env() 3 | sidebar_label: env 4 | --- 5 | 6 | Operating environment 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.env.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | typeof env 14 | ``` 15 | 16 | ## API Support 17 | 18 | | API | WeChat Mini-Program | H5 | React Native | 19 | | :---: | :---: | :---: | :---: | 20 | | Taro.env | ✔️ | | ✔️ | 21 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/createBLEConnection.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createBLEConnection(OBJECT) 3 | sidebar_label: createBLEConnection 4 | --- 5 | 6 | 使用方式同 [`wx.createBLEConnection`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.createBLEConnection.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.createBLEConnection(params).then(...) 14 | ``` 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/getBluetoothDevices.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getBluetoothDevices(OBJECT) 3 | sidebar_label: getBluetoothDevices 4 | --- 5 | 6 | 使用方式同 [`wx.getBluetoothDevices`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getBluetoothDevices.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.getBluetoothDevices(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/base/env/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.env() 3 | sidebar_label: env 4 | --- 5 | 6 | Operating environment 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.env.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | typeof env 14 | ``` 15 | 16 | ## API Support 17 | 18 | | API | WeChat Mini-Program | H5 | React Native | 19 | | :---: | :---: | :---: | :---: | 20 | | Taro.env | ✔️ | | ✔️ | 21 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/getBLEDeviceServices.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getBLEDeviceServices(OBJECT) 3 | sidebar_label: getBLEDeviceServices 4 | --- 5 | 6 | 使用方式同 [`wx.getBLEDeviceServices`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getBLEDeviceServices.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.getBLEDeviceServices(params).then(...) 14 | ``` 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/extend-apis/arrayBufferToBase64.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: arrayBufferToBase64 3 | sidebar_label: arrayBufferToBase64 4 | --- 5 | 6 | ## Taro.arrayBufferToBase64(arrayBuffer) 7 | 8 | 将 ArrayBuffer 数据转成 Base64 字符串。(小程序端基础库 1.1.0 开始支持,低版本需做兼容处理) 9 | 10 | **示例代码:** 11 | 12 | ```jsx 13 | import Taro from '@tarojs/taro' 14 | 15 | const arrayBuffer = new Uint8Array([11, 22, 33]) 16 | const base64 = Taro.arrayBufferToBase64(arrayBuffer) 17 | ``` 18 | -------------------------------------------------------------------------------- /scripts/write.ts: -------------------------------------------------------------------------------- 1 | import * as fs from "fs" 2 | import * as path from "path" 3 | 4 | export default function writeFile (route: string, text: string = '') { 5 | if (!route || !text) return 6 | console.log(`Document written to ${route}`) 7 | try { 8 | fs.writeFileSync(route, text, {}) 9 | } catch (error) { 10 | const routePath = path.parse(route) 11 | fs.mkdirSync(routePath.dir, { recursive: true }) 12 | fs.writeFileSync(route, text, {}) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/closeBluetoothAdapter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.closeBluetoothAdapter(OBJECT) 3 | sidebar_label: closeBluetoothAdapter 4 | --- 5 | 6 | 使用方式同 [`wx.closeBluetoothAdapter`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.closeBluetoothAdapter.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.closeBluetoothAdapter(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/canvas/createCanvasContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createCanvasContext(canvasId, componentInstance) 3 | sidebar_label: createCanvasContext 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.createCanvasContext`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.createCanvasContext.html)。 8 | 9 | 10 | ## API支持度 11 | 12 | 13 | | API | 微信小程序 | H5 | React Native | 14 | | :-: | :-: | :-: | :-: | 15 | | Taro.createCanvasContext | ✔️ | ✔️ | | 16 | 17 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/storage/clearStorage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.clearStorage() 3 | sidebar_label: clearStorage 4 | --- 5 | 6 | 7 | 清理本地数据缓存。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.clearStorage() 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.clearStorage | ✔️ | ✔️ | ✔️ | 25 | | Taro.clearStorageSync | ✔️ | ✔️ | | 26 | 27 | -------------------------------------------------------------------------------- /docs/team/team-innovate.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 创新团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | Taro 创新特新、新方向探索,如 wasm、rust、vite、flutter、electron 等。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ### UI 框架兴趣组 14 | 15 | TaroUI、NutUI 等 UI 库和其他类型生态工具的研发与管理。 16 | 17 | ## 荣誉成员 18 | 19 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 20 | 21 | 22 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-theme-classic/footer.json: -------------------------------------------------------------------------------- 1 | { 2 | "link.title.文档": { 3 | "message": "文档", 4 | "description": "The title of the footer links column with title=文档 in the footer" 5 | }, 6 | "link.item.label.文档": { 7 | "message": "文档", 8 | "description": "The label of footer link with label=文档 linking to /docs" 9 | }, 10 | "copyright": { 11 | "message": "Copyright © 2022 Taro by O2 labs", 12 | "description": "The footer copyright" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/docusaurus/tsconfig.json", 3 | "compilerOptions": { 4 | "lib": ["DOM", "ESNext"], 5 | "baseUrl": ".", 6 | "paths": { 7 | "@site/static/*": ["./static/*"] 8 | }, 9 | "resolveJsonModule": true, 10 | "strict": true, 11 | "types": ["@types/jest", "@types/node", "typings"] 12 | }, 13 | "include": ["blog", "docs", "i18n", "packages", "scripts", "src", "typings"], 14 | "exclude": ["src/sw.js"] 15 | } 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/location/getLocation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getLocation(OBJECT) 3 | sidebar_label: getLocation 4 | --- 5 | 6 | 使用方式同 [`wx.getLocation`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getLocation.html),h5端仅支持[微信公众号](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)(API以小程序为准),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.getLocation(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/specials.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 常见问题 3 | --- 4 | 5 | - [Issue #46](https://github.com/NervJS/taro/issues/46),`redux-saga` 的引入问题处理 6 | 7 | - 在 H5 模式下,tabBar 可能会挡住页面 fixed 元素问题:这是因为与小程序的 tabBar 不同,在 H5 下 tabBar 是一个普通的组件,当页面中存在 `fixed(bottom)` 定位的元素时,其表现会与小程序中不一致。Taro 提供了一个适配的方法: 8 | 9 | 例如: 10 | 11 | ```css 12 | .fixed { 13 | bottom: 0; 14 | /* 在 H5 模式下将会编译成 margin-bottom: 50px,在小程序模式下则会忽略 */ 15 | margin-bottom: taro-tabbar-height; 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/specials.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 常见问题 3 | --- 4 | 5 | - [Issue #46](https://github.com/NervJS/taro/issues/46),`redux-saga` 的引入问题处理 6 | 7 | - 在 H5 模式下,tabBar 可能会挡住页面 fixed 元素问题:这是因为与小程序的 tabBar 不同,在 H5 下 tabBar 是一个普通的组件,当页面中存在 `fixed(bottom)` 定位的元素时,其表现会与小程序中不一致。Taro 提供了一个适配的方法: 8 | 9 | 例如: 10 | 11 | ```css 12 | .fixed { 13 | bottom: 0; 14 | /* 在 H5 模式下将会编译成 margin-bottom: 50px,在小程序模式下则会忽略 */ 15 | margin-bottom: taro-tabbar-height; 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/specials.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 常见问题 3 | --- 4 | 5 | - [Issue #46](https://github.com/NervJS/taro/issues/46),`redux-saga` 的引入问题处理 6 | 7 | - 在 H5 模式下,tabBar 可能会挡住页面 fixed 元素问题:这是因为与小程序的 tabBar 不同,在 H5 下 tabBar 是一个普通的组件,当页面中存在 `fixed(bottom)` 定位的元素时,其表现会与小程序中不一致。Taro 提供了一个适配的方法: 8 | 9 | 例如: 10 | 11 | ```css 12 | .fixed { 13 | bottom: 0; 14 | /* 在 H5 模式下将会编译成 margin-bottom: 50px,在小程序模式下则会忽略 */ 15 | margin-bottom: taro-tabbar-height; 16 | } 17 | ``` 18 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/role-committer.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 贡献者 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责技术方向、项目管理、项目发布、贡献政策、仓库托管、行为准则、维护合作者列表,定期参加 TSC 活动,主席(主持人)会在线上主持活动,并做好活动记录并公布。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/apis/about/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 环境判断 3 | --- 4 | 5 | ## Taro.ENV_TYPE 6 | 7 | `ENV_TYPE.WEAPP` 微信小程序环境 8 | 9 | `ENV_TYPE.SWAN` 百度小程序环境 10 | 11 | `ENV_TYPE.ALIPAY` 支付宝小程序环境 12 | 13 | `ENV_TYPE.TT` 字节跳动小程序环境 14 | 15 | `ENV_TYPE.WEB` WEB(H5)环境 16 | 17 | `ENV_TYPE.RN` ReactNative 环境 18 | 19 | `ENV_TYPE.QUICKAPP` 快应用环境 20 | 21 | `ENV_TYPE.QQ` QQ小程序 环境 22 | 23 | `ENV_TYPE.JD` 京东小程序 环境 24 | 25 | ## Taro.getEnv() 26 | 27 | 获取当前环境值,具体值如上 `Taro.ENV_TYPE` 28 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/role-committee.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 技术委员会 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责技术方向、项目管理、项目发布、贡献政策、仓库托管、行为准则、维护合作者列表,定期参加 TSC 活动,主席(主持人)会在线上主持活动,并做好活动记录并公布。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/team/role-triage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 社区助手 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责 taro 相关仓库新 issues 的维护,负责给 issues 或 pull requests 打标签,以及负责评论、关闭和重新开启 issue 或 pull request,负责将 bug 或 feature 分流给具体工作组。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/getBluetoothAdapterState.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getBluetoothAdapterState(OBJECT) 3 | sidebar_label: getBluetoothAdapterState 4 | --- 5 | 6 | 使用方式同 [`wx.getBluetoothAdapterState`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getBluetoothAdapterState.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.getBluetoothAdapterState(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/framework/Page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page 3 | sidebar_label: Page 4 | --- 5 | 6 | 注册小程序中的一个页面。接受一个 `Object` 类型参数,其指定页面的初始数据、生命周期回调、事件处理函数等。 7 | 8 | ## 方法 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
参数类型说明
routestring当前页面的路径
26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/stopBackgroundAudio.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopBackgroundAudio() 3 | sidebar_label: stopBackgroundAudio 4 | --- 5 | 6 | 7 | 停止播放音乐。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.stopBackgroundAudio() 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.stopBackgroundAudio | ✔️ | | | 25 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/components/open/others.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 其他 3 | sidebar_label: 其他 4 | --- 5 | 6 | ##### 其他组件 7 | 8 | 除导航列表的一些组件外,还有一些差异化组件,每个端不同,后续计划将这些统一封装。目前差异化组件请详看各小程序官网。 9 | 10 | >其他组件请看各小程序官方文档 11 | 12 | [微信小程序](https://developers.weixin.qq.com/miniprogram/dev/component/)。 13 | 14 | [百度小程序](https://smartprogram.baidu.com/docs/develop/component/view/)。 15 | 16 | [支付宝小程序](https://docs.alipay.com/mini/component/overview)。 17 | 18 | [字节跳动小程序](https://developer.toutiao.com/docs/comp/)。 19 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/team-innovate.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 创新团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | Taro 创新特新、新方向探索,如 wasm、rust、vite、flutter、electron 等。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ### UI 框架兴趣组 14 | 15 | TaroUI、NutUI 等 UI 库和其他类型生态工具的研发与管理。 16 | 17 | ## 荣誉成员 18 | 19 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 20 | 21 | 22 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/pauseBackgroundAudio.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.pauseBackgroundAudio() 3 | sidebar_label: pauseBackgroundAudio 4 | --- 5 | 6 | 7 | 暂停播放音乐。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.pauseBackgroundAudio() 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.pauseBackgroundAudio | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/storage/getStorageInfoSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getStorageInfoSync() 3 | sidebar_label: getStorageInfoSync 4 | --- 5 | 6 | 7 | 同步获取当前 storage 的相关信息。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | const res = Taro.getStorageInfoSync() 15 | console.log(res.keys) 16 | ``` 17 | 18 | 19 | 20 | ## API支持度 21 | 22 | 23 | | API | 微信小程序 | H5 | React Native | 24 | | :-: | :-: | :-: | :-: | 25 | | Taro.getStorageInfoSync | ✔️ | ✔️ | | 26 | 27 | -------------------------------------------------------------------------------- /docs/components/open/others.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 其他 3 | sidebar_label: 其他 4 | --- 5 | 6 | ##### 其他组件 7 | 8 | 除导航列表的一些组件外,还有一些差异化组件,每个端不同,后续计划将这些统一封装。目前差异化组件请详看各小程序官网。 9 | 10 | >其他组件请看各小程序官方文档 11 | 12 | [微信小程序](https://developers.weixin.qq.com/miniprogram/dev/component/)。 13 | 14 | [百度小程序](https://smartprogram.baidu.com/docs/develop/component/view/)。 15 | 16 | [支付宝小程序](https://docs.alipay.com/mini/component/overview)。 17 | 18 | [字节跳动小程序](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/component/all)。 19 | -------------------------------------------------------------------------------- /docs/team/team-core.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Core 团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | ## 成员 8 | 9 | 10 | 11 | ### Cli 工作组 12 | 13 | 主要负责 Taro 命令行工具的开发和维护工作。 14 | 15 | ### Compile 工作组 16 | 17 | 负责维护、优化小程序和 H5 的编译系统。 18 | 19 | ### Runtime 工作组 20 | 21 | 负责维护小程序运行时系统。 22 | 23 | ## 荣誉成员 24 | 25 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 26 | 27 | 28 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/getBLEDeviceCharacteristics.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getBLEDeviceCharacteristics(OBJECT) 3 | sidebar_label: getBLEDeviceCharacteristics 4 | --- 5 | 6 | 使用方式同 [`wx.getBLEDeviceCharacteristics`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getBLEDeviceCharacteristics.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.getBLEDeviceCharacteristics(params).then(...) 14 | ``` 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/readBLECharacteristicValue.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.readBLECharacteristicValue(OBJECT) 3 | sidebar_label: readBLECharacteristicValue 4 | --- 5 | 6 | 使用方式同 [`wx.readBLECharacteristicValue`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.readBLECharacteristicValue.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.readBLECharacteristicValue(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/getConnectedBluetoothDevices.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getConnectedBluetoothDevices(OBJECT) 3 | sidebar_label: getConnectedBluetoothDevices 4 | --- 5 | 6 | 使用方式同 [`wx.getConnectedBluetoothDevices`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getConnectedBluetoothDevices.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.getConnectedBluetoothDevices(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/login/login.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.login(OBJECT) 3 | sidebar_label: login 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.login`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.login.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.login(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.login | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/updates/manager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 更新管理 3 | sidebar_label: 更新管理 4 | --- 5 | 6 | ## Taro.getUpdateManager() 7 | 8 | 使用方式同 [`wx.getUpdateManager`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getUpdateManager.html)。 9 | 10 | **示例代码:** 11 | 12 | ```jsx 13 | import Taro from '@tarojs/taro' 14 | 15 | Taro.getUpdateManager() 16 | ``` 17 | 18 | > API 支持度 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :-: | :-: | :-: | :-: | 22 | | Taro.getUpdateManager | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/components/open/others.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 其他 3 | sidebar_label: 其他 4 | --- 5 | 6 | ##### 其他组件 7 | 8 | 除导航列表的一些组件外,还有一些差异化组件,每个端不同,后续计划将这些统一封装。目前差异化组件请详看各小程序官网。 9 | 10 | >其他组件请看各小程序官方文档 11 | 12 | [微信小程序](https://developers.weixin.qq.com/miniprogram/dev/component/)。 13 | 14 | [百度小程序](https://smartprogram.baidu.com/docs/develop/component/view/)。 15 | 16 | [支付宝小程序](https://docs.alipay.com/mini/component/overview)。 17 | 18 | [字节跳动小程序](https://developer.toutiao.com/docs/comp/)。 19 | 20 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/about/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 环境判断 3 | --- 4 | 5 | ## Taro.ENV_TYPE 6 | 7 | `ENV_TYPE.WEAPP` 微信小程序环境 8 | 9 | `ENV_TYPE.SWAN` 百度小程序环境 10 | 11 | `ENV_TYPE.ALIPAY` 支付宝小程序环境 12 | 13 | `ENV_TYPE.TT` 字节跳动小程序环境 14 | 15 | `ENV_TYPE.WEB` WEB(H5)环境 16 | 17 | `ENV_TYPE.RN` ReactNative 环境 18 | 19 | `ENV_TYPE.QUICKAPP` 快应用环境 20 | 21 | `ENV_TYPE.QQ` QQ小程序 环境 22 | 23 | `ENV_TYPE.JD` 京东小程序 环境 24 | 25 | ## Taro.getEnv() 26 | 27 | 获取当前环境值,具体值如上 `Taro.ENV_TYPE` 28 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/about/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 环境判断 3 | --- 4 | 5 | ## Taro.ENV_TYPE 6 | 7 | `ENV_TYPE.WEAPP` 微信小程序环境 8 | 9 | `ENV_TYPE.SWAN` 百度小程序环境 10 | 11 | `ENV_TYPE.ALIPAY` 支付宝小程序环境 12 | 13 | `ENV_TYPE.TT` 字节跳动小程序环境 14 | 15 | `ENV_TYPE.WEB` WEB(H5)环境 16 | 17 | `ENV_TYPE.RN` ReactNative 环境 18 | 19 | `ENV_TYPE.QUICKAPP` 快应用环境 20 | 21 | `ENV_TYPE.QQ` QQ小程序 环境 22 | 23 | `ENV_TYPE.JD` 京东小程序 环境 24 | 25 | ## Taro.getEnv() 26 | 27 | 获取当前环境值,具体值如上 `Taro.ENV_TYPE` 28 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/writeBLECharacteristicValue.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.writeBLECharacteristicValue(OBJECT) 3 | sidebar_label: writeBLECharacteristicValue 4 | --- 5 | 6 | 使用方式同 [`wx.writeBLECharacteristicValue`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.writeBLECharacteristicValue.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.writeBLECharacteristicValue(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/files/getFileSystemManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getFileSystemManager() 3 | sidebar_label: getFileSystemManager 4 | --- 5 | 6 | 获取全局唯一的文件管理器 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => FileSystemManager 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## API 支持度 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.getFileSystemManager | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/role-triage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 社区助手 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责 taro 相关仓库新 issues 的维护,负责给 issues 或 pull requests 打标签,以及负责评论、关闭和重新开启 issue 或 pull request,负责将 bug 或 feature 分流给具体工作组。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ## 荣誉成员 14 | 15 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 16 | 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/stopBluetoothDevicesDiscovery.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopBluetoothDevicesDiscovery(OBJECT) 3 | sidebar_label: stopBluetoothDevicesDiscovery 4 | --- 5 | 6 | 使用方式同 [`wx.stopBluetoothDevicesDiscovery`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.stopBluetoothDevicesDiscovery.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.stopBluetoothDevicesDiscovery(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/nfc/stopHCE.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopHCE(OBJECT) 3 | sidebar_label: stopHCE 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.stopHCE`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.stopHCE.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.stopHCE(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.stopHCE | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/files/saveFile.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.saveFile(OBJECT) 3 | sidebar_label: saveFile 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.saveFile`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.saveFile.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.saveFile(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.saveFile | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/card/addCard.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.addCard(OBJECT) 3 | sidebar_label: addCard 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.addCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.addCard.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.addCard(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.addCard | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /docs/mini-troubleshooting.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 常见问题 3 | --- 4 | 5 | 各小程序常见问题汇总。 6 | 7 | ## 微信小程序 8 | 9 | ### 热重载 10 | 11 | 打开微信小程序开发者工具的“热重载”功能,可以在修改**页面 JS 文件**、**样式文件**后快速在开发者工具显示更新的内容,极大地提升了开发体验。 12 | 13 | 在 Taro 中,样式文件的热重载是直接支持的,而页面 JS 文件的热重载在 `Taro v3.3.17` 版本后支持,且需要额外配置: 14 | 15 | - `Taro v3.3.17+`:手动为需要热重载的页面增加兼容代码,请参考:[#10722](https://github.com/NervJS/taro/issues/10722#issuecomment-992247021) 16 | - `Taro v3.4.0+`:打开编译配置 [mini.hot](./config-detail#minihot) 即可。 17 | 18 | > **注意:**目前微信小程序的 JS 文件热重载只支持页面文件,而不包括其依赖。 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/startBluetoothDevicesDiscovery.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.startBluetoothDevicesDiscovery(OBJECT) 3 | sidebar_label: startBluetoothDevicesDiscovery 4 | --- 5 | 6 | 使用方式同 [`wx.startBluetoothDevicesDiscovery`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.startBluetoothDevicesDiscovery.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.startBluetoothDevicesDiscovery(params).then(...) 14 | ``` 15 | 16 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/nfc/startHCE.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.startHCE(OBJECT) 3 | sidebar_label: startHCE 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.startHCE`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.startHCE.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.startHCE(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.startHCE | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/screenshot/onUserCaptureScreen.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onUserCaptureScreen(CALLBACK) 3 | sidebar_label: onUserCaptureScreen 4 | --- 5 | 6 | 7 | 监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.onUserCaptureScreen(() => { 15 | console.log('用户截屏了') 16 | }) 17 | ``` 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.onUserCaptureScreen | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/stopWifi.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopWifi(OBJECT) 3 | sidebar_label: stopWifi 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.stopWifi`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.stopWifi.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.stopWifi(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.stopWifi | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/canvas/createOffscreenCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createOffscreenCanvas() 3 | sidebar_label: createOffscreenCanvas 4 | --- 5 | 6 | 创建离屏 canvas 实例 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => OffscreenCanvas 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## API 支持度 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createOffscreenCanvas | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/card/openCard.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.openCard(OBJECT) 3 | sidebar_label: openCard 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.openCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openCard.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.openCard(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.openCard | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/startWifi.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.startWifi(OBJECT) 3 | sidebar_label: startWifi 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.startWifi`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.startWifi.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.startWifi(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.startWifi | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/files/openDocument.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.openDocument(OBJECT) 3 | sidebar_label: openDocument 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.openDocument`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openDocument.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.openDocument(params).then(...) 15 | ``` 16 | 17 | ## API支持度 18 | 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :-: | :-: | :-: | :-: | 22 | | Taro.openDocument | ✔️ | | | 23 | 24 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/auth/authorize.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.authorize(OBJECT) 3 | sidebar_label: authorize 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.authorize`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.authorize.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.authorize(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.authorize | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/components/open/others.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 其他 3 | sidebar_label: 其他 4 | --- 5 | 6 | ##### 其他组件 7 | 8 | 除导航列表的一些组件外,还有一些差异化组件,每个端不同,后续计划将这些统一封装。目前差异化组件请详看各小程序官网。 9 | 10 | >其他组件请看各小程序官方文档 11 | 12 | [微信小程序](https://developers.weixin.qq.com/miniprogram/dev/component/)。 13 | 14 | [百度小程序](https://smartprogram.baidu.com/docs/develop/component/view/)。 15 | 16 | [支付宝小程序](https://docs.alipay.com/mini/component/overview)。 17 | 18 | [字节跳动小程序](https://microapp.bytedance.com/docs/zh-CN/mini-app/develop/component/all)。 19 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/team-core.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Core 团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | ## 成员 8 | 9 | 10 | 11 | ### Cli 工作组 12 | 13 | 主要负责 Taro 命令行工具的开发和维护工作。 14 | 15 | ### Compile 工作组 16 | 17 | 负责维护、优化小程序和 H5 的编译系统。 18 | 19 | ### Runtime 工作组 20 | 21 | 负责维护小程序运行时系统。 22 | 23 | ## 荣誉成员 24 | 25 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 26 | 27 | 28 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/onBluetoothDeviceFound.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBluetoothDeviceFound(CALLBACK) 3 | sidebar_label: onBluetoothDeviceFound 4 | --- 5 | 6 | 使用方式同 [`wx.onBluetoothDeviceFound `](https://developers.weixin.qq.com/miniprogram/dev/api/wx.onBluetoothDeviceFound.html)。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.onBluetoothDeviceFound(devices => { 14 | console.log(devices) 15 | console.log(devices[0].advertisData) 16 | }) 17 | ``` 18 | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/files/getFileInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getFileInfo(OBJECT) 3 | sidebar_label: getFileInfo 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getFileInfo`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getFileInfo.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getFileInfo(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getFileInfo | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigation/reLaunch.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.reLaunch(OBJECT) 3 | sidebar_label: reLaunch 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.reLaunch`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.reLaunch.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.reLaunch(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.reLaunch | ✔️ | ✔️ | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/updates/getUpdateManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getUpdateManager() 3 | sidebar_label: getUpdateManager 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getUpdateManager`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getUpdateManager.html)。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getUpdateManager() 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getUpdateManager | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ibeacon/getBeacons.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getBeacons(OBJECT) 3 | sidebar_label: getBeacons 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getBeacons`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getBeacons.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getBeacons(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getBeacons | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/nfc/getHCEState.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getHCEState(OBJECT) 3 | sidebar_label: getHCEState 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getHCEState`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getHCEState.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getHCEState(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getHCEState | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigation/navigateBack.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.navigateBack(OBJECT) 3 | sidebar_label: navigateBack 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.navigateBack`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.navigateBack.html)。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.navigateBack({ delta: 2 }) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.navigateBack | ✔️ | ✔️ | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigation/switchTab.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.switchTab(OBJECT) 3 | sidebar_label: switchTab 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.switchTab`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.switchTab.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.switchTab(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.switchTab | ✔️ | ✔️ | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/settings/getSetting.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getSetting(OBJECT) 3 | sidebar_label: getSetting 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getSetting`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getSetting.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getSetting(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getSetting | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/mini-troubleshooting.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 常见问题 3 | --- 4 | 5 | 各小程序常见问题汇总。 6 | 7 | ## 微信小程序 8 | 9 | ### 热重载 10 | 11 | 打开微信小程序开发者工具的“热重载”功能,可以在修改**页面 JS 文件**、**样式文件**后快速在开发者工具显示更新的内容,极大地提升了开发体验。 12 | 13 | 在 Taro 中,样式文件的热重载是直接支持的,而页面 JS 文件的热重载在 `Taro v3.3.17` 版本后支持,且需要额外配置: 14 | 15 | - `Taro v3.3.17+`:手动为需要热重载的页面增加兼容代码,请参考:[#10722](https://github.com/NervJS/taro/issues/10722#issuecomment-992247021) 16 | - `Taro v3.4.0+`:打开编译配置 [mini.hot](./config-detail#minihot) 即可。 17 | 18 | > **注意:**目前微信小程序的 JS 文件热重载只支持页面文件,而不包括其依赖。 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/notifyBLECharacteristicValueChange.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.notifyBLECharacteristicValueChange(OBJECT) 3 | sidebar_label: notifyBLECharacteristicValueChange 4 | --- 5 | 6 | 使用方式同 [`wx.notifyBLECharacteristicValueChange`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.notifyBLECharacteristicValueChange.html),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.notifyBLECharacteristicValueChange(params).then(...) 14 | ``` 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/nfc/sendHCEMessage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.sendHCEMessage(OBJECT) 3 | sidebar_label: sendHCEMessage 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.sendHCEMessage`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.sendHCEMessage.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.sendHCEMessage(params).then(...) 15 | ``` 16 | ## API支持度 17 | 18 | 19 | | API | 微信小程序 | H5 | React Native | 20 | | :-: | :-: | :-: | :-: | 21 | | Taro.sendHCEMessage | ✔️ | | | 22 | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/phone/makePhoneCall.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.makePhoneCall(OBJECT) 3 | sidebar_label: makePhoneCall 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.makePhoneCall`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.makePhoneCall.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.makePhoneCall(params).then(...) 15 | ``` 16 | ## API支持度 17 | 18 | 19 | | API | 微信小程序 | H5 | React Native | 20 | | :-: | :-: | :-: | :-: | 21 | | Taro.makePhoneCall | ✔️ | ✔️ | ✔️ | 22 | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/connectWifi.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.connectWifi(OBJECT) 3 | sidebar_label: connectWifi 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.connectWifi`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.connectWifi.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.connectWifi(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.connectWifi | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/setWifiList.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setWifiList(OBJECT) 3 | sidebar_label: setWifiList 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.setWifiList`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.setWifiList.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.setWifiList(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.setWifiList | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/async-await.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 异步编程 3 | --- 4 | 5 | Taro 支持使用 `async functions` 来让开发者获得不错的异步编程体验,开启 `async functions` 支持需要安装包 `@tarojs/async-await` 6 | 7 | ```bash 8 | $ yarn add @tarojs/async-await 9 | # 或者使用 npm 10 | $ npm install --save @tarojs/async-await 11 | ``` 12 | 13 | 随后在项目入口文件 `app.js` 中直接 `import` ,就可以开始使用 `async functions` 功能了 14 | 15 | ```javascript 16 | // src/app.js 17 | import '@tarojs/async-await' 18 | ``` 19 | 20 | > 值得注意的事,使用 `@tarojs/async-await` 一定要记得按照[开发前注意](./before-dev-remind.md)中提示的内容进行操作,否则会出现报错 21 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigation/navigateTo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.navigateTo(OBJECT) 3 | sidebar_label: navigateTo 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.navigateTo`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.navigateTo.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.navigateTo(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.navigateTo | ✔️ | ✔️ | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigation/redirectTo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.redirectTo(OBJECT) 3 | sidebar_label: redirectTo 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.redirectTo`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.redirectTo.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.redirectTo(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.redirectTo | ✔️ | ✔️ | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/settings/openSetting.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.openSetting(OBJECT) 3 | sidebar_label: openSetting 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.openSetting`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openSetting.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.openSetting(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.openSetting | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/userinfo/getUserInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getUserInfo(OBJECT) 3 | sidebar_label: getUserInfo 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getUserInfo`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getUserInfo.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getUserInfo(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getUserInfo | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /docs/apis/base/preload.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.preload(options) 3 | sidebar_label: preload 4 | --- 5 | 6 | 跳转预加载 API 7 | 8 | ## 类型 9 | 10 | ```tsx 11 | { (options: Record): any; (key: string, value: any): any; } 12 | ``` 13 | 14 | ## 参数 15 | 16 | | 参数 | 类型 | 说明 | 17 | | --- | --- | --- | 18 | | options | `Record` | 预加载的数据
param: options 预加载的数据 | 19 | 20 | ## 示例代码 21 | 22 | ### 示例 1 23 | 24 | ```tsx 25 | Taro.preload({ key: 'value' }) 26 | ``` 27 | 28 | ### 示例 2 29 | 30 | ```tsx 31 | Taro.preload('key', 'value') 32 | ``` 33 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/bluetooth/onBluetoothAdapterStateChange.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBluetoothAdapterStateChange(CALLBACK) 3 | sidebar_label: onBluetoothAdapterStateChange 4 | --- 5 | 6 | 使用方式同 [`wx.onBluetoothAdapterStateChange`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.onBluetoothAdapterStateChange.html)。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.onBluetoothAdapterStateChange(res => { 14 | console.log(`adapterState changed, now is`, res) 15 | }) 16 | ``` 17 | 18 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/contacts/addPhoneContact.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.addPhoneContact(OBJECT) 3 | sidebar_label: addPhoneContact 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.addPhoneContact`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.addPhoneContact.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.addPhoneContact(params).then(...) 15 | ``` 16 | ## API支持度 17 | 18 | 19 | | API | 微信小程序 | H5 | React Native | 20 | | :-: | :-: | :-: | :-: | 21 | | Taro.addPhoneContact | ✔️ | | | 22 | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/login/checkSession.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.checkSession(OBJECT) 3 | sidebar_label: checkSession 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.checkSession`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.checkSession.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.checkSession(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.checkSession | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/werun/getWeRunData.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getWeRunData(OBJECT) 3 | sidebar_label: getWeRunData 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getWeRunData`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getWeRunData.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getWeRunData(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getWeRunData | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/media/video-processing/createMediaContainer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMediaContainer() 3 | sidebar_label: createMediaContainer 4 | --- 5 | 6 | 创建音视频处理容器,最终可将容器中的轨道合成一个视频 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/wx.createMediaContainer.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => MediaContainer 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## API 支持度 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createMediaContainer | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/topbar/setTopBarText.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setTopBarText(OBJECT) 3 | sidebar_label: setTopBarText 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.setTopBarText`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.setTopBarText.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.setTopBarText(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.setTopBarText | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/address/chooseAddress.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.chooseAddress(OBJECT) 3 | sidebar_label: chooseAddress 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.chooseAddress`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.chooseAddress.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.chooseAddress(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.chooseAddress | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/invoice/chooseInvoice.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.chooseInvoice(OBJECT) 3 | sidebar_label: chooseInvoice 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.chooseInvoice`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.chooseInvoice.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.chooseInvoice(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.chooseInvoice | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | **这个 PR 做了什么?** (简要描述所做更改) 10 | 11 | 12 | 13 | **这个 PR 是什么类型?** (至少选择一个) 14 | 15 | - [ ] 错误修复(Bugfix) issue id # 16 | - [ ] 新功能(Feature) 17 | - [ ] 代码重构(Refactor) 18 | - [ ] TypeScript 类型定义修改(Typings) 19 | - [ ] 文档修改(Docs) 20 | - [ ] 代码风格更新(Code style update) 21 | - [ ] 贡献者角色申请/提名 22 | - [ ] 其他,请描述(Other, please describe): 23 | -------------------------------------------------------------------------------- /docs/team/team-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Plugin 团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责维护各 Taro 插件,包括端平台插件,React、Vue DevTools 等。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ### 端平台插件工作组 14 | 15 | 负责维护各端平台插件,包括对微信、支付宝、百度、字节跳动、QQ、京东、企业微信、飞书、快手、钉钉、小红书等厂商小程序的适配等。 16 | 17 | ### 混合开发工作组 18 | 19 | 负责维护 Taro 与原生小程序的相互调用功能、Taro 开发原生插件等。 20 | 21 | ## 荣誉成员 22 | 23 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 24 | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/getConnectedWifi.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getConnectedWifi(OBJECT) 3 | sidebar_label: getConnectedWifi 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getConnectedWifi`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getConnectedWifi.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getConnectedWifi(params).then(...) 15 | ``` 16 | 17 | ## API支持度 18 | 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :-: | :-: | :-: | :-: | 22 | | Taro.getConnectedWifi | ✔️ | | | 23 | 24 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/files/removeSavedFile.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.removeSavedFile(OBJECT) 3 | sidebar_label: removeSavedFile 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.removeSavedFile`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.removeSavedFile.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.removeSavedFile(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.removeSavedFile | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/setTabBarItem.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setTabBarItem(OBJECT) 3 | sidebar_label: setTabBarItem 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.setTabBarItem`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.setTabBarItem.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.setTabBarItem(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.setTabBarItem | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/brightness/setKeepScreenOn.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setKeepScreenOn(OBJECT) 3 | sidebar_label: setKeepScreenOn 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.setKeepScreenOn`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.setKeepScreenOn.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.setKeepScreenOn(params).then(...) 15 | 16 | ``` 17 | 18 | ## API支持度 19 | 20 | 21 | | API | 微信小程序 | H5 | React Native | 22 | | :-: | :-: | :-: | :-: | 23 | | Taro.setKeepScreenOn | ✔️ | | | 24 | 25 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/extend-apis/base64ToArrayBuffer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: base64ToArrayBuffer 3 | sidebar_label: base64ToArrayBuffer 4 | --- 5 | 6 | 将 Base64 字符串转成 ArrayBuffer 数据。(小程序端基础库 1.1.0 开始支持,低版本需做兼容处理) 7 | 8 | **示例代码:** 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | const base64 = 'CxYh' 14 | const arrayBuffer = Taro.base64ToArrayBuffer(base64) 15 | ``` 16 | 17 | > API 支持度 18 | 19 | | API | 微信小程序 | H5 | React Native | 20 | | :-: | :-: | :-: | :-: | 21 | | Taro.arrayBufferToBase64 | ✔️ | ✔️ | | 22 | | Taro.base64ToArrayBuffer | ✔️ | ✔️ | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/files/getSavedFileInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getSavedFileInfo(OBJECT) 3 | sidebar_label: getSavedFileInfo 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getSavedFileInfo`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getSavedFileInfo.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getSavedFileInfo(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getSavedFileInfo | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/files/getSavedFileList.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getSavedFileList(OBJECT) 3 | sidebar_label: getSavedFileList 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getSavedFileList`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getSavedFileList.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getSavedFileList(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getSavedFileList | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/setTabBarBadge.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setTabBarBadge(OBJECT) 3 | sidebar_label: setTabBarBadge 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.setTabBarBadge`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.setTabBarBadge.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.setTabBarBadge(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.setTabBarBadge | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/setTabBarStyle.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setTabBarStyle(OBJECT) 3 | sidebar_label: setTabBarStyle 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.setTabBarStyle`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.setTabBarStyle.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.setTabBarStyle(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.setTabBarStyle | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/base/preload.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.preload(options) 3 | sidebar_label: preload 4 | --- 5 | 6 | 跳转预加载 API 7 | 8 | ## 类型 9 | 10 | ```tsx 11 | { (options: Record): any; (key: string, value: any): any; } 12 | ``` 13 | 14 | ## 参数 15 | 16 | | 参数 | 类型 | 说明 | 17 | | --- | --- | --- | 18 | | options | `Record` | 预加载的数据
param: options 预加载的数据 | 19 | 20 | ## 示例代码 21 | 22 | ### 示例 1 23 | 24 | ```tsx 25 | Taro.preload({ key: 'value' }) 26 | ``` 27 | 28 | ### 示例 2 29 | 30 | ```tsx 31 | Taro.preload('key', 'value') 32 | ``` 33 | -------------------------------------------------------------------------------- /packages/taro-components/types/PickerViewColumn.d.ts: -------------------------------------------------------------------------------- 1 | import { ComponentType } from 'react' 2 | import { StandardProps } from './common' 3 | 4 | type PickerViewColumnProps = StandardProps 5 | 6 | /** 滚动选择器子项 7 | * 仅可放置于 `` 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致 8 | * @classification forms 9 | * @supported weapp, swan, alipay, tt, h5, rn 10 | * @see https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html 11 | */ 12 | declare const PickerViewColumn: ComponentType 13 | 14 | export { PickerViewColumn, PickerViewColumnProps } 15 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/wifi/getWifiList.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getWifiList(OBJECT) 3 | sidebar_label: getWifiList 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getWifiList`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getWifiList.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getWifiList(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getWifiList | ✔️ | | | 25 | | Taro.onGetWifiList | ✔️ | | | 26 | 27 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/audio/playVoice.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.playVoice(OBJECT) 3 | sidebar_label: playVoice 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.playVoice`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.playVoice.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.playVoice(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.playVoice | ✔️ | | | | | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/map/createMapContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMapContext(mapId, this.$scope) 3 | sidebar_label: createMapContext 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.createMapContext`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.createMapContext.html)。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | const mapCtx = Taro.createMapContext('myMap') 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.createMapContext | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/hideTabBar.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.hideTabBar(OBJECT) 3 | sidebar_label: hideTabBar 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.hideTabBar`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.hideTabBar.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.hideTabBar(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.hideTabBarRedDot | ✔️ | ✔️ | | 25 | | Taro.hideTabBar | ✔️ | ✔️ | | 26 | 27 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/hideTabBarRedDot.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.hideTabBarRedDot(OBJECT) 3 | sidebar_label: hideTabBarRedDot 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.hideTabBarRedDot`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.hideTabBarRedDot.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.hideTabBarRedDot(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.hideTabBarRedDot | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/showTabBar.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.showTabBar(OBJECT) 3 | sidebar_label: showTabBar 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.showTabBar`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.showTabBar.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.showTabBar(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.showTabBarRedDot | ✔️ | ✔️ | | 25 | | Taro.showTabBar | ✔️ | ✔️ | | 26 | 27 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/showTabBarRedDot.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.showTabBarRedDot(OBJECT) 3 | sidebar_label: showTabBarRedDot 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.showTabBarRedDot`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.showTabBarRedDot.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.showTabBarRedDot(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.showTabBarRedDot | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/storage/removeStorageSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.removeStorageSync(KEY) 3 | sidebar_label: removeStorageSync 4 | --- 5 | 6 | 7 | 从本地缓存中同步移除指定 key 。 8 | 9 | **参数说明:** 10 | 11 | | 参数 | 类型 | 必填 | 说明 | 12 | | :-- | :-- | :-- | :-- | 13 | | key | String | 是 | 本地缓存中的指定的 key | 14 | 15 | ## 示例代码 16 | 17 | ```jsx 18 | import Taro from '@tarojs/taro' 19 | 20 | Taro.removeStorageSync('key') 21 | ``` 22 | 23 | 24 | 25 | ## API支持度 26 | 27 | 28 | | API | 微信小程序 | H5 | React Native | 29 | | :-: | :-: | :-: | :-: | 30 | | Taro.removeStorageSync | ✔️ | ✔️ | | 31 | 32 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/alipay/getOpenUserInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getOpenUserInfo() 3 | sidebar_label: getOpenUserInfo 4 | --- 5 | 6 | 此接口可获取支付宝会员的基础信息(头像图片地址、昵称、性别、国家码、省份、所在市区),接入方法请参考 获取会员基础信息介绍。如需获取支付宝会员标识(user_id),请调用 my.getAuthCode 和 alipay.system.oauth.token 接口。 7 | 8 | > [参考文档](https://docs.alipay.com/mini/api/ch8chh) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => Promise 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## API 支持度 19 | 20 | | API | 微信小程序 | 支付宝小程序 | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | :---: | 22 | | Taro.getOpenUserInfo | | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/tabbar/removeTabBarBadge.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.removeTabBarBadge(OBJECT) 3 | sidebar_label: removeTabBarBadge 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.removeTabBarBadge`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.removeTabBarBadge.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.removeTabBarBadge(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.removeTabBarBadge | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/storage/getStorageSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getStorageSync(KEY) 3 | sidebar_label: getStorageSync 4 | --- 5 | 6 | 7 | 从本地缓存中同步获取指定 key 对应的内容。 8 | 9 | **参数说明:** 10 | 11 | | 参数 | 类型 | 必填 | 说明 | 12 | | :-- | :-- | :-- | :-- | 13 | | key | String | 是 | 本地缓存中的指定的 key | 14 | 15 | ## 示例代码 16 | 17 | ```jsx 18 | import Taro from '@tarojs/taro' 19 | 20 | const data = Taro.getStorageSync('key') 21 | ``` 22 | 23 | 24 | 25 | ## API支持度 26 | 27 | 28 | | API | 微信小程序 | H5 | React Native | 29 | | :-: | :-: | :-: | :-: | 30 | | Taro.getStorageSync | ✔️ | ✔️ | | 31 | 32 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/team-plugin.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Plugin 团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责维护各 Taro 插件,包括端平台插件,React、Vue DevTools 等。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ### 端平台插件工作组 14 | 15 | 负责维护各端平台插件,包括对微信、支付宝、百度、字节跳动、QQ、京东、企业微信、飞书、快手、钉钉、小红书等厂商小程序的适配等。 16 | 17 | ### 混合开发工作组 18 | 19 | 负责维护 Taro 与原生小程序的相互调用功能、Taro 开发原生插件等。 20 | 21 | ## 荣誉成员 22 | 23 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 24 | 25 | 26 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/files/getFileSystemManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getFileSystemManager() 3 | sidebar_label: getFileSystemManager 4 | --- 5 | 6 | Gets the globally unique file manager. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/file/wx.getFileSystemManager.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => FileSystemManager 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.getFileSystemManager | ✔️ | | | 23 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/files/getFileSystemManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getFileSystemManager() 3 | sidebar_label: getFileSystemManager 4 | --- 5 | 6 | Gets the globally unique file manager. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/file/wx.getFileSystemManager.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => FileSystemManager 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.getFileSystemManager | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/navigation/getCurrentPages.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getCurrentPages(OBJECT) 3 | sidebar_label: getCurrentPages 4 | --- 5 | 6 | 7 | 使用方式同 [`getCurrentPages`](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/route.html#getcurrentpages), 获取当前的页面栈,决定需要返回几层。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getCurrentPages().length 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getCurrentPages | ✔️ | | ✔️| 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/invoice/chooseInvoiceTitle.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.chooseInvoiceTitle(OBJECT) 3 | sidebar_label: chooseInvoiceTitle 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.chooseInvoiceTitle`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.chooseInvoiceTitle.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.chooseInvoiceTitle(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.chooseInvoiceTitle | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/network/udp/createUDPSocket.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createUDPSocket() 3 | sidebar_label: createUDPSocket 4 | --- 5 | 6 | 创建一个 UDP Socket 实例。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/wx.createUDPSocket.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => UDPSocket 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## API 支持度 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createUDPSocket | ✔️ | | | 23 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/canvas/createOffscreenCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createOffscreenCanvas() 3 | sidebar_label: createOffscreenCanvas 4 | --- 5 | 6 | Creates an off-screen canvas instance. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/canvas/wx.createOffscreenCanvas.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => OffscreenCanvas 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createOffscreenCanvas | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ibeacon/stopBeaconDiscovery.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopBeaconDiscovery(OBJECT) 3 | sidebar_label: stopBeaconDiscovery 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.stopBeaconDiscovery`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.stopBeaconDiscovery.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.stopBeaconDiscovery(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.stopBeaconDiscovery | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/camera/createCameraContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createCameraContext(this.$scope) 3 | sidebar_label: createCameraContext 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.createCameraContext`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.createCameraContext.html)。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | const cameraContext = Taro.createCameraContext() 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.createCameraContext | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/payment/faceVerifyForPay.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.faceVerifyForPay(OBJECT) 3 | sidebar_label: faceVerifyForPay 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.faceVerifyForPay`](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/payment/wx.faceVerifyForPay.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.faceVerifyForPay(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.faceVerifyForPay | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/canvas/createOffscreenCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createOffscreenCanvas() 3 | sidebar_label: createOffscreenCanvas 4 | --- 5 | 6 | Creates an off-screen canvas instance. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/canvas/wx.createOffscreenCanvas.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => OffscreenCanvas 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createOffscreenCanvas | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/brightness/getScreenBrightness.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getScreenBrightness(OBJECT) 3 | sidebar_label: getScreenBrightness 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getScreenBrightness`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getScreenBrightness.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getScreenBrightness(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.getScreenBrightness | ✔️ | | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/components/forms/picker-view-column.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PickerViewColumn 3 | sidebar_label: PickerViewColumn 4 | --- 5 | 6 | 滚动选择器子项 7 | 仅可放置于 `` 中,其孩子节点的高度会自动设置成与 picker-view 的选中框的高度一致 8 | 9 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html) 10 | 11 | ## 类型 12 | 13 | ```tsx 14 | ComponentType 15 | ``` 16 | 17 | ## API 支持度 18 | 19 | | API | 微信小程序 | 百度小程序 | 支付宝小程序 | 字节跳动小程序 | H5 | React Native | 20 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | 21 | | PickerViewColumn | ✔️ | ✔️ | ✔️ | ✔️ | | | 22 | -------------------------------------------------------------------------------- /docs/taroize.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 微信小程序转 Taro 3 | --- 4 | 5 | Taro 可以把**原生微信小程序应用转换为 Taro 项目**,从而使项目成为多端应用。 6 | 7 | 转换后的代码可读性高,能够继续使用 **React**(将来支持转换为 **Vue**)进行二次开发。 8 | 9 | ### 反向转换步骤 10 | 11 | 1. 安装 Taro 命令行工具: 12 | 13 | ```bash 14 | $ npm i -g @tarojs/cli 15 | ``` 16 | 17 | 2. 在微信小程序项目的根目录中运行 `convert` 命令进行转换: 18 | 19 | ```bash 20 | # 转换后的代码保存在根目录下的 `taroConvert` 文件夹下 21 | $ taro convert 22 | ``` 23 | 24 | 3. 进入 `taroConvert` 目录,安装依赖: 25 | 26 | ```bash 27 | $ cd taroConvert 28 | $ npm install 29 | ``` 30 | 31 | 4. 运行 `build` 命令,把项目编译到任意平台: 32 | 33 | ```bash 34 | $ taro build --type [platform] 35 | ``` 36 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/brightness/setScreenBrightness.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setScreenBrightness(OBJECT) 3 | sidebar_label: setScreenBrightness 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.setScreenBrightness`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.setScreenBrightness.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.setScreenBrightness(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.setScreenBrightness | ✔️ | | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ibeacon/startBeaconDiscovery.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.startBeaconDiscovery(OBJECT) 3 | sidebar_label: startBeaconDiscovery 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.startBeaconDiscovery`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.startBeaconDiscovery.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.startBeaconDiscovery(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.startBeaconDiscovery | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/scancode/scancode.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.scanCode(OBJECT) 3 | sidebar_label: scanCode 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.scanCode`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.scanCode.html),h5端仅支持[微信公众号](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)(API以小程序为准),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.scanCode(params).then(...) 15 | ``` 16 | 17 | ## API支持度 18 | 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :-: | :-: | :-: | :-: | 22 | | Taro.scanCode | ✔️ | ✔️ | | 23 | 24 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/location/openLocation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.openLocation(OBJECT) 3 | sidebar_label: openLocation 4 | --- 5 | 6 | 使用方式同 [`wx.openLocation`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openLocation.html),h5端仅支持[微信公众号](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)(API以小程序为准),支持 `Promise` 化使用。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.openLocation(params).then(...) 14 | ``` 15 | 16 | > API 支持度 17 | 18 | | API | 微信小程序 | H5 | React Native | 19 | | :-: | :-: | :-: | :-: | 20 | | Taro.openLocation | ✔️ | ✔️ | | 21 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/getBackgroundAudioManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getBackgroundAudioManager(OBJECT) 3 | sidebar_label: getBackgroundAudioManager 4 | --- 5 | 6 | 背景音频播放管理。 7 | 8 | 使用方式同 [`wx.getBackgroundAudioManager`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getBackgroundAudioManager.html)。 9 | 10 | ## 示例代码 11 | 12 | ```jsx 13 | Taro.getBackgroundAudioManager(params).then(...) 14 | ``` 15 | 16 | ## API 支持度 17 | 18 | | API | 微信小程序 | H5 | React Native | 19 | | :-: | :-: | :-: | :-: | 20 | | Taro.getBackgroundAudioManager | ✔️ | | | 21 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/open-api/payment/faceVerifyForPay.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.faceVerifyForPay(option) 3 | sidebar_label: faceVerifyForPay 4 | --- 5 | 6 | 支付各个安全场景验证人脸 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/payment/wx.faceVerifyForPay.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | (option: any) => Promise 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## 示例代码 19 | 20 | ```tsx 21 | Taro.faceVerifyForPay(params).then(...) 22 | ``` 23 | 24 | ## API 支持度 25 | 26 | | API | 微信小程序 | H5 | React Native | 27 | | :---: | :---: | :---: | :---: | 28 | | Taro.faceVerifyForPay | ✔️ | | | 29 | -------------------------------------------------------------------------------- /docs/team/team-platform.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Platform 团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责 App、Web、Open Harmony 等跨平台开发。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ### H5 工作组 14 | 15 | 负责维护 H5 的各模块,包括路由、组件库、API 库等。 16 | 17 | ### React Native 工作组 18 | 19 | 负责React Native适配核心、组件库、API 库等部分的开发。 20 | 21 | ### Open Harmony 工作组 22 | 23 | 负责鸿蒙适配核心、组件库、API 库等部分的开发。 24 | 25 | ### 快应用工作组 26 | 27 | ## 荣誉成员 28 | 29 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 30 | 31 | 32 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/ble/onBLEConnectionStateChange.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onBLEConnectionStateChange(CALLBACK) 3 | sidebar_label: onBLEConnectionStateChange 4 | --- 5 | 6 | 使用方式同 [`wx.onBLEConnectionStateChange`](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.onBLEConnectionStateChange.html)。 7 | 8 | ## 示例代码 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.onBLEConnectionStateChange(res => { 14 | // 该方法回调中可以用于处理连接意外断开等异常情况 15 | console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`) 16 | }) 17 | ``` 18 | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/redirect/navigateToMiniProgram.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.navigateToMiniProgram(OBJECT) 3 | sidebar_label: navigateToMiniProgram 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.navigateToMiniProgram`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.navigateToMiniProgram.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.navigateToMiniProgram(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.navigateToMiniProgram | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/audio/stopVoice.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopVoice() 3 | sidebar_label: stopVoice 4 | --- 5 | 6 | 7 | 结束播放语音。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.startRecord(params) 15 | .then(res => { 16 | const filePath = res.tempFilePath 17 | Taro.playVoice({ filePath }) 18 | 19 | setTimeout(Taro.stopVoice, 5000) 20 | }) 21 | ``` 22 | 23 | 24 | 25 | ## API支持度 26 | 27 | 28 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 29 | | :-: | :-: | :-: | :-: | :-: | :-: | 30 | | Taro.stopVoice | ✔️ | | | | | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /docs/apis/base/env/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: env 3 | sidebar_label: env 4 | --- 5 | 6 | 支持情况: 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/env/envObj.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | { [key: string]: string; USER_DATA_PATH: string; } 14 | ``` 15 | -------------------------------------------------------------------------------- /typings/github.d.ts: -------------------------------------------------------------------------------- 1 | declare module "github" { 2 | interface IGithubContributor { 3 | login?: string 4 | id?: number 5 | node_id?: string 6 | avatar_url?: string 7 | gravatar_id?: string 8 | url?: string 9 | html_url?: string 10 | followers_url?: string 11 | following_url?: string 12 | gists_url?: string 13 | starred_url?: string 14 | subscriptions_url?: string 15 | organizations_url?: string 16 | repos_url?: string 17 | events_url?: string 18 | received_events_url?: string 19 | type?: string 20 | site_admin?: boolean 21 | contributions?: number 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/window/offWindowResize.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.offWindowResize(callback) 3 | sidebar_label: offWindowResize 4 | --- 5 | 6 | 取消监听窗口尺寸变化事件。 7 | 8 | ## 参数 9 | 10 | ### callback(res) 11 | 12 | 窗口尺寸变化事件的回调函数。 13 | 14 | #### 参数 15 | 16 | ##### object res 17 | 18 | | Name | Type | Description | 19 | | --- | --- | --- | 20 | | windowWidth | number | 变化后的窗口宽度,单位 px | 21 | | windowHeight | number | 变化后的窗口高度,单位 px | 22 | 23 | ## API支持度 24 | 25 | | API | 微信小程序 | H5 | React Native | 26 | | :-: | :-: | :-: | :-: | 27 | | Taro.offWindowResize | ✔️ | ✔️ | | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/taroize.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 微信小程序转 Taro 3 | --- 4 | 5 | Taro 可以把**原生微信小程序应用转换为 Taro 项目**,从而使项目成为多端应用。 6 | 7 | 转换后的代码可读性高,能够继续使用 **React**(将来支持转换为 **Vue**)进行二次开发。 8 | 9 | ### 反向转换步骤 10 | 11 | 1. 安装 Taro 命令行工具: 12 | 13 | ```bash 14 | $ npm i -g @tarojs/cli 15 | ``` 16 | 17 | 2. 在微信小程序项目的根目录中运行 `convert` 命令进行转换: 18 | 19 | ```bash 20 | # 转换后的代码保存在根目录下的 `taroConvert` 文件夹下 21 | $ taro convert 22 | ``` 23 | 24 | 3. 进入 `taroConvert` 目录,安装依赖: 25 | 26 | ```bash 27 | $ cd taroConvert 28 | $ npm install 29 | ``` 30 | 31 | 4. 运行 `build` 命令,把项目编译到任意平台: 32 | 33 | ```bash 34 | $ taro build --type [platform] 35 | ``` 36 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/video/saveVideoToPhotosAlbum.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.saveVideoToPhotosAlbum(OBJECT) 3 | sidebar_label: saveVideoToPhotosAlbum 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.saveVideoToPhotosAlbum`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.saveVideoToPhotosAlbum.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.saveVideoToPhotosAlbum(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.saveVideoToPhotosAlbum | ✔️ | | ✔️ | 25 | 26 | 27 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/redirect/navigateBackMiniProgram.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.navigateBackMiniProgram(OBJECT) 3 | sidebar_label: navigateBackMiniProgram 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.navigateBackMiniProgram`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.navigateBackMiniProgram.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.navigateBackMiniProgram(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.navigateBackMiniProgram | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/media/camera/createCameraContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createCameraContext() 3 | sidebar_label: createCameraContext 4 | --- 5 | 6 | 创建 camera 上下文 CameraContext 对象。 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/wx.createCameraContext.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => CameraContext 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## 示例代码 19 | 20 | ```tsx 21 | const cameraContext = Taro.createCameraContext() 22 | ``` 23 | 24 | ## API 支持度 25 | 26 | | API | 微信小程序 | H5 | React Native | 27 | | :---: | :---: | :---: | :---: | 28 | | Taro.createCameraContext | ✔️ | | | 29 | -------------------------------------------------------------------------------- /src/theme/navbar.module.css: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Copyright (c) Facebook, Inc. and its affiliates. 4 | * 5 | * This source code is licensed under the MIT license found in the 6 | * LICENSE file in the root directory of this source tree. 7 | */ 8 | 9 | @media screen and (max-width: 997px) { 10 | .displayOnlyInLargeViewport { 11 | display: none !important; 12 | } 13 | } 14 | 15 | @media (max-width: 360px) { 16 | .hideLogoText { 17 | display: none; 18 | } 19 | } 20 | 21 | .navbarHideable { 22 | transition: top 0.2s ease-in-out; 23 | } 24 | 25 | .navbarHidden { 26 | top: calc(var(--ifm-navbar-height) * -1) !important; 27 | } 28 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/bioauth/startSoterAuthentication.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.startSoterAuthentication(OBJECT) 3 | sidebar_label: startSoterAuthentication 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.startSoterAuthentication`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.startSoterAuthentication.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.startSoterAuthentication(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.startSoterAuthentication | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/team/team-platform.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Platform 团队 3 | --- 4 | 5 | import { ListPage } from './components' 6 | 7 | 负责 App、Web、Open Harmony 等跨平台开发。 8 | 9 | ## 成员 10 | 11 | 12 | 13 | ### H5 工作组 14 | 15 | 负责维护 H5 的各模块,包括路由、组件库、API 库等。 16 | 17 | ### React Native 工作组 18 | 19 | 负责React Native适配核心、组件库、API 库等部分的开发。 20 | 21 | ### Open Harmony 工作组 22 | 23 | 负责鸿蒙适配核心、组件库、API 库等部分的开发。 24 | 25 | ### 快应用工作组 26 | 27 | ## 荣誉成员 28 | 29 | 我们也要感谢所有过去的成员,感谢他们的宝贵贡献! 30 | 31 | 32 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/about/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Operating environment 3 | --- 4 | 5 | ## Taro.ENV_TYPE 6 | 7 | `ENV_TYPE.WEAPP` WeChat Mini-Program 8 | 9 | `ENV_TYPE.SWAN` Baidu Smart-Program 10 | 11 | `ENV_TYPE.ALIPAY` Alipay Mini-Program 12 | 13 | `ENV_TYPE.TT` ByteDance Mini-Program 14 | 15 | `ENV_TYPE.WEB` WEB(H5) 16 | 17 | `ENV_TYPE.RN` ReactNative 18 | 19 | `ENV_TYPE.QUICKAPP` Quick-App 20 | 21 | `ENV_TYPE.QQ` QQ Mini-Program 22 | 23 | `ENV_TYPE.JD` Jingdong Mini-Program 24 | 25 | ## Taro.getEnv() 26 | 27 | Gets the current environment value and returns the value as above. 28 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/playBackgroundAudio.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.playBackgroundAudio(OBJECT) 3 | sidebar_label: playBackgroundAudio 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.playBackgroundAudio`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.playBackgroundAudio.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.playBackgroundAudio(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.playBackgroundAudio | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/seekBackgroundAudio.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.seekBackgroundAudio(OBJECT) 3 | sidebar_label: seekBackgroundAudio 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.seekBackgroundAudio`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.seekBackgroundAudio.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.seekBackgroundAudio(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.seekBackgroundAudio | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/about/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Operating environment 3 | --- 4 | 5 | ## Taro.ENV_TYPE 6 | 7 | `ENV_TYPE.WEAPP` WeChat Mini-Program 8 | 9 | `ENV_TYPE.SWAN` Baidu Smart-Program 10 | 11 | `ENV_TYPE.ALIPAY` Alipay Mini-Program 12 | 13 | `ENV_TYPE.TT` ByteDance Mini-Program 14 | 15 | `ENV_TYPE.WEB` WEB(H5) 16 | 17 | `ENV_TYPE.RN` ReactNative 18 | 19 | `ENV_TYPE.QUICKAPP` Quick-App 20 | 21 | `ENV_TYPE.QQ` QQ Mini-Program 22 | 23 | `ENV_TYPE.JD` Jingdong Mini-Program 24 | 25 | ## Taro.getEnv() 26 | 27 | Gets the current environment value and returns the value as above. 28 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/base/env/env.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: env 3 | sidebar_label: env 4 | --- 5 | 6 | 支持情况: 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/env/envObj.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | { [key: string]: string; USER_DATA_PATH: string; } 14 | ``` 15 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/open-api/card/card.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 卡券 3 | sidebar_label: 卡券 4 | --- 5 | 6 | ## [Taro.addCard(OBJECT)](./addCard.md) 7 | 8 | **Sample Code:** 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.addCard(params).then(...) 14 | ``` 15 | 16 | ## [Taro.openCard(OBJECT)](./openCard.md) 17 | 18 | **Sample Code:** 19 | 20 | ```jsx 21 | import Taro from '@tarojs/taro' 22 | 23 | Taro.openCard(params).then(...) 24 | ``` 25 | 26 | > API Support 27 | 28 | | API | WeChat Mini-Program | H5 | React Native | 29 | | :-: | :-: | :-: | :-: | 30 | | Taro.addCard | ✔️ | | | 31 | | Taro.openCard | ✔️ | | | 32 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/deviceMotion/stopDeviceMotionListening.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopDeviceMotionListening(callback) 3 | sidebar_label: stopDeviceMotionListening 4 | --- 5 | 6 | 停止监听设备方向的变化。 7 | 8 | ## 参数 9 | 10 | | Name | Type | Default | Description | 11 | | --- | --- | --- | --- | 12 | | success | function | | 接口调用成功的回调函数 | 13 | | fail | function | | 接口调用失败的回调函数 | 14 | | complete | function | | 接口调用结束的回调函数(调用成功、失败都会执行) | 15 | 16 | ## API支持度 17 | 18 | | API | 微信小程序 | H5 | React Native | 19 | | :-: | :-: | :-: | :-: | 20 | | Taro.stopDeviceMotionListening | ✔️ | ✔️ | ✔️ | 21 | 22 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/framework/Page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page 3 | sidebar_label: Page 4 | --- 5 | 6 | Registers a page in the Mini Program. It accepts an `Object` parameter to specify the initial data of the page, lifecycle callbacks, and event handlers. 7 | 8 | ## Methods 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
PropertyTypeDescription
routestringThe path to the current page, a String type value.
26 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/open-api/card/card.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 卡券 3 | sidebar_label: 卡券 4 | --- 5 | 6 | ## [Taro.addCard(OBJECT)](./addCard.md) 7 | 8 | **Sample Code:** 9 | 10 | ```jsx 11 | import Taro from '@tarojs/taro' 12 | 13 | Taro.addCard(params).then(...) 14 | ``` 15 | 16 | ## [Taro.openCard(OBJECT)](./openCard.md) 17 | 18 | **Sample Code:** 19 | 20 | ```jsx 21 | import Taro from '@tarojs/taro' 22 | 23 | Taro.openCard(params).then(...) 24 | ``` 25 | 26 | > API Support 27 | 28 | | API | WeChat Mini-Program | H5 | React Native | 29 | | :-: | :-: | :-: | :-: | 30 | | Taro.addCard | ✔️ | | | 31 | | Taro.openCard | ✔️ | | | 32 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/audio/createAudioContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createAudioContext(audioId, componentInstance) 3 | sidebar_label: createAudioContext 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.createAudioContext`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.createAudioContext.html)。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | const audioCtx = Taro.createAudioContext('myAudio') 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.createAudioContext | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/images/saveImageToPhotosAlbum.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.saveImageToPhotosAlbum(OBJECT) 3 | sidebar_label: saveImageToPhotosAlbum 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.saveImageToPhotosAlbum`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.saveImageToPhotosAlbum.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.saveImageToPhotosAlbum(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.saveImageToPhotosAlbum | ✔️ | | ✔️ | ✔️ | ✔️ | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/bioauth/checkIsSoterEnrolledInDevice.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.checkIsSoterEnrolledInDevice(OBJECT) 3 | sidebar_label: checkIsSoterEnrolledInDevice 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.checkIsSoterEnrolledInDevice`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.checkIsSoterEnrolledInDevice.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.checkIsSoterEnrolledInDevice(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.checkIsSoterEnrolledInDevice | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/payment/requestPayment.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.requestPayment(OBJECT) 3 | sidebar_label: requestPayment 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.requestPayment`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.requestPayment.html),h5端仅支持[微信公众号](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115)(API以小程序为准),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.requestPayment(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.requestPayment | ✔️ | ✔️ | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/storage/setStorageSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.setStorageSync(KEY, DATA) 3 | sidebar_label: setStorageSync 4 | --- 5 | 6 | 7 | 将 data 存储在本地缓存中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。 8 | 9 | **参数说明:** 10 | 11 | | 参数 | 类型 | 必填 | 说明 | 12 | | :-- | :-- | :-- | :-- | 13 | | key | String | 是 | 本地缓存中的指定的 key | 14 | | data | Object/String | 是 | 需要存储的内容 | 15 | 16 | ## 示例代码 17 | 18 | ```jsx 19 | import Taro from '@tarojs/taro' 20 | 21 | Taro.setStorageSync('key', 'value') 22 | ``` 23 | 24 | 25 | 26 | ## API支持度 27 | 28 | 29 | | API | 微信小程序 | H5 | React Native | 30 | | :-: | :-: | :-: | :-: | 31 | | Taro.setStorageSync | ✔️ | ✔️ | | 32 | 33 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/components/media/camera.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Camera 3 | sidebar_label: Camera 4 | --- 5 | 6 | ##### 系统相机 7 | 8 | > 属性及支持度 9 | 10 | | H5 | ReactNative| 属性名 | 类型 | 默认值 | 说明 | 11 | | :-: | :-: | :- | :- | :- | :- | 12 | | | | devicePosition | String | back | 前置或后置,值为 front, back | 13 | | | | onStop | EventHandle | | 摄像头在非正常终止时触发,如退出后台等情况 | 14 | | | | onError | EventHandle | | 用户不允许使用摄像头时触发 | 15 | 16 | >其他相关属性请看各小程序官方文档 17 | 18 | [微信小程序 Camera](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html)。 19 | 20 | [百度小程序 Camera](https://smartprogram.baidu.com/docs/develop/component/media/#camera)。 -------------------------------------------------------------------------------- /docs/apis/device/ibeacon/IBeaconInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: IBeaconInfo 3 | sidebar_label: IBeaconInfo 4 | --- 5 | 6 | ## 方法 7 | 8 | | 参数 | 类型 | 说明 | 9 | | --- | --- | --- | 10 | | uuid | `string` | Beacon 设备广播的 uuid | 11 | | major | `string` | Beacon 设备的主 ID | 12 | | minor | `string` | Beacon 设备的次 ID | 13 | | proximity | `keyof Proximity` | 表示设备距离的枚举值(仅iOS) | 14 | | accuracy | `number` | Beacon 设备的距离,单位 m。iOS 上,proximity 为 0 时,accuracy 为 -1。 | 15 | | rssi | `number` | 表示设备的信号强度,单位 dBm | 16 | 17 | ## 参数 18 | 19 | ### Proximity 20 | 21 | proximity 的合法值 22 | 23 | | 参数 | 说明 | 24 | | --- | --- | 25 | | 0 | 信号太弱不足以计算距离,或非 iOS 设备 | 26 | | 1 | 十分近 | 27 | | 2 | 比较近 | 28 | | 3 | 远 | 29 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/framework/Page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Page 3 | sidebar_label: Page 4 | --- 5 | 6 | Registers a page in the Mini Program. It accepts an `Object` parameter to specify the initial data of the page, lifecycle callbacks, and event handlers. 7 | 8 | ## Methods 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 |
PropertyTypeDescription
routestringThe path to the current page, a String type value.
26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/video/chooseVideo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.chooseVideo(OBJECT) 3 | sidebar_label: chooseVideo 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.chooseVideo`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.chooseVideo.html),支持 `Promise` 化使用。 8 | 9 | 注:RN端该API不支持 `compressed` 、`maxDuration`、`camera` 属性;不支持相册与相机同时选择,只会取 `sourceType` 数组里的第一个值。默认从相册选取视频。 10 | 11 | ## 示例代码 12 | 13 | ```jsx 14 | import Taro from '@tarojs/taro' 15 | 16 | Taro.chooseVideo(params).then(...) 17 | ``` 18 | 19 | 20 | 21 | ## API支持度 22 | 23 | 24 | | API | 微信小程序 | H5 | React Native | 25 | | :-: | :-: | :-: | :-: | 26 | | Taro.chooseVideo | ✔️ | | ✔️ | 27 | 28 | 29 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/window/onWindowResize.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onWindowResize(callback) 3 | sidebar_label: onWindowResize 4 | --- 5 | 6 | ## wx.onWindowResize(callback) 7 | 8 | 监听窗口尺寸变化事件。 9 | 10 | ## 参数 11 | 12 | ### callback(res) 13 | 14 | 窗口尺寸变化事件的回调函数。 15 | 16 | #### 参数 17 | 18 | ##### object res 19 | 20 | | Name | Type | Description | 21 | | --- | --- | --- | 22 | | windowWidth | number | 变化后的窗口宽度,单位 px | 23 | | windowHeight | number | 变化后的窗口高度,单位 px | 24 | 25 | ## API支持度 26 | 27 | | API | 微信小程序 | H5 | React Native | 28 | | :-: | :-: | :-: | :-: | 29 | | Taro.onWindowResize | ✔️ | ✔️ | | 30 | -------------------------------------------------------------------------------- /docs/apis/ui/interaction/enableAlertBeforeUnload.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.enableAlertBeforeUnload(option) 3 | sidebar_label: enableAlertBeforeUnload 4 | --- 5 | 6 | ## 类型 7 | 8 | ```tsx 9 | (option: Option) => void 10 | ``` 11 | 12 | ## 参数 13 | 14 | | 参数 | 类型 | 15 | | --- | --- | 16 | | option | `Option` | 17 | 18 | ### Option 19 | 20 | | 参数 | 类型 | 必填 | 说明 | 21 | | --- | --- | :---: | --- | 22 | | message | `string` | 是 | 询问对话框内容 | 23 | | complete | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | 24 | | fail | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用失败的回调函数 | 25 | | success | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用成功的回调函数 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/animation/createAnimation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createAnimation(OBJECT) 3 | sidebar_label: createAnimation 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.createAnimation`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.createAnimation.html)。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | const animation = Taro.createAnimation({ 15 | transformOrigin: "50% 50%", 16 | duration: 1000, 17 | timingFunction: "ease", 18 | delay: 0 19 | }) 20 | ``` 21 | 22 | 23 | 24 | ## API支持度 25 | 26 | 27 | | API | 微信小程序 | H5 | React Native | 28 | | :-: | :-: | :-: | :-: | 29 | | Taro.createAnimation | ✔️ | ✔️ | | 30 | 31 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/wxml/selectorQuery_exec.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: selectorQuery.exec([callback]) 3 | sidebar_label: selectorQuery.exec 4 | --- 5 | 6 | 7 | 执行所有的请求,请求结果按请求次序构成数组,在 callback 的第一个参数中返回。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | selectorQuery.in | ✔️ | ✔️ | | 17 | | selectorQuery.select | ✔️ | ✔️ | | 18 | | selectorQuery.selectAll | ✔️ | ✔️ | | 19 | | selectorQuery.selectViewport | ✔️ | ✔️ | | 20 | | nodesRef.boundingClientRect | ✔️ | ✔️ | | 21 | | nodesRef.scrollOffset | ✔️ | ✔️ | | 22 | | nodesRef.fields | ✔️ | ✔️ | | 23 | | selectorQuery.exec | ✔️ | ✔️ | | 24 | 25 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/components/media/live-player.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: LivePlayer 3 | sidebar_label: LivePlayer 4 | --- 5 | 6 | ##### 实时音视频播放 7 | 8 | > 组件 支持度 9 | 10 | | 微信小程序 | H5 | ReactNative | 11 | | :-: | :-: | :-: | 12 | | ✔️ | x | x | 13 | 14 | 小程序全部支持,属性参考[live-player](https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html)。属性值请改写为驼峰式命名。 15 | 16 | ```jsx 17 | import Taro, { Component } from '@tarojs/taro' 18 | // 引入 LivePlayer 组件 19 | import { LivePlayer } from '@tarojs/components' 20 | 21 | class App extends Components { 22 | render () { 23 | return ( 24 | 25 | ) 26 | } 27 | } 28 | ``` 29 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/components/media/live-pusher.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: LivePusher 3 | sidebar_label: LivePusher 4 | --- 5 | 6 | ##### 实时音视频录制 7 | 8 | > 组件 支持度 9 | 10 | | 微信小程序 | H5 | ReactNative | 11 | | :-: | :-: | :-: | 12 | | ✔️ | x | x | 13 | 14 | 小程序全部支持,属性参考[live-pusher](https://developers.weixin.qq.com/miniprogram/dev/component/live-pusher.html)。属性值请改写为驼峰式命名。 15 | 16 | ```jsx 17 | import Taro, { Component } from '@tarojs/taro' 18 | // 引入 LivePusher 组件 19 | import { LivePusher } from '@tarojs/components' 20 | 21 | class App extends Components { 22 | render () { 23 | return ( 24 | 25 | ) 26 | } 27 | } 28 | ``` 29 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/envs-debug.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 多端同步调试 3 | --- 4 | 5 | 从 1.3.5 版本开始,可以在 dist 目录下创建一个与编译的目标平台名同名的目录,并将结果放在这个目录下,例如编译到微信小程序,最终结果是在 dist/weapp 目录下,这样做的好处是,各个平台使用独立的目录互不影响,从而达到多端同步调试的目的,在 `config/index.js` 配置如下: 6 | ``` 7 | outputRoot: `dist/${process.env.TARO_ENV}` 8 | ``` 9 | 10 | 多端同步调试需要在终端工具中打开多个 Tab 来同时执行 taro 命令进行同步调试,如下图,编译成微信小程序和支付宝小程序: 11 | 12 | ![打开多个 Tab 来同时执行 taro 命令进行同步调试](https://img30.360buyimg.com/ling/jfs/t1/62633/10/8451/595888/5d663badE57d35fd2/5a34822774836ede.png) 13 | 14 | 编译出来的目录如下图,`dist` 目录下有 `weapp` 和 `alipay` 两个目录: 15 | 16 | ![同步调试编译结果](https://img20.360buyimg.com/ling/jfs/t1/74046/26/8491/148076/5d663baaEf2ed8064/33fbb1d365053d1c.png) 17 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/envs-debug.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 多端同步调试 3 | --- 4 | 5 | 从 1.3.5 版本开始,可以在 dist 目录下创建一个与编译的目标平台名同名的目录,并将结果放在这个目录下,例如编译到微信小程序,最终结果是在 dist/weapp 目录下,这样做的好处是,各个平台使用独立的目录互不影响,从而达到多端同步调试的目的,在 `config/index.js` 配置如下: 6 | ``` 7 | outputRoot: `dist/${process.env.TARO_ENV}` 8 | ``` 9 | 10 | 多端同步调试需要在终端工具中打开多个 Tab 来同时执行 taro 命令进行同步调试,如下图,编译成微信小程序和支付宝小程序: 11 | 12 | ![打开多个 Tab 来同时执行 taro 命令进行同步调试](https://img30.360buyimg.com/ling/jfs/t1/62633/10/8451/595888/5d663badE57d35fd2/5a34822774836ede.png) 13 | 14 | 编译出来的目录如下图,`dist` 目录下有 `weapp` 和 `alipay` 两个目录: 15 | 16 | ![同步调试编译结果](https://img20.360buyimg.com/ling/jfs/t1/74046/26/8491/148076/5d663baaEf2ed8064/33fbb1d365053d1c.png) 17 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/network/udp/createUDPSocket.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createUDPSocket() 3 | sidebar_label: createUDPSocket 4 | --- 5 | 6 | Creates an UDP Socket instance. Read [related instructions](https://developers.weixin.qq.com/miniprogram/en/dev/framework/ability/network.html) before use. 7 | 8 | 9 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/network/udp/wx.createUDPSocket.html) 10 | 11 | ## Type 12 | 13 | ```tsx 14 | () => UDPSocket 15 | ``` 16 | 17 | ## Parameters 18 | 19 | ## API Support 20 | 21 | | API | WeChat Mini-Program | H5 | React Native | 22 | | :---: | :---: | :---: | :---: | 23 | | Taro.createUDPSocket | ✔️ | | | 24 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/pulldownrefresh/stopPullDownRefresh.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopPullDownRefresh() 3 | sidebar_label: stopPullDownRefresh 4 | --- 5 | 6 | 7 | 停止当前页面下拉刷新。 8 | 9 | ## 参数 10 | 11 | ### object param 12 | 13 | 属性|类型|默认值|必填|说明 14 | :-:|:-:|:-:|:-:|:-: 15 | success|function||否|接口调用成功的回调函数 16 | fail|function||否|接口调用失败的回调函数 17 | complete|function||否|接口调用结束的回调函数(调用成功、失败都会执行) 18 | 19 | ## 示例代码 20 | 21 | ```jsx 22 | import Taro from '@tarojs/taro' 23 | 24 | Taro.stopPullDownRefresh() 25 | ``` 26 | 27 | 28 | 29 | ## API支持度 30 | 31 | 32 | | API | 微信小程序 | H5 | React Native | 33 | | :-: | :-: | :-: | :-: | 34 | | Taro.stopPullDownRefresh | ✔️ | ✔️ | ✔️ | 35 | 36 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/device/ibeacon/IBeaconInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: IBeaconInfo 3 | sidebar_label: IBeaconInfo 4 | --- 5 | 6 | ## 方法 7 | 8 | | 参数 | 类型 | 说明 | 9 | | --- | --- | --- | 10 | | uuid | `string` | Beacon 设备广播的 uuid | 11 | | major | `string` | Beacon 设备的主 ID | 12 | | minor | `string` | Beacon 设备的次 ID | 13 | | proximity | `keyof Proximity` | 表示设备距离的枚举值(仅iOS) | 14 | | accuracy | `number` | Beacon 设备的距离,单位 m。iOS 上,proximity 为 0 时,accuracy 为 -1。 | 15 | | rssi | `number` | 表示设备的信号强度,单位 dBm | 16 | 17 | ## 参数 18 | 19 | ### Proximity 20 | 21 | proximity 的合法值 22 | 23 | | 参数 | 说明 | 24 | | --- | --- | 25 | | 0 | 信号太弱不足以计算距离,或非 iOS 设备 | 26 | | 1 | 十分近 | 27 | | 2 | 比较近 | 28 | | 3 | 远 | 29 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/network/udp/createUDPSocket.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createUDPSocket() 3 | sidebar_label: createUDPSocket 4 | --- 5 | 6 | Creates an UDP Socket instance. Read [related instructions](https://developers.weixin.qq.com/miniprogram/en/dev/framework/ability/network.html) before use. 7 | 8 | 9 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/network/udp/wx.createUDPSocket.html) 10 | 11 | ## Type 12 | 13 | ```tsx 14 | () => UDPSocket 15 | ``` 16 | 17 | ## Parameters 18 | 19 | ## API Support 20 | 21 | | API | WeChat Mini-Program | H5 | React Native | 22 | | :---: | :---: | :---: | :---: | 23 | | Taro.createUDPSocket | ✔️ | | | 24 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/audio/pauseVoice.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.pauseVoice() 3 | sidebar_label: pauseVoice 4 | --- 5 | 6 | 7 | 暂停正在播放的语音。再次调用 Taro.playVoice 播放同一个文件时,会从暂停处开始播放。如果想从头开始播放,需要先调用 Taro.stopVoice。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.startRecord(params) 15 | .then(res => { 16 | const filePath = res.tempFilePath 17 | Taro.playVoice({ filePath }) 18 | 19 | setTimeout(Taro.pauseVoice, 5000) 20 | }) 21 | ``` 22 | 23 | 24 | 25 | ## API支持度 26 | 27 | 28 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 29 | | :-: | :-: | :-: | :-: | :-: | :-: | 30 | | Taro.pauseVoice | ✔️ | | | | | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/bioauth/checkIsSupportSoterAuthentication.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.checkIsSupportSoterAuthentication(OBJECT) 3 | sidebar_label: checkIsSupportSoterAuthentication 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.checkIsSupportSoterAuthentication`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.checkIsSupportSoterAuthentication.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.checkIsSupportSoterAuthentication(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 23 | | :-: | :-: | :-: | :-: | 24 | | Taro.checkIsSupportSoterAuthentication | ✔️ | | | 25 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/framework/getCurrentPages.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getCurrentPages() 3 | sidebar_label: getCurrentPages 4 | --- 5 | 6 | 获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面。 7 | __注意:__ 8 | - __不要尝试修改页面栈,会导致路由以及页面状态错误。__ 9 | - 不要在 `App.onLaunch` 的时候调用 `getCurrentPages()`,此时 `page` 还没有生成。 10 | 11 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/reference/api/getCurrentPages.html) 12 | 13 | ## 类型 14 | 15 | ```tsx 16 | () => Page[] 17 | ``` 18 | 19 | ## 参数 20 | 21 | ## 示例代码 22 | 23 | ```tsx 24 | Taro.getCurrentPages().length 25 | ``` 26 | 27 | ## API 支持度 28 | 29 | | API | 微信小程序 | H5 | React Native | 30 | | :---: | :---: | :---: | :---: | 31 | | Taro.getCurrentPages | ✔️ | ✔️ | | 32 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/storage/clearStorageSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.clearStorageSync() 3 | sidebar_label: clearStorageSync 4 | --- 5 | 6 | Taro.clearStorage 的同步版本 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorageSync.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => void 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## 示例代码 19 | 20 | ```tsx 21 | Taro.clearStorage() 22 | ``` 23 | 24 | ```tsx 25 | try { 26 | Taro.clearStorageSync() 27 | } catch(e) { 28 | // Do something when catch error 29 | } 30 | ``` 31 | 32 | ## API 支持度 33 | 34 | | API | 微信小程序 | H5 | React Native | 35 | | :---: | :---: | :---: | :---: | 36 | | Taro.clearStorageSync | ✔️ | ✔️ | | 37 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/compass/stopCompass.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopCompass(param) 3 | sidebar_label: stopCompass 4 | --- 5 | 6 | 停止监听罗盘数据。 7 | 8 | 使用方式同 [`wx.stopCompass`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.stopCompass.html)。 9 | 10 | ## 参数 11 | 12 | ### object param 13 | 14 | | Param | Type | Description | 15 | | --- | --- | --- | 16 | | [success] | function | 接口调用成功的回调函数 | 17 | | [fail] | function | 接口调用失败的回调函数 | 18 | | [complete] | function | 接口调用结束的回调函数(调用成功、失败都会执行) | 19 | 20 | 21 | ## API支持度 22 | 23 | 24 | | API | 微信小程序 | H5 | React Native | 25 | | :-: | :-: | :-: | :-: | 26 | | Taro.stopCompass | ✔️ | ✔️ | | 27 | 28 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/wxml/createIntersectionObserver.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createIntersectionObserver(Object component, Object options) 3 | sidebar_label: createIntersectionObserver 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.createIntersectionObserver`](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createIntersectionObserver.html)。 8 | 9 | 10 | 11 | **示例代码:** 12 | 13 | ```jsx 14 | import Taro from '@tarojs/taro' 15 | 16 | const observer = Taro.createIntersectionObserver(this, { thresholds: [0], observeAll: true }) 17 | ``` 18 | 19 | ## API支持度 20 | 21 | | API | 微信小程序 | H5 | ReactNative | 22 | | :-: | :-: | :-: | :-: | 23 | | Taro.createIntersectionObserver | ✔️ |  |  | 24 | 25 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/wxml/selectorQuery_selectViewport.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: selectorQuery.selectViewport() 3 | sidebar_label: selectorQuery.selectViewport 4 | --- 5 | 6 | 7 | 选择显示区域,可用于获取显示区域的尺寸、滚动位置等信息,返回一个 NodesRef 对象实例。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | selectorQuery.in | ✔️ | ✔️ | | 17 | | selectorQuery.select | ✔️ | ✔️ | | 18 | | selectorQuery.selectAll | ✔️ | ✔️ | | 19 | | selectorQuery.selectViewport | ✔️ | ✔️ | | 20 | | nodesRef.boundingClientRect | ✔️ | ✔️ | | 21 | | nodesRef.scrollOffset | ✔️ | ✔️ | | 22 | | nodesRef.fields | ✔️ | ✔️ | | 23 | | selectorQuery.exec | ✔️ | ✔️ | | 24 | 25 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/ui/interaction/enableAlertBeforeUnload.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.enableAlertBeforeUnload(option) 3 | sidebar_label: enableAlertBeforeUnload 4 | --- 5 | 6 | ## 类型 7 | 8 | ```tsx 9 | (option: Option) => void 10 | ``` 11 | 12 | ## 参数 13 | 14 | | 参数 | 类型 | 15 | | --- | --- | 16 | | option | `Option` | 17 | 18 | ### Option 19 | 20 | | 参数 | 类型 | 必填 | 说明 | 21 | | --- | --- | :---: | --- | 22 | | message | `string` | 是 | 询问对话框内容 | 23 | | complete | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | 24 | | fail | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用失败的回调函数 | 25 | | success | `(res: TaroGeneral.CallbackResult) => void` | 否 | 接口调用成功的回调函数 | 26 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/base/debug/getRealtimeLogManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getRealtimeLogManager() 3 | sidebar_label: getRealtimeLogManager 4 | --- 5 | 6 | 获取实时日志管理器对象。 7 | 8 | ## 类型 9 | 10 | ```tsx 11 | () => RealtimeLogManager 12 | ``` 13 | 14 | ## 参数 15 | 16 | ## 示例代码 17 | 18 | ```tsx 19 | const logger = Taro.getRealtimeLogManager() 20 | logger.info({str: 'hello world'}, 'info log', 100, [1, 2, 3]) 21 | logger.error({str: 'hello world'}, 'error log', 100, [1, 2, 3]) 22 | logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) 23 | ``` 24 | 25 | ## API 支持度 26 | 27 | | API | 微信小程序 | H5 | React Native | 28 | | :---: | :---: | :---: | :---: | 29 | | Taro.getRealtimeLogManager | ✔️ | | | 30 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/media/video-processing/createMediaContainer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMediaContainer() 3 | sidebar_label: createMediaContainer 4 | --- 5 | 6 | Create an audio/video processing container, which can eventually be used to combine the tracks in the container into a single video. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/wx.createMediaContainer.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => MediaContainer 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createMediaContainer | ✔️ | | | 23 | -------------------------------------------------------------------------------- /packages/taro-components/types/PullToRefresh.d.ts: -------------------------------------------------------------------------------- 1 | import { ComponentType } from 'react' 2 | 3 | interface Indicator { 4 | activate?: React.ReactNode 5 | deactivate?: React.ReactNode 6 | release?: React.ReactNode 7 | finish?: React.ReactNode 8 | } 9 | 10 | interface PullToRefreshProps { 11 | refreshing?: boolean 12 | distanceToRefresh: number 13 | onRefresh: () => void 14 | indicator: Indicator 15 | prefixCls?: string 16 | className?: string 17 | style?: React.CSSProperties 18 | damping: number 19 | } 20 | 21 | /** 下拉组件 22 | * @ignore 23 | */ 24 | declare const PullToRefresh: ComponentType 25 | 26 | export { PullToRefresh, PullToRefreshProps } 27 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/backgroundaudio/getBackgroundAudioPlayerState.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getBackgroundAudioPlayerState(OBJECT) 3 | sidebar_label: getBackgroundAudioPlayerState 4 | --- 5 | 6 | 7 | 使用方式同 [`wx.getBackgroundAudioPlayerState`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getBackgroundAudioPlayerState.html),支持 `Promise` 化使用。 8 | 9 | ## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.getBackgroundAudioPlayerState(params).then(...) 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.getBackgroundAudioPlayerState | ✔️ | | | | | 25 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/media/camera/createCameraContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createCameraContext() 3 | sidebar_label: createCameraContext 4 | --- 5 | 6 | Creates the CameraContext object for the camera. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/media/camera/wx.createCameraContext.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => CameraContext 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## Sample Code 19 | 20 | ```tsx 21 | const cameraContext = Taro.createCameraContext() 22 | ``` 23 | 24 | ## API Support 25 | 26 | | API | WeChat Mini-Program | H5 | React Native | 27 | | :---: | :---: | :---: | :---: | 28 | | Taro.createCameraContext | ✔️ | | ✔️ | 29 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/open-api/payment/faceVerifyForPay.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.faceVerifyForPay(option) 3 | sidebar_label: faceVerifyForPay 4 | --- 5 | 6 | Face verification on each payment security scenario 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/open-api/payment/wx.faceVerifyForPay.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | (option: any) => Promise 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## Sample Code 19 | 20 | ```tsx 21 | Taro.faceVerifyForPay(params).then(...) 22 | ``` 23 | 24 | ## API Support 25 | 26 | | API | WeChat Mini-Program | H5 | React Native | 27 | | :---: | :---: | :---: | :---: | 28 | | Taro.faceVerifyForPay | ✔️ | | | 29 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/media/camera/createCameraContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createCameraContext() 3 | sidebar_label: createCameraContext 4 | --- 5 | 6 | Creates the CameraContext object for the camera. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/media/camera/wx.createCameraContext.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => CameraContext 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## Sample Code 19 | 20 | ```tsx 21 | const cameraContext = Taro.createCameraContext() 22 | ``` 23 | 24 | ## API Support 25 | 26 | | API | WeChat Mini-Program | H5 | React Native | 27 | | :---: | :---: | :---: | :---: | 28 | | Taro.createCameraContext | ✔️ | | ✔️ | 29 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/media/video-processing/createMediaContainer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMediaContainer() 3 | sidebar_label: createMediaContainer 4 | --- 5 | 6 | Create an audio/video processing container, which can eventually be used to combine the tracks in the container into a single video. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/wx.createMediaContainer.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => MediaContainer 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createMediaContainer | ✔️ | | | 23 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/open-api/payment/faceVerifyForPay.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.faceVerifyForPay(option) 3 | sidebar_label: faceVerifyForPay 4 | --- 5 | 6 | Face verification on each payment security scenario 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/open-api/payment/wx.faceVerifyForPay.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | (option: any) => Promise 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## Sample Code 19 | 20 | ```tsx 21 | Taro.faceVerifyForPay(params).then(...) 22 | ``` 23 | 24 | ## API Support 25 | 26 | | API | WeChat Mini-Program | H5 | React Native | 27 | | :---: | :---: | :---: | :---: | 28 | | Taro.faceVerifyForPay | ✔️ | | | 29 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/components/maps/map.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Map 3 | sidebar_label: Map 4 | --- 5 | 6 | ##### 地图 7 | 8 | `` 组件的 H5 与 RN 版本尚未实现。 9 | 10 | >小程序端参数支持详见各小程序官网 11 | 12 | [微信小程序 Map](https://developers.weixin.qq.com/miniprogram/dev/component/map.html)。 13 | 14 | [百度小程序 Map](https://smartprogram.baidu.com/docs/develop/component/map/#map)。 15 | 16 | [支付宝小程序 Map](https://docs.alipay.com/mini/component/map)。 17 | 18 | ```jsx 19 | import Taro, { Component } from '@tarojs/taro' 20 | // 引入 map 组件 21 | import { Map } from '@tarojs/components' 22 | 23 | class App extends Component { 24 | onTap () {} 25 | render () { 26 | return ( 27 | 28 | ) 29 | } 30 | } 31 | ``` 32 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/media/live/createLivePusherContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createLivePusherContext() 3 | sidebar_label: createLivePusherContext 4 | --- 5 | 6 | 创建 [live-pusher](https://developers.weixin.qq.com/miniprogram/dev/component/live-pusher.html) 上下文 [LivePusherContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.html) 对象。 7 | 8 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/wx.createLivePusherContext.html) 9 | 10 | ## 类型 11 | 12 | ```tsx 13 | () => LivePusherContext 14 | ``` 15 | 16 | ## 参数 17 | 18 | ## API 支持度 19 | 20 | | API | 微信小程序 | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createLivePusherContext | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/components/open/open-data.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: OpenData 3 | sidebar_label: OpenData 4 | --- 5 | 6 | ##### 用于展示小程序开放的数据。 7 | 8 | > 组件 支持度 9 | 10 | | 微信小程序 | 百度小程序 | 11 | | :-: | :-: | 12 | | ✔ | ✔ | 13 | 14 | 15 | >具体用法请看小程序官方文档 16 | 17 | [微信小程序 OpenData](https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html)。 18 | 19 | [百度小程序 OpenData](https://smartprogram.baidu.com/docs/develop/component/open/#open-data/)。 20 | 21 | ```jsx 22 | import Taro, { Component } from '@tarojs/taro' 23 | // 引入 OpenData 组件 24 | import { OpenData } from '@tarojs/components' 25 | 26 | class App extends Component { 27 | render () { 28 | return ( 29 | 30 | ) 31 | } 32 | } 33 | ``` 34 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/media/live/createLivePusherContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createLivePusherContext() 3 | sidebar_label: createLivePusherContext 4 | --- 5 | 6 | Creates the [LivePusherContext](./LivePusherContext.md) object for the [live-pusher](https://developers.weixin.qq.com/miniprogram/en/dev/component/live-pusher.html). 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/media/live/wx.createLivePusherContext.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => LivePusherContext 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createLivePusherContext | ✔️ | | | 23 | -------------------------------------------------------------------------------- /docs/apis/canvas/Path2D.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Path2D 3 | sidebar_label: Path2D 4 | --- 5 | 6 | Canvas 2D API 的接口 Path2D 用来声明路径,此路径稍后会被CanvasRenderingContext2D 对象使用。CanvasRenderingContext2D 接口的 路径方法 也存在于 Path2D 这个接口中,允许你在 canvas 中根据需要创建可以保留并重用的路径。 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) 11 | -------------------------------------------------------------------------------- /docs/mdx/image-list.tsx: -------------------------------------------------------------------------------- 1 | import o2logo from '@site/static/img/o2logo@2x.png' 2 | import React from 'react' 3 | 4 | interface Item { 5 | image?: string 6 | label?: string 7 | } 8 | 9 | export default function ImageList ({ 10 | list = [], 11 | height = 88 12 | }) { 13 | return
14 | {list.map((item: Item, index) =>
18 | 19 | {item.label && } 20 |
)} 21 |
22 | } 23 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/canvas/RenderingContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RenderingContext 3 | sidebar_label: RenderingContext 4 | --- 5 | 6 | The canvas drawing context. 7 | 8 | **** 9 | 10 | You can use the `Canvas.getContext('webgl')` or `OffscreenCanvas.getContext('webgl')` API to get the WebGLRenderingContext object. All the properties, methods, and constants defined by [WebGL 1.0](https://www.khronos.org/registry/webgl/specs/latest/1.0/) are implemented. 11 | 12 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/canvas/RenderingContext.html) 13 | 14 | ## API Support 15 | 16 | | API | WeChat Mini-Program | H5 | React Native | 17 | | :---: | :---: | :---: | :---: | 18 | | RenderingContext | ✔️ | | | 19 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/media/live/createLivePusherContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createLivePusherContext() 3 | sidebar_label: createLivePusherContext 4 | --- 5 | 6 | Creates the [LivePusherContext](./LivePusherContext.md) object for the [live-pusher](https://developers.weixin.qq.com/miniprogram/en/dev/component/live-pusher.html). 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/media/live/wx.createLivePusherContext.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => LivePusherContext 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | 22 | | Taro.createLivePusherContext | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/interface/wxml/selectorQuery_selectAll.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: selectorQuery.selectAll(selector) 3 | sidebar_label: selectorQuery.selectAll 4 | --- 5 | 6 | 7 | 在当前页面下选择匹配选择器 selector 的节点,返回一个 NodesRef 对象实例。 与 selectorQuery.selectNode(selector) 不同的是,它选择所有匹配选择器的节点。 8 | 9 | 10 | 11 | ## API支持度 12 | 13 | 14 | | API | 微信小程序 | H5 | React Native | 15 | | :-: | :-: | :-: | :-: | 16 | | selectorQuery.in | ✔️ | ✔️ | | 17 | | selectorQuery.select | ✔️ | ✔️ | | 18 | | selectorQuery.selectAll | ✔️ | ✔️ | | 19 | | selectorQuery.selectViewport | ✔️ | ✔️ | | 20 | | nodesRef.boundingClientRect | ✔️ | ✔️ | | 21 | | nodesRef.scrollOffset | ✔️ | ✔️ | | 22 | | nodesRef.fields | ✔️ | ✔️ | | 23 | | selectorQuery.exec | ✔️ | ✔️ | | 24 | 25 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/canvas/RenderingContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RenderingContext 3 | sidebar_label: RenderingContext 4 | --- 5 | 6 | Canvas 绘图上下文。 7 | 8 | **** 9 | 10 | - 通过 Canvas.getContext('2d') 接口可以获取 CanvasRenderingContext2D 对象,实现了 [HTML Canvas 2D Context](https://www.w3.org/TR/2dcontext/) 定义的属性、方法。 11 | - 通过 Canvas.getContext('webgl') 或 OffscreenCanvas.getContext('webgl') 接口可以获取 WebGLRenderingContext 对象,实现了 [WebGL 1.0](https://www.khronos.org/registry/webgl/specs/latest/1.0/) 定义的所有属性、方法、常量。 12 | 13 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/RenderingContext.html) 14 | 15 | ## API 支持度 16 | 17 | | API | 微信小程序 | H5 | React Native | 18 | | :---: | :---: | :---: | :---: | 19 | | RenderingContext | ✔️ | | | 20 | -------------------------------------------------------------------------------- /docs/apis/canvas/createOffscreenCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createOffscreenCanvas() 3 | sidebar_label: createOffscreenCanvas 4 | --- 5 | 6 | 创建离屏 canvas 实例 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => OffscreenCanvas 16 | ``` 17 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/canvas/RenderingContext.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RenderingContext 3 | sidebar_label: RenderingContext 4 | --- 5 | 6 | The canvas drawing context. 7 | 8 | **** 9 | 10 | You can use the `Canvas.getContext('webgl')` or `OffscreenCanvas.getContext('webgl')` API to get the WebGLRenderingContext object. All the properties, methods, and constants defined by [WebGL 1.0](https://www.khronos.org/registry/webgl/specs/latest/1.0/) are implemented. 11 | 12 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/canvas/RenderingContext.html) 13 | 14 | ## API Support 15 | 16 | | API | WeChat Mini-Program | H5 | React Native | 17 | | :---: | :---: | :---: | :---: | 18 | | RenderingContext | ✔️ | | | 19 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/accelerometer/stopAccelerometer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopAccelerometer(res) 3 | sidebar_label: stopAccelerometer 4 | --- 5 | 6 | 停止监听加速度数据。 7 | 8 | ## 参数 9 | 10 | ### object res 11 | 12 | | Name | Type | Description | 13 | | --- | --- | --- | 14 | | success | function | 接口调用成功的回调函数 | 15 | | fail | function | 接口调用失败的回调函数 | 16 | | complete | function | 接口调用结束的回调函数(调用成功、失败都会执行) | 17 | 18 | ## 示例代码 19 | 20 | ```jsx 21 | import Taro from '@tarojs/taro' 22 | 23 | Taro.stopAccelerometer() 24 | ``` 25 | 26 | ## API 支持度 27 | 28 | | API | 微信小程序 | H5 | React Native | 29 | | :-: | :-: | :-: | :-: | 30 | | Taro.stopAccelerometer | ✔️ | ✔️ | ✔️ | 31 | 32 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/triager_pull_request_template.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | **这个 PR 做了什么?** (简要描述所做更改) 10 | 11 | 12 | 13 | 14 | **这个 PR 是什么类型?** (至少选择一个) 15 | 16 | - [ ] 错误修复(Bugfix) issue id # 17 | - [ ] 新功能(Feature) 18 | - [ ] 代码重构(Refactor) 19 | - [ ] TypeScript 类型定义修改(Typings) 20 | - [ ] 文档修改(Docs) 21 | - [ ] 代码风格更新(Code style update) 22 | - [x] 贡献者角色申请/提名 23 | - [ ] 其他,请描述(Other, please describe): 24 | -------------------------------------------------------------------------------- /docs/apis/base/crypto/getUserCryptoManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getUserCryptoManager() 3 | sidebar_label: getUserCryptoManager 4 | --- 5 | 6 | 获取用户加密模块 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/wx.getUserCryptoManager.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => UserCryptoManager 16 | ``` 17 | -------------------------------------------------------------------------------- /docs/apis/device/wifi/WifiInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WifiInfo 3 | sidebar_label: WifiInfo 4 | --- 5 | 6 | Wifi 信息 7 | 8 | 注意: 9 | 安卓 Taro.connectWifi / Taro.getConnectedWifi 若设置了 partialInfo:true ,或者调用了 Taro.onWifiConnectedWithPartialInfo 事件。将会返回只包含 SSID 属性的 WifiInfo 对象。 在某些情况下,可能 Wi-Fi 已经连接成功,但会因为获取不到完整的 WifiInfo 对象报错。具体错误信息为 errCode: 12010, errMsg: can't gain current wifi 。如果开发者不需要完整的 WifiInfo 对象,则可以通过采取上述策略解决报错问题。 10 | 11 | ## 方法 12 | 13 | | 参数 | 类型 | 必填 | 说明 | 14 | | --- | --- | :---: | --- | 15 | | SSID | `string` | 是 | Wi-Fi 的 SSID | 16 | | BSSID | `string` | 是 | Wi-Fi 的 BSSID | 17 | | secure | `boolean` | 是 | Wi-Fi 是否安全 | 18 | | signalStrength | `number` | 是 | Wi-Fi 信号强度, 安卓取值 0 ~ 100 ,iOS 取值 0 ~ 1 ,值越大强度越大 | 19 | | frequency | `number` | 否 | Wi-Fi 频段单位 MHz | 20 | -------------------------------------------------------------------------------- /docs/apis/media/video-decoder/createVideoDecoder.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createVideoDecoder() 3 | sidebar_label: createVideoDecoder 4 | --- 5 | 6 | 创建视频解码器,可逐帧获取解码后的数据 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/wx.createVideoDecoder.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => VideoDecoder 16 | ``` 17 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/mdx/image-list.tsx: -------------------------------------------------------------------------------- 1 | import o2logo from '@site/static/img/o2logo@2x.png' 2 | import React from 'react' 3 | 4 | interface Item { 5 | image?: string 6 | label?: string 7 | } 8 | 9 | export default function ImageList ({ 10 | list = [], 11 | height = 88 12 | }) { 13 | return
14 | {list.map((item: Item, index) =>
18 | 19 | {item.label && } 20 |
)} 21 |
22 | } 23 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/canvas/Path2D.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Path2D 3 | sidebar_label: Path2D 4 | --- 5 | 6 | Canvas 2D API 的接口 Path2D 用来声明路径,此路径稍后会被CanvasRenderingContext2D 对象使用。CanvasRenderingContext2D 接口的 路径方法 也存在于 Path2D 这个接口中,允许你在 canvas 中根据需要创建可以保留并重用的路径。 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) 11 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/nerv.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Nerv 3 | --- 4 | 5 | [Nerv](https://github.com/NervJS/nerv) 是凹凸实验室研发的高性能类 React 框架。在 Taro 中使用 Nerv 基本遵循和[在 Taro 中使用 React](./react) 一样的用法(只不过相比起 `import * as React from 'React'`,你需要 `import Nerv from 'nervjs'`)。相比起 React,Nerv 能提高[更高的性能](https://stefankrause.net/js-frameworks-benchmark8/table.html)和更小的体积,这在小程序开发中非常关键。 6 | 7 | ## 使用第三方 React 库 8 | 9 | 在使用第三方 React 库时,需要在[配置文件](config-detail.md#miniwebpackchain) `webpack.resolve.alias`,把 `react` 和 `react-dom` 映射到 `nervjs`: 10 | 11 | ```js 12 | { 13 | webpackChain (chain, webpack) { 14 | chain.merge({ 15 | resolve: { 16 | alias: { 17 | react: 'nervjs', 18 | 'react-dom': 'nervjs' 19 | } 20 | } 21 | }) 22 | } 23 | } 24 | ``` 25 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/base/crypto/getUserCryptoManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getUserCryptoManager() 3 | sidebar_label: getUserCryptoManager 4 | --- 5 | 6 | 获取用户加密模块 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/wx.getUserCryptoManager.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => UserCryptoManager 16 | ``` 17 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/canvas/createOffscreenCanvas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createOffscreenCanvas() 3 | sidebar_label: createOffscreenCanvas 4 | --- 5 | 6 | 创建离屏 canvas 实例 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => OffscreenCanvas 16 | ``` 17 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/storage/clearStorageSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.clearStorageSync() 3 | sidebar_label: clearStorageSync 4 | --- 5 | 6 | The synchronous version of `Taro.clearStorage`. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/storage/wx.clearStorageSync.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => void 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## Sample Code 19 | 20 | ```tsx 21 | Taro.clearStorage() 22 | ``` 23 | 24 | ```tsx 25 | try { 26 | Taro.clearStorageSync() 27 | } catch(e) { 28 | // Do something when catch error 29 | } 30 | ``` 31 | 32 | ## API Support 33 | 34 | | API | WeChat Mini-Program | H5 | React Native | 35 | | :---: | :---: | :---: | :---: | 36 | | Taro.clearStorageSync | ✔️ | ✔️ | | 37 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/components/forms/picker-view-column.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PickerViewColumn 3 | sidebar_label: PickerViewColumn 4 | --- 5 | 6 | Sub-item of the scroll picker. It can be placed only in `picker-view`. The height of its child nodes will be automatically set to that of a check box in `picker-view`. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/component/picker-view-column.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | ComponentType 14 | ``` 15 | 16 | ## API Support 17 | 18 | | API | WeChat Mini-Program | Baidu Smart-Program | Alipay Mini-Program | ByteDance Micro-App | H5 | React Native | 19 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | 20 | | PickerViewColumn | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | 21 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/multimedia/recording/stopRecord.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.stopRecord() 3 | sidebar_label: stopRecord 4 | --- 5 | 6 | 7 | ​主动调用停止录音。 8 | 9 | ​## 示例代码 10 | 11 | ```jsx 12 | import Taro from '@tarojs/taro' 13 | 14 | Taro.stopRecord() 15 | ``` 16 | 17 | 18 | 19 | ## API支持度 20 | 21 | 22 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 23 | | :-: | :-: | :-: | :-: | :-: | :-: | 24 | | Taro.stopRecord | ✔️ | | | | | 25 | 26 | # 录音管理 27 | 28 | 29 | 使用方式同 [`wx.getRecorderManager`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.getRecorderManager.html)。 30 | 31 | **示例代码:** 32 | 33 | ```jsx 34 | 35 | ``` 36 | 37 | > API 支持度 38 | 39 | | API | 微信小程序 | H5 | React Native | 支付宝小程序 | 百度小程序 | 40 | | :-: | :-: | :-: | :-: | :-: | :-: | 41 | 42 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/components/open/ad.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Ad 3 | sidebar_label: Ad 4 | --- 5 | 6 | ##### Banner 广告 7 | 8 | > 组件 支持度 9 | 10 | | 微信小程序 | 11 | | :-: | 12 | | ✔ | 13 | 14 | 15 | >具体用法请看小程序官方文档 16 | 17 | [微信小程序 Ad](https://developers.weixin.qq.com/miniprogram/dev/component/ad.html)。 18 | 19 | ```jsx 20 | import Taro, { Component } from '@tarojs/taro' 21 | // 引入 Ad 组件 22 | import { Ad } from '@tarojs/components' 23 | 24 | class App extends Component { 25 | render () { 26 | return ( 27 | console.log('ad onLoad')} 31 | onError={() => console.log('ad onError')} 32 | onClose={() => console.log('ad onClose')} 33 | /> 34 | ) 35 | } 36 | } 37 | ``` 38 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/device/wifi/WifiInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WifiInfo 3 | sidebar_label: WifiInfo 4 | --- 5 | 6 | Wifi 信息 7 | 8 | 注意: 9 | 安卓 Taro.connectWifi / Taro.getConnectedWifi 若设置了 partialInfo:true ,或者调用了 Taro.onWifiConnectedWithPartialInfo 事件。将会返回只包含 SSID 属性的 WifiInfo 对象。 在某些情况下,可能 Wi-Fi 已经连接成功,但会因为获取不到完整的 WifiInfo 对象报错。具体错误信息为 errCode: 12010, errMsg: can't gain current wifi 。如果开发者不需要完整的 WifiInfo 对象,则可以通过采取上述策略解决报错问题。 10 | 11 | ## 方法 12 | 13 | | 参数 | 类型 | 必填 | 说明 | 14 | | --- | --- | :---: | --- | 15 | | SSID | `string` | 是 | Wi-Fi 的 SSID | 16 | | BSSID | `string` | 是 | Wi-Fi 的 BSSID | 17 | | secure | `boolean` | 是 | Wi-Fi 是否安全 | 18 | | signalStrength | `number` | 是 | Wi-Fi 信号强度, 安卓取值 0 ~ 100 ,iOS 取值 0 ~ 1 ,值越大强度越大 | 19 | | frequency | `number` | 否 | Wi-Fi 频段单位 MHz | 20 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/mdx/image-list.tsx: -------------------------------------------------------------------------------- 1 | import o2logo from '@site/static/img/o2logo@2x.png' 2 | import React from 'react' 3 | 4 | interface Item { 5 | image?: string 6 | label?: string 7 | } 8 | 9 | export default function ImageList ({ 10 | list = [], 11 | height = 88 12 | }) { 13 | return
14 | {list.map((item: Item, index) =>
18 | 19 | {item.label && } 20 |
)} 21 |
22 | } 23 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/storage/clearStorageSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.clearStorageSync() 3 | sidebar_label: clearStorageSync 4 | --- 5 | 6 | The synchronous version of `Taro.clearStorage`. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/api/storage/wx.clearStorageSync.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => void 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## Sample Code 19 | 20 | ```tsx 21 | Taro.clearStorage() 22 | ``` 23 | 24 | ```tsx 25 | try { 26 | Taro.clearStorageSync() 27 | } catch(e) { 28 | // Do something when catch error 29 | } 30 | ``` 31 | 32 | ## API Support 33 | 34 | | API | WeChat Mini-Program | H5 | React Native | 35 | | :---: | :---: | :---: | :---: | 36 | | Taro.clearStorageSync | ✔️ | ✔️ | | 37 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/components/forms/picker-view-column.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: PickerViewColumn 3 | sidebar_label: PickerViewColumn 4 | --- 5 | 6 | Sub-item of the scroll picker. It can be placed only in `picker-view`. The height of its child nodes will be automatically set to that of a check box in `picker-view`. 7 | 8 | > [Reference](https://developers.weixin.qq.com/miniprogram/en/dev/component/picker-view-column.html) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | ComponentType 14 | ``` 15 | 16 | ## API Support 17 | 18 | | API | WeChat Mini-Program | Baidu Smart-Program | Alipay Mini-Program | ByteDance Micro-App | H5 | React Native | 19 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | 20 | | PickerViewColumn | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | 21 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/base/weapp/life-cycle/getLaunchOptionsSync.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getLaunchOptionsSync() 3 | sidebar_label: getLaunchOptionsSync 4 | --- 5 | 6 | 获取小程序启动时的参数。与 [`App.onLaunch`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onlaunchobject-object) 的回调参数一致。 7 | 8 | **注意** 9 | 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 10 | 11 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 12 | 13 | ## 类型 14 | 15 | ```tsx 16 | () => LaunchOptionsApp 17 | ``` 18 | 19 | ## 参数 20 | 21 | ## API 支持度 22 | 23 | | API | 微信小程序 | H5 | React Native | 24 | | :---: | :---: | :---: | :---: | 25 | | Taro.getLaunchOptionsSync | ✔️ | | | 26 | -------------------------------------------------------------------------------- /docs/apis/media/video-processing/createMediaContainer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMediaContainer() 3 | sidebar_label: createMediaContainer 4 | --- 5 | 6 | 创建音视频处理容器,最终可将容器中的轨道合成一个视频 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/wx.createMediaContainer.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => MediaContainer 16 | ``` 17 | -------------------------------------------------------------------------------- /docs/apis/open-api/card/card.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 卡券 3 | sidebar_label: 卡券 4 | --- 5 | 6 | ## Taro.addCard(OBJECT) 7 | 8 | 使用方式同 [`wx.addCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.addCard.html),支持 `Promise` 化使用。 9 | 10 | **示例代码:** 11 | 12 | ```jsx 13 | import Taro from '@tarojs/taro' 14 | 15 | Taro.addCard(params).then(...) 16 | ``` 17 | 18 | ## Taro.openCard(OBJECT) 19 | 20 | 使用方式同 [`wx.openCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openCard.html),支持 `Promise` 化使用。 21 | 22 | **示例代码:** 23 | 24 | ```jsx 25 | import Taro from '@tarojs/taro' 26 | 27 | Taro.openCard(params).then(...) 28 | ``` 29 | 30 | > API 支持度 31 | 32 | | API | 微信小程序 | H5 | React Native | 33 | | :-: | :-: | :-: | :-: | 34 | | Taro.addCard | ✔️ | | | 35 | | Taro.openCard | ✔️ | | | 36 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/base/debug/getRealtimeLogManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getRealtimeLogManager() 3 | sidebar_label: getRealtimeLogManager 4 | --- 5 | 6 | Obtains the real-time log manager object. 7 | 8 | ## Type 9 | 10 | ```tsx 11 | () => RealtimeLogManager 12 | ``` 13 | 14 | ## Parameters 15 | 16 | ## Sample Code 17 | 18 | ```tsx 19 | const logger = Taro.getRealtimeLogManager() 20 | logger.info({str: 'hello world'}, 'info log', 100, [1, 2, 3]) 21 | logger.error({str: 'hello world'}, 'error log', 100, [1, 2, 3]) 22 | logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) 23 | ``` 24 | 25 | ## API Support 26 | 27 | | API | WeChat Mini-Program | H5 | React Native | 28 | | :---: | :---: | :---: | :---: | 29 | | Taro.getRealtimeLogManager | ✔️ | | | 30 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/mdx/image-list.tsx: -------------------------------------------------------------------------------- 1 | import o2logo from '@site/static/img/o2logo@2x.png' 2 | import React from 'react' 3 | 4 | interface Item { 5 | image?: string 6 | label?: string 7 | } 8 | 9 | export default function ImageList ({ 10 | list = [], 11 | height = 88 12 | }) { 13 | return
14 | {list.map((item: Item, index) =>
18 | 19 | {item.label && } 20 |
)} 21 |
22 | } 23 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/netstat/onNetworkStatusChange.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.onNetworkStatusChange(CALLBACK) 3 | sidebar_label: onNetworkStatusChange 4 | --- 5 | 6 | 7 | 监听网络状态变化。 8 | 9 | **CALLBACK 返回参数:** 10 | 11 | | 参数 | 类型 | 说明 | 12 | | :-- | :-- | :-- | 13 | | isConnected | Boolean | 当前是否有网络连接 | 14 | | networkType | String | 网络类型 | 15 | 16 | 注意:**H5** 端兼容情况较差,只有当 navigator.connection 支持监听 onChange 事件时才会生效。 17 | 18 | ## 示例代码 19 | 20 | ```jsx 21 | import Taro from '@tarojs/taro' 22 | 23 | Taro.onNetworkStatusChange(res => { 24 | console.log(res.isConnected) 25 | console.log(res.networkType) 26 | }) 27 | ``` 28 | 29 | ## API支持度 30 | 31 | 32 | | API | 微信小程序 | H5 | ReactNative | 33 | | :-: | :-: | :-: | :-: | 34 | | Taro.onNetworkStatusChange | ✔️ | ✔️ | ✔️ | 35 | 36 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/media/video-decoder/createVideoDecoder.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createVideoDecoder() 3 | sidebar_label: createVideoDecoder 4 | --- 5 | 6 | 创建视频解码器,可逐帧获取解码后的数据 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/wx.createVideoDecoder.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => VideoDecoder 16 | ``` 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/collaborator_pull_request_template.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | **这个 PR 做了什么?** (简要描述所做更改) 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | **这个 PR 是什么类型?** (至少选择一个) 19 | 20 | - [ ] 错误修复(Bugfix) issue id # 21 | - [ ] 新功能(Feature) 22 | - [ ] 代码重构(Refactor) 23 | - [ ] TypeScript 类型定义修改(Typings) 24 | - [ ] 文档修改(Docs) 25 | - [ ] 代码风格更新(Code style update) 26 | - [x] 贡献者角色申请/提名 27 | - [ ] 其他,请描述(Other, please describe): 28 | -------------------------------------------------------------------------------- /docs/apis/media/media-recorder/createMediaRecorder.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMediaRecorder() 3 | sidebar_label: createMediaRecorder 4 | --- 5 | 6 | 创建 WebGL 画面录制器,可逐帧录制在 WebGL 上渲染的画面并导出视频文件 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/wx.createMediaRecorder.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => MediaRecorder 16 | ``` 17 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/base/debug/getRealtimeLogManager.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getRealtimeLogManager() 3 | sidebar_label: getRealtimeLogManager 4 | --- 5 | 6 | Obtains the real-time log manager object. 7 | 8 | ## Type 9 | 10 | ```tsx 11 | () => RealtimeLogManager 12 | ``` 13 | 14 | ## Parameters 15 | 16 | ## Sample Code 17 | 18 | ```tsx 19 | const logger = Taro.getRealtimeLogManager() 20 | logger.info({str: 'hello world'}, 'info log', 100, [1, 2, 3]) 21 | logger.error({str: 'hello world'}, 'error log', 100, [1, 2, 3]) 22 | logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) 23 | ``` 24 | 25 | ## API Support 26 | 27 | | API | WeChat Mini-Program | H5 | React Native | 28 | | :---: | :---: | :---: | :---: | 29 | | Taro.getRealtimeLogManager | ✔️ | | | 30 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/media/video-processing/createMediaContainer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMediaContainer() 3 | sidebar_label: createMediaContainer 4 | --- 5 | 6 | 创建音视频处理容器,最终可将容器中的轨道合成一个视频 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/wx.createMediaContainer.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => MediaContainer 16 | ``` 17 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/open-api/card/card.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 卡券 3 | sidebar_label: 卡券 4 | --- 5 | 6 | ## Taro.addCard(OBJECT) 7 | 8 | 使用方式同 [`wx.addCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.addCard.html),支持 `Promise` 化使用。 9 | 10 | **示例代码:** 11 | 12 | ```jsx 13 | import Taro from '@tarojs/taro' 14 | 15 | Taro.addCard(params).then(...) 16 | ``` 17 | 18 | ## Taro.openCard(OBJECT) 19 | 20 | 使用方式同 [`wx.openCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openCard.html),支持 `Promise` 化使用。 21 | 22 | **示例代码:** 23 | 24 | ```jsx 25 | import Taro from '@tarojs/taro' 26 | 27 | Taro.openCard(params).then(...) 28 | ``` 29 | 30 | > API 支持度 31 | 32 | | API | 微信小程序 | H5 | React Native | 33 | | :-: | :-: | :-: | :-: | 34 | | Taro.addCard | ✔️ | | | 35 | | Taro.openCard | ✔️ | | | 36 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/open-api/card/card.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 卡券 3 | sidebar_label: 卡券 4 | --- 5 | 6 | ## Taro.addCard(OBJECT) 7 | 8 | 使用方式同 [`wx.addCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.addCard.html),支持 `Promise` 化使用。 9 | 10 | **示例代码:** 11 | 12 | ```jsx 13 | import Taro from '@tarojs/taro' 14 | 15 | Taro.addCard(params).then(...) 16 | ``` 17 | 18 | ## Taro.openCard(OBJECT) 19 | 20 | 使用方式同 [`wx.openCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openCard.html),支持 `Promise` 化使用。 21 | 22 | **示例代码:** 23 | 24 | ```jsx 25 | import Taro from '@tarojs/taro' 26 | 27 | Taro.openCard(params).then(...) 28 | ``` 29 | 30 | > API 支持度 31 | 32 | | API | 微信小程序 | H5 | React Native | 33 | | :-: | :-: | :-: | :-: | 34 | | Taro.addCard | ✔️ | | | 35 | | Taro.openCard | ✔️ | | | 36 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/open-api/card/card.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 卡券 3 | sidebar_label: 卡券 4 | --- 5 | 6 | ## Taro.addCard(OBJECT) 7 | 8 | 使用方式同 [`wx.addCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.addCard.html),支持 `Promise` 化使用。 9 | 10 | **示例代码:** 11 | 12 | ```jsx 13 | import Taro from '@tarojs/taro' 14 | 15 | Taro.addCard(params).then(...) 16 | ``` 17 | 18 | ## Taro.openCard(OBJECT) 19 | 20 | 使用方式同 [`wx.openCard`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.openCard.html),支持 `Promise` 化使用。 21 | 22 | **示例代码:** 23 | 24 | ```jsx 25 | import Taro from '@tarojs/taro' 26 | 27 | Taro.openCard(params).then(...) 28 | ``` 29 | 30 | > API 支持度 31 | 32 | | API | 微信小程序 | H5 | React Native | 33 | | :-: | :-: | :-: | :-: | 34 | | Taro.addCard | ✔️ | | | 35 | | Taro.openCard | ✔️ | | | 36 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/committee_pull_request_template.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | **这个 PR 做了什么?** (简要描述所做更改) 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | **这个 PR 是什么类型?** (至少选择一个) 18 | 19 | - [ ] 错误修复(Bugfix) issue id # 20 | - [ ] 新功能(Feature) 21 | - [ ] 代码重构(Refactor) 22 | - [ ] TypeScript 类型定义修改(Typings) 23 | - [ ] 文档修改(Docs) 24 | - [ ] 代码风格更新(Code style update) 25 | - [x] 贡献者角色申请/提名 26 | - [ ] 其他,请描述(Other, please describe): 27 | -------------------------------------------------------------------------------- /versioned_docs/version-3.x/apis/media/media-recorder/createMediaRecorder.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createMediaRecorder() 3 | sidebar_label: createMediaRecorder 4 | --- 5 | 6 | 创建 WebGL 画面录制器,可逐帧录制在 WebGL 上渲染的画面并导出视频文件 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/wx.createMediaRecorder.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => MediaRecorder 16 | ``` 17 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/device/compass/startCompass.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.startCompass(param) 3 | sidebar_label: startCompass 4 | --- 5 | 6 | 开始监听罗盘数据。 7 | 8 | 使用方式同 [`wx.startCompass`](https://developers.weixin.qq.com/miniprogram/dev/api/wx.startCompass.html)。 9 | 10 | ## 参数 11 | 12 | ### object param 13 | 14 | | Param | Type | Description | 15 | | --- | --- | --- | 16 | | [success] | function | 接口调用成功的回调函数 | 17 | | [fail] | function | 接口调用失败的回调函数 | 18 | | [complete] | function | 接口调用结束的回调函数(调用成功、失败都会执行) | 19 | 20 | ## 示例代码 21 | 22 | ```jsx 23 | import Taro from '@tarojs/taro' 24 | 25 | Taro.startCompass() 26 | ``` 27 | 28 | 29 | 30 | ## API支持度 31 | 32 | 33 | | API | 微信小程序 | H5 | React Native | 34 | | :-: | :-: | :-: | :-: | 35 | | Taro.startCompass | ✔️ | ✔️ | | 36 | 37 | -------------------------------------------------------------------------------- /docs/apis/network/udp/createUDPSocket.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.createUDPSocket() 3 | sidebar_label: createUDPSocket 4 | --- 5 | 6 | 创建一个 UDP Socket 实例。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/wx.createUDPSocket.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => UDPSocket 16 | ``` 17 | -------------------------------------------------------------------------------- /packages/taro-components/types/RadioGroup.d.ts: -------------------------------------------------------------------------------- 1 | import { ComponentType } from 'react' 2 | import { StandardProps, CommonEventFunction, FormItemProps } from './common' 3 | 4 | interface RadioGroupProps extends StandardProps, FormItemProps { 5 | /** RadioGroup 中选中项发生改变时触发 change 事件,detail = {value:[选中的radio的value的数组]} 6 | * @supported weapp, h5, tt 7 | */ 8 | onChange?: CommonEventFunction 9 | } 10 | 11 | declare namespace RadioGroupProps { 12 | interface onChangeEventDetail { 13 | value: string[] 14 | } 15 | } 16 | 17 | /** 单项选择器,内部由多个 Radio 组成。 18 | * @classification forms 19 | * @supported weapp, h5, rn, tt 20 | * @see https://developers.weixin.qq.com/miniprogram/dev/component/radio-group.html 21 | */ 22 | declare const RadioGroup: ComponentType 23 | 24 | export { RadioGroup, RadioGroupProps } 25 | -------------------------------------------------------------------------------- /versioned_docs/version-1.x/apis/storage/removeStorage.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.removeStorage(OBJECT) 3 | sidebar_label: removeStorage 4 | --- 5 | 6 | 7 | 从本地缓存中异步移除指定 key,支持 `Promise` 化使用。 8 | 9 | **OBJECT 参数说明:** 10 | 11 | | 参数 | 类型 | 必填 | 说明 | 12 | | :-- | :-- | :-- | :-- | 13 | | key | String | 是 | 本地缓存中的指定的 key | 14 | | success | Function | 否 | 接口调用成功的回调函数 | 15 | | fail | Function | 否 | 接口调用失败的回调函数 | 16 | | complete | Function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | 17 | 18 | ## 示例代码 19 | 20 | ```jsx 21 | import Taro from '@tarojs/taro' 22 | 23 | Taro.removeStorage({ key: 'key' }) 24 | .then(res => console.log(res)) 25 | ``` 26 | 27 | 28 | 29 | ## API支持度 30 | 31 | 32 | | API | 微信小程序 | H5 | React Native | 33 | | :-: | :-: | :-: | :-: | 34 | | Taro.removeStorage | ✔️ | ✔️ | ✔️ | 35 | | Taro.removeStorageSync | ✔️ | ✔️ | | 36 | 37 | -------------------------------------------------------------------------------- /docs/apis/device/nfc/getNFCAdapter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getNFCAdapter() 3 | sidebar_label: getNFCAdapter 4 | --- 5 | 6 | 获取 NFC 实例 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/wx.getNFCAdapter.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | () => NFCAdapter 16 | ``` 17 | -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/current/apis/alipay/getOpenUserInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getOpenUserInfo() 3 | sidebar_label: getOpenUserInfo 4 | --- 5 | 6 | This interface allows you to obtain basic information about your Alipay members (avatar image address, nickname, gender, country code, province and city), see [details](https://docs.alipay.com/mini/api/ch8chh).To obtain the Alipay member ID (user_id), please call `my.getAuthCode` and `alipay.system.oauth.token` interfaces. 7 | 8 | > [Reference](https://docs.alipay.com/mini/api/ch8chh) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => Promise 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | Alipay Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | :---: | 22 | | Taro.getOpenUserInfo | | ✔️ | | | 23 | -------------------------------------------------------------------------------- /src/sw.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | import {registerRoute} from 'workbox-routing'; 9 | import {StaleWhileRevalidate} from 'workbox-strategies'; 10 | 11 | export default function swCustom(params) { 12 | if (params.debug) { 13 | console.log('[Docusaurus-PWA][SW]: running swCustom code', params); 14 | } 15 | 16 | // Cache responses from external resources 17 | registerRoute( 18 | (context) => 19 | [ 20 | /graph\.facebook\.com\/.*\/picture/, 21 | /netlify\.com\/img/, 22 | /avatars1\.githubusercontent/, 23 | ].some((regex) => context.url.href.match(regex)), 24 | new StaleWhileRevalidate(), 25 | ); 26 | } -------------------------------------------------------------------------------- /i18n/en/docusaurus-plugin-content-docs/version-3.x/apis/alipay/getOpenUserInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.getOpenUserInfo() 3 | sidebar_label: getOpenUserInfo 4 | --- 5 | 6 | This interface allows you to obtain basic information about your Alipay members (avatar image address, nickname, gender, country code, province and city), see [details](https://docs.alipay.com/mini/api/ch8chh).To obtain the Alipay member ID (user_id), please call `my.getAuthCode` and `alipay.system.oauth.token` interfaces. 7 | 8 | > [Reference](https://docs.alipay.com/mini/api/ch8chh) 9 | 10 | ## Type 11 | 12 | ```tsx 13 | () => Promise 14 | ``` 15 | 16 | ## Parameters 17 | 18 | ## API Support 19 | 20 | | API | WeChat Mini-Program | Alipay Mini-Program | H5 | React Native | 21 | | :---: | :---: | :---: | :---: | :---: | 22 | | Taro.getOpenUserInfo | | ✔️ | | | 23 | -------------------------------------------------------------------------------- /versioned_docs/version-2.x/apis/device/wifi/WifiInfo.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: WifiInfo 3 | sidebar_label: WifiInfo 4 | --- 5 | 6 | Wifi 信息 7 | 8 | ## 方法 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 |
参数类型说明
BSSIDstringWi-Fi 的 BSSID
SSIDstringWi-Fi 的 SSID
securebooleanWi-Fi 是否安全
signalStrengthnumberWi-Fi 信号强度
41 | -------------------------------------------------------------------------------- /docs/apis/payment/faceVerifyForPay.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Taro.faceVerifyForPay(option) 3 | sidebar_label: faceVerifyForPay 4 | --- 5 | 6 | 支付各个安全场景验证人脸 7 | 8 | 支持情况: 9 | 10 | > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/payment/wx.faceVerifyForPay.html) 11 | 12 | ## 类型 13 | 14 | ```tsx 15 | (option: any) => Promise 16 | ``` 17 | 18 | ## 示例代码 19 | 20 | ```tsx 21 | Taro.faceVerifyForPay(params).then(...) 22 | ``` 23 | --------------------------------------------------------------------------------