tmui-cli 5.3.1 → 5.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +120 -2
- package/data/components.json +1 -1
- package/data/config.json +1 -1
- package/data/doc-index.json +1 -1
- package/data/docs/upload-photo.md +1 -0
- package/data/docs/upload-video.md +1 -0
- package/data/examples/navbar.vue +3 -3
- package/data/examples/upload-photo.vue +14 -0
- package/data/examples/upload-video.vue +14 -0
- package/data/guides//346/233/264/346/226/260/346/227/245/345/277/227.md +2 -0
- package/data/tmui4x/01./346/225/231/347/250/213/10./345/205/245/351/227/250/346/214/207/345/215/227/12./345/256/211/350/243/205.md +1 -1
- package/data/tmui4x/01./346/225/231/347/250/213/35.Interface/347/261/273/345/236/213.md +5 -0
- package/data/tmui4x/01./346/225/231/347/250/213/50.TMUI4x/350/222/270/346/261/275/350/256/241/345/210/222.md +18 -2
- package/data/tmui4x/10./346/217/222/344/273/266/345/272/223/xChatmarkdownU AI/350/201/212/345/244/251Markdown.md" +13 -1
- package/data/tmui4x/10./346/217/222/344/273/266/345/272/223/xWebviewU /346/267/267/345/220/210WebView.md" +2 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//345/216/237/347/224/237/345/233/276/350/241/250 Chart.md" +6 -0
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//345/233/276/347/211/207/350/243/201/345/211/252 xImageResizer.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//346/200/235/347/273/264/345/257/274/345/233/276 xTreeFlat.md" +1 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/205/266/345/256/203/347/273/204/344/273/266//351/242/234/350/211/262/351/200/211/346/213/251 xColorView.md" +2 -2
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/274/225/345/257/274 xGuid.md" +31 -10
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//345/274/225/345/257/274/345/255/220/347/273/204/344/273/266 xGuidItem.md" +26 -5
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/257/274/350/210/252/347/273/204/344/273/266//347/264/242/345/274/225 xIndexbar.md" +46 -4
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266/markdown xCmarkdown.md" +9 -2
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/257/214/346/226/207/346/234/254 xHtml.md" +186 -0
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/257/214/346/226/207/346/234/254/345/255/220/347/273/204/344/273/266 xHtmlNode.md" +183 -0
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/241/250/346/240/274 xTable.md" +10 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//350/241/250/346/240/274/345/210/227 xTableCol.md" +8 -0
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/270/270/347/224/250/347/273/204/344/273/266//345/223/215/345/272/224/345/274/217/345/270/203/345/261/200 xLayout.md" +330 -0
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/233/276/347/211/207/344/270/212/344/274/240 xUploadMedia.md" +51 -4
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/244/232/351/200/211/346/227/245/345/216/206 xCalendarMultiple.md" +2 -7
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/257/214/346/226/207/346/234/254/347/274/226/350/276/221/345/231/250 xEditor.md" +4 -4
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//345/265/214/345/205/245/345/274/217/346/227/245/346/234/237/351/200/211/346/213/251/345/231/250 xDateView.md" +27 -0
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/227/245/345/216/206 xCalendar.md" +6 -8
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//346/227/245/346/234/237/351/200/211/346/213/251/345/231/250 xPickerDate.md" +27 -1
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/241/250/345/215/225 xForm.md" +36 -28
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//350/241/250/345/215/225/347/273/204/344/273/266//350/241/250/345/215/225/345/255/220/347/273/204/344/273/266 xFormItem.md" +35 -28
- package/data/tmui4x/60.AI/350/207/252/345/212/250/345/214/226/06.tokens/350/207/252/347/224/261.md +47 -0
- package/data/tmui4x-doc-index.json +47 -10
- package/data/uni-app-x-docs/.vuepress/utils/cssJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/customTypeJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/maniFestJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/utsApiJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/utsComJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/utsUnicloudApiJson.json +1 -1
- package/data/uni-app-x-docs/.vuepress/utils/vueJson.json +1 -1
- package/data/uni-app-x-docs/_sidebar.md +2 -1
- package/data/uni-app-x-docs/api/_sidebar.md +3 -0
- package/data/uni-app-x-docs/api/convert2-abs-full-path.md +33 -0
- package/data/uni-app-x-docs/api/create-drama-ad.md +24 -15
- package/data/uni-app-x-docs/api/create-selector-query.md +2 -2
- package/data/uni-app-x-docs/api/create-worker.md +10 -11
- package/data/uni-app-x-docs/api/dialog-page.md +4 -0
- package/data/uni-app-x-docs/api/dom/README.md +1 -1
- package/data/uni-app-x-docs/api/dom/cssstyledeclaration.md +10 -55
- package/data/uni-app-x-docs/api/dom/unielement.md +2 -1
- package/data/uni-app-x-docs/api/dom/uniresizeobserver.md +4 -47
- package/data/uni-app-x-docs/api/event-bus.md +1 -1
- package/data/uni-app-x-docs/api/get-recorder-manager.md +5 -5
- package/data/uni-app-x-docs/api/install-wgt.md +10 -11
- package/data/uni-app-x-docs/api/screen-brightness.md +6 -0
- package/data/uni-app-x-docs/api/theme-change.md +1 -1
- package/data/uni-app-x-docs/api/unicloud/README.md +41 -0
- package/data/uni-app-x-docs/api/unicloud/function.md +1 -1
- package/data/uni-app-x-docs/api/unicloud/object.md +1 -1
- package/data/uni-app-x-docs/api/uniresizeobserver.md +50 -0
- package/data/uni-app-x-docs/app-vapor.md +9 -2
- package/data/uni-app-x-docs/collocation/app.md +2 -2
- package/data/uni-app-x-docs/collocation/manifest-android.md +15 -1
- package/data/uni-app-x-docs/compiler/README.md +1 -1
- package/data/uni-app-x-docs/component/_sidebar.md +4 -1
- package/data/uni-app-x-docs/component/ad-drama.md +8 -13
- package/data/uni-app-x-docs/component/button.md +1 -1
- package/data/uni-app-x-docs/component/icon.md +2 -0
- package/data/uni-app-x-docs/component/image.md +4 -2
- package/data/uni-app-x-docs/component/swiper.md +5 -1
- package/data/uni-app-x-docs/component/text.md +6 -6
- package/data/uni-app-x-docs/component/uni-ui-x/uni-collapse.md +1 -1
- package/data/uni-app-x-docs/component/uni-ui-x/uni-combox.md +4 -0
- package/data/uni-app-x-docs/component/uni-ui-x/uni-icons.md +25 -0
- package/data/uni-app-x-docs/component/uni-ui-x/uni-link.md +1 -1
- package/data/uni-app-x-docs/component/uni-ui-x/uni-nav-bar.md +1 -1
- package/data/uni-app-x-docs/component/uni-ui-x/uni-number-box.md +1 -1
- package/data/uni-app-x-docs/component/uni-ui-x/uni-rate.md +1 -1
- package/data/uni-app-x-docs/component/video.md +2 -2
- package/data/uni-app-x-docs/component/view.md +2 -1
- package/data/uni-app-x-docs/css/common/at-rules.md +8 -2
- package/data/uni-app-x-docs/css/common/selector.md +3 -3
- package/data/uni-app-x-docs/css/common/style-isolation.md +3 -3
- package/data/uni-app-x-docs/css/visibility.md +8 -3
- package/data/uni-app-x-docs/i18n.md +30 -30
- package/data/uni-app-x-docs/mp/README.md +21 -0
- package/data/uni-app-x-docs/mp/native-component-and-wxs.md +1 -1
- package/data/uni-app-x-docs/native/download/android.md +18 -63
- package/data/uni-app-x-docs/native/download/ios.md +5 -5
- package/data/uni-app-x-docs/native/use/android.md +4 -2
- package/data/uni-app-x-docs/native/use/androidcomm.md +154 -40
- package/data/uni-app-x-docs/readme.md +51 -28
- package/data/uni-app-x-docs/sample.md +57 -14
- package/data/uni-app-x-docs/select/crossplatform-on-ai.md +475 -0
- package/data/uni-app-x-docs/select/native-render-and-self-render.md +4 -4
- package/data/uni-app-x-docs/tutorial/compliance.md +6 -6
- package/data/uni-app-x-docs/tutorial/debug/devtools.md +16 -6
- package/data/uni-app-x-docs/tutorial/store.md +1 -1
- package/data/uni-app-x-docs/uniapptox.md +49 -18
- package/data/uni-app-x-docs/uniappvsuniappx.md +160 -38
- package/data/uni-app-x-docs/uts/buildin-object-api/array.md +0 -296
- package/data/uni-app-x-docs/uts/uts2js.md +1 -1
- package/data/uni-app-x-docs/vue/README.md +20 -12
- package/data/uni-app-x-docs/vue/built-in.md +64 -37
- package/data/uni-app-x-docs/vue/component.md +3 -1
- package/data/uni-app-x-docs/vue/composition-api.md +1 -1
- package/data/uni-app-x-docs/web/ssr.md +22 -86
- package/data/uniappx/_sidebar.md +2 -1
- package/data/uniappx/api/_sidebar.md +3 -0
- package/data/uniappx/api/accelerometer.md +96 -96
- package/data/uniappx/api/action-sheet.md +4 -4
- package/data/uniappx/api/app-route.md +20 -0
- package/data/uniappx/api/authentication.md +6 -6
- package/data/uniappx/api/base64.md +4 -4
- package/data/uniappx/api/choose-file.md +2 -2
- package/data/uniappx/api/choose-image.md +2 -2
- package/data/uniappx/api/choose-location.md +2 -2
- package/data/uniappx/api/choose-media.md +2 -2
- package/data/uniappx/api/choose-video.md +2 -2
- package/data/uniappx/api/clipboard.md +4 -4
- package/data/uniappx/api/compass.md +94 -94
- package/data/uniappx/api/connect-event-source.md +2 -2
- package/data/uniappx/api/contact.md +62 -62
- package/data/uniappx/api/convert2-abs-full-path.md +57 -0
- package/data/uniappx/api/create-camera-context.md +2 -2
- package/data/uniappx/api/create-canvas-context-async.md +2 -2
- package/data/uniappx/api/create-drama-ad.md +533 -343
- package/data/uniappx/api/create-editor-context-async.md +2 -2
- package/data/uniappx/api/create-inner-audio-context.md +4 -4
- package/data/uniappx/api/create-request-permission-listener.md +2 -2
- package/data/uniappx/api/create-selector-query.md +2 -2
- package/data/uniappx/api/create-video-context.md +2 -2
- package/data/uniappx/api/create-webview-context.md +4 -4
- package/data/uniappx/api/create-worker.md +11 -11
- package/data/uniappx/api/dialog-page.md +8 -4
- package/data/uniappx/api/dom/cssstyledeclaration.md +1 -46
- package/data/uniappx/api/dom/unielement.md +2 -1
- package/data/uniappx/api/dom/uniresizeobserver.md +2 -19
- package/data/uniappx/api/download-file.md +2 -2
- package/data/uniappx/api/event-bus.md +9 -9
- package/data/uniappx/api/exit.md +2 -2
- package/data/uniappx/api/get-accessibility-info.md +2 -2
- package/data/uniappx/api/get-app-authorize-setting.md +2 -2
- package/data/uniappx/api/get-app-base-info.md +3 -2
- package/data/uniappx/api/get-background-audio-manager.md +2 -2
- package/data/uniappx/api/get-device-info.md +2 -2
- package/data/uniappx/api/get-element-by-id.md +2 -2
- package/data/uniappx/api/get-file-system-manager.md +4 -4
- package/data/uniappx/api/get-location.md +2 -2
- package/data/uniappx/api/get-network-type.md +2 -2
- package/data/uniappx/api/get-recorder-manager.md +28 -28
- package/data/uniappx/api/get-system-info.md +4 -4
- package/data/uniappx/api/get-system-setting.md +2 -2
- package/data/uniappx/api/get-window-info.md +2 -2
- package/data/uniappx/api/gyroscope.md +68 -68
- package/data/uniappx/api/install-apk.md +2 -2
- package/data/uniappx/api/install-wgt.md +26 -53
- package/data/uniappx/api/is-simulator.md +2 -2
- package/data/uniappx/api/keyboard.md +6 -6
- package/data/uniappx/api/launch.md +4 -4
- package/data/uniappx/api/load-font-face.md +2 -2
- package/data/uniappx/api/loading.md +4 -4
- package/data/uniappx/api/make-phone-call.md +2 -2
- package/data/uniappx/api/memory.md +6 -6
- package/data/uniappx/api/modal.md +4 -4
- package/data/uniappx/api/navigator-bar-loading.md +4 -4
- package/data/uniappx/api/network-status-change.md +4 -4
- package/data/uniappx/api/on-tab-bar-mid-button-tap.md +2 -2
- package/data/uniappx/api/open-app-authorize-setting.md +2 -2
- package/data/uniappx/api/open-document.md +2 -2
- package/data/uniappx/api/page-scroll-to.md +2 -2
- package/data/uniappx/api/privacy.md +8 -8
- package/data/uniappx/api/provider.md +4 -4
- package/data/uniappx/api/pull-down-refresh.md +4 -4
- package/data/uniappx/api/report.md +1 -1
- package/data/uniappx/api/request-merchant-transfer.md +2 -2
- package/data/uniappx/api/request-payment.md +2 -2
- package/data/uniappx/api/request-system-permission.md +4 -0
- package/data/uniappx/api/request.md +2 -2
- package/data/uniappx/api/rpx2px.md +2 -2
- package/data/uniappx/api/save-image-to-photos-album.md +2 -2
- package/data/uniappx/api/scan-code.md +2 -2
- package/data/uniappx/api/screen-brightness.md +49 -43
- package/data/uniappx/api/set-navigation-bar-color.md +2 -2
- package/data/uniappx/api/set-navigation-bar-title.md +2 -2
- package/data/uniappx/api/set-tab-bar.md +16 -16
- package/data/uniappx/api/share-with-system.md +2 -2
- package/data/uniappx/api/share.md +2 -2
- package/data/uniappx/api/storage.md +20 -20
- package/data/uniappx/api/theme-change.md +18 -18
- package/data/uniappx/api/toast.md +20 -13
- package/data/uniappx/api/uasm.md +8 -0
- package/data/uniappx/api/unicloud/README.md +151 -3
- package/data/uniappx/api/unicloud/database.md +6 -6
- package/data/uniappx/api/unicloud/function.md +5 -5
- package/data/uniappx/api/unicloud/object.md +5 -5
- package/data/uniappx/api/unicloud/storage.md +9 -9
- package/data/uniappx/api/unicloud/utils.md +18 -18
- package/data/uniappx/api/uniresizeobserver.md +108 -0
- package/data/uniappx/api/upload-file.md +2 -2
- package/data/uniappx/api/vibrate.md +30 -30
- package/data/uniappx/api/virtual-payment.md +2 -2
- package/data/uniappx/api/websocket.md +14 -14
- package/data/uniappx/app-vapor.md +9 -2
- package/data/uniappx/collocation/manifest-android.md +15 -1
- package/data/uniappx/collocation/manifest.md +1 -0
- package/data/uniappx/component/_sidebar.md +4 -1
- package/data/uniappx/component/ad-drama.md +18 -50
- package/data/uniappx/component/animation-view.md +2 -2
- package/data/uniappx/component/button.md +5 -1
- package/data/uniappx/component/camera.md +2 -2
- package/data/uniappx/component/canvas.md +3 -3
- package/data/uniappx/component/checkbox-group.md +4 -0
- package/data/uniappx/component/checkbox.md +5 -1
- package/data/uniappx/component/common.md +2 -2
- package/data/uniappx/component/editor.md +4 -0
- package/data/uniappx/component/form.md +2 -2
- package/data/uniappx/component/icon.md +2 -0
- package/data/uniappx/component/image.md +7 -2
- package/data/uniappx/component/input.md +2 -2
- package/data/uniappx/component/label.md +4 -0
- package/data/uniappx/component/list-view.md +6 -4
- package/data/uniappx/component/loading.md +4 -4
- package/data/uniappx/component/match-media.md +2 -2
- package/data/uniappx/component/movable-view.md +2 -2
- package/data/uniappx/component/navigation-bar.md +17 -17
- package/data/uniappx/component/navigator.md +12 -12
- package/data/uniappx/component/page-container.md +4 -0
- package/data/uniappx/component/picker-view.md +8 -0
- package/data/uniappx/component/picker.md +16 -16
- package/data/uniappx/component/progress.md +2 -2
- package/data/uniappx/component/radio-group.md +4 -0
- package/data/uniappx/component/radio.md +4 -0
- package/data/uniappx/component/rich-text.md +2 -2
- package/data/uniappx/component/scroll-view.md +5 -5
- package/data/uniappx/component/slider.md +23 -17
- package/data/uniappx/component/sticky-header.md +4 -0
- package/data/uniappx/component/sticky-section.md +4 -0
- package/data/uniappx/component/swiper.md +6 -2
- package/data/uniappx/component/switch.md +4 -0
- package/data/uniappx/component/text.md +8 -8
- package/data/uniappx/component/textarea.md +2 -2
- package/data/uniappx/component/uni-ui-x/README.md +3 -2
- package/data/uniappx/component/uni-ui-x/uni-badge-view.md +4 -0
- package/data/uniappx/component/uni-ui-x/uni-collapse.md +1 -1
- package/data/uniappx/component/uni-ui-x/uni-combox.md +39 -15
- package/data/uniappx/component/uni-ui-x/uni-icons.md +376 -0
- package/data/uniappx/component/uni-ui-x/uni-link.md +1 -1
- package/data/uniappx/component/uni-ui-x/uni-nav-bar.md +1 -1
- package/data/uniappx/component/uni-ui-x/uni-number-box.md +1 -1
- package/data/uniappx/component/uni-ui-x/uni-rate.md +5 -1
- package/data/uniappx/component/uni-ui-x/uni-tab.md +4 -0
- package/data/uniappx/component/unicloud-db.md +5 -5
- package/data/uniappx/component/video.md +3 -3
- package/data/uniappx/component/view.md +2 -0
- package/data/uniappx/component/waterflow.md +8 -2
- package/data/uniappx/component/web-view.md +2 -2
- package/data/uniappx/css/common/at-rules.md +13 -7
- package/data/uniappx/css/common/color.md +9 -9
- package/data/uniappx/css/common/function.md +2 -0
- package/data/uniappx/css/common/length.md +89 -89
- package/data/uniappx/css/common/selector.md +3 -3
- package/data/uniappx/css/visibility.md +8 -3
- package/data/uniappx/i18n.md +29 -29
- package/data/uniappx/mp/README.md +21 -0
- package/data/uniappx/native/download/android.md +14 -60
- package/data/uniappx/native/download/ios.md +5 -5
- package/data/uniappx/native/use/android.md +4 -2
- package/data/uniappx/native/use/androidcomm.md +130 -4
- package/data/uniappx/readme.md +51 -28
- package/data/uniappx/sample.md +57 -14
- package/data/uniappx/select/crossplatform-on-ai.md +470 -0
- package/data/uniappx/select/native-render-and-self-render.md +4 -4
- package/data/uniappx/tutorial/compliance.md +1 -1
- package/data/uniappx/tutorial/debug/devtools.md +16 -6
- package/data/uniappx/uniapptox.md +49 -18
- package/data/uniappx/uniappvsuniappx.md +157 -38
- package/data/uniappx/uts/buildin-object-api/array.md +0 -371
- package/data/uniappx/uts/uts2js.md +1 -1
- package/data/uniappx/vue/README.md +7 -2
- package/data/uniappx/vue/built-in.md +20 -6
- package/data/uniappx/vue/component.md +2 -0
- package/data/uniappx/vue/modifier.md +6 -6
- package/data/uniappx/web/ssr.md +17 -58
- package/data/uniappx-doc-index.json +99 -687
- package/dist/main.mjs +113 -87
- package/package.json +2 -2
- package/data/tmui4x/30./347/273/204/344/273/266/345/272/223//345/261/225/347/244/272/347/273/204/344/273/266//345/257/214/346/226/207/346/234/254 xMarkdown.md" +0 -211
- package/data/uni-app-x-docs/alert.md +0 -79
- package/data/uni-app-x-docs/avatar-group.md +0 -73
- package/data/uni-app-x-docs/badge.md +0 -62
- package/data/uni-app-x-docs/between-time.md +0 -76
- package/data/uni-app-x-docs/button.md +0 -114
- package/data/uni-app-x-docs/calendar-multiple.md +0 -90
- package/data/uni-app-x-docs/cell.md +0 -91
- package/data/uni-app-x-docs/checkbox-group.md +0 -62
- package/data/uni-app-x-docs/checkbox.md +0 -74
- package/data/uni-app-x-docs/circle-progress.md +0 -74
- package/data/uni-app-x-docs/code-input.md +0 -77
- package/data/uni-app-x-docs/col.md +0 -57
- package/data/uni-app-x-docs/collapse-item.md +0 -76
- package/data/uni-app-x-docs/collapse.md +0 -59
- package/data/uni-app-x-docs/countdown.md +0 -79
- package/data/uni-app-x-docs/date-view.md +0 -65
- package/data/uni-app-x-docs/drawer.md +0 -94
- package/data/uni-app-x-docs/dropdown-item.md +0 -68
- package/data/uni-app-x-docs/dropdown-menu.md +0 -70
- package/data/uni-app-x-docs/echart.md +0 -69
- package/data/uni-app-x-docs/float-drawer.md +0 -79
- package/data/uni-app-x-docs/form-item.md +0 -67
- package/data/uni-app-x-docs/form.md +0 -68
- package/data/uni-app-x-docs/html.md +0 -70
- package/data/uni-app-x-docs/icon.md +0 -67
- package/data/uni-app-x-docs/image.md +0 -74
- package/data/uni-app-x-docs/input.md +0 -126
- package/data/uni-app-x-docs/modal.md +0 -92
- package/data/uni-app-x-docs/money.md +0 -70
- package/data/uni-app-x-docs/more.md +0 -69
- package/data/uni-app-x-docs/navbar.md +0 -82
- package/data/uni-app-x-docs/picker-date.md +0 -75
- package/data/uni-app-x-docs/picker-selected.md +0 -75
- package/data/uni-app-x-docs/picker-time.md +0 -77
- package/data/uni-app-x-docs/picker-view.md +0 -70
- package/data/uni-app-x-docs/picker.md +0 -76
- package/data/uni-app-x-docs/popover.md +0 -68
- package/data/uni-app-x-docs/progress.md +0 -72
- package/data/uni-app-x-docs/pull-refresh.md +0 -73
- package/data/uni-app-x-docs/radio-group.md +0 -61
- package/data/uni-app-x-docs/radio.md +0 -74
- package/data/uni-app-x-docs/rate.md +0 -72
- package/data/uni-app-x-docs/row.md +0 -61
- package/data/uni-app-x-docs/sheet.md +0 -72
- package/data/uni-app-x-docs/sign-board.md +0 -61
- package/data/uni-app-x-docs/skeleton.md +0 -60
- package/data/uni-app-x-docs/sku.md +0 -69
- package/data/uni-app-x-docs/slider-double.md +0 -71
- package/data/uni-app-x-docs/slider-menu.md +0 -78
- package/data/uni-app-x-docs/slider.md +0 -71
- package/data/uni-app-x-docs/stepper.md +0 -76
- package/data/uni-app-x-docs/steps-item.md +0 -71
- package/data/uni-app-x-docs/steps.md +0 -73
- package/data/uni-app-x-docs/sticky-header.md +0 -57
- package/data/uni-app-x-docs/sticky.md +0 -55
- package/data/uni-app-x-docs/switch-slider.md +0 -82
- package/data/uni-app-x-docs/switch.md +0 -68
- package/data/uni-app-x-docs/tabbar.md +0 -83
- package/data/uni-app-x-docs/tabs.md +0 -84
- package/data/uni-app-x-docs/tag.md +0 -78
- package/data/uni-app-x-docs/text.md +0 -69
- package/data/uni-app-x-docs/upload-photo.md +0 -86
- package/data/uni-app-x-docs/upload-video.md +0 -86
- package/data/uni-app-x-docs//346/250/241/346/235/277.md +0 -47
- package/data/uniappx/alert.md +0 -61
- package/data/uniappx/avatar-group.md +0 -55
- package/data/uniappx/badge.md +0 -44
- package/data/uniappx/between-time.md +0 -58
- package/data/uniappx/button.md +0 -96
- package/data/uniappx/calendar-multiple.md +0 -72
- package/data/uniappx/cell.md +0 -73
- package/data/uniappx/checkbox-group.md +0 -44
- package/data/uniappx/checkbox.md +0 -56
- package/data/uniappx/circle-progress.md +0 -56
- package/data/uniappx/code-input.md +0 -59
- package/data/uniappx/col.md +0 -39
- package/data/uniappx/collapse-item.md +0 -58
- package/data/uniappx/collapse.md +0 -41
- package/data/uniappx/countdown.md +0 -61
- package/data/uniappx/date-view.md +0 -47
- package/data/uniappx/drawer.md +0 -76
- package/data/uniappx/dropdown-item.md +0 -50
- package/data/uniappx/dropdown-menu.md +0 -52
- package/data/uniappx/echart.md +0 -51
- package/data/uniappx/float-drawer.md +0 -61
- package/data/uniappx/form-item.md +0 -49
- package/data/uniappx/form.md +0 -50
- package/data/uniappx/html.md +0 -52
- package/data/uniappx/icon.md +0 -49
- package/data/uniappx/image.md +0 -56
- package/data/uniappx/input.md +0 -108
- package/data/uniappx/modal.md +0 -74
- package/data/uniappx/money.md +0 -52
- package/data/uniappx/more.md +0 -51
- package/data/uniappx/navbar.md +0 -64
- package/data/uniappx/picker-date.md +0 -57
- package/data/uniappx/picker-selected.md +0 -57
- package/data/uniappx/picker-time.md +0 -59
- package/data/uniappx/picker-view.md +0 -52
- package/data/uniappx/picker.md +0 -58
- package/data/uniappx/popover.md +0 -50
- package/data/uniappx/progress.md +0 -54
- package/data/uniappx/pull-refresh.md +0 -55
- package/data/uniappx/radio-group.md +0 -43
- package/data/uniappx/radio.md +0 -56
- package/data/uniappx/rate.md +0 -54
- package/data/uniappx/row.md +0 -43
- package/data/uniappx/sheet.md +0 -54
- package/data/uniappx/sign-board.md +0 -43
- package/data/uniappx/skeleton.md +0 -42
- package/data/uniappx/sku.md +0 -51
- package/data/uniappx/slider-double.md +0 -53
- package/data/uniappx/slider-menu.md +0 -60
- package/data/uniappx/slider.md +0 -53
- package/data/uniappx/stepper.md +0 -58
- package/data/uniappx/steps-item.md +0 -53
- package/data/uniappx/steps.md +0 -55
- package/data/uniappx/sticky-header.md +0 -39
- package/data/uniappx/sticky.md +0 -37
- package/data/uniappx/switch-slider.md +0 -64
- package/data/uniappx/switch.md +0 -50
- package/data/uniappx/tabbar.md +0 -65
- package/data/uniappx/tabs.md +0 -66
- package/data/uniappx/tag.md +0 -60
- package/data/uniappx/text.md +0 -51
- package/data/uniappx/upload-photo.md +0 -68
- package/data/uniappx/upload-video.md +0 -68
- package/data/uniappx//346/250/241/346/235/277.md +0 -34
|
@@ -392,28 +392,6 @@ find() 方法返回数组中满足提供的测试函数的第一个元素的值
|
|
|
392
392
|
| :- | :- | :- |
|
|
393
393
|
| √ | √ | √ |
|
|
394
394
|
|
|
395
|
-
### find(predicate, thisArg?)
|
|
396
|
-
|
|
397
|
-
::: preview
|
|
398
|
-
|
|
399
|
-
>UTS
|
|
400
|
-
```uts
|
|
401
|
-
const array3: number[] = [5, 12, 8, 130, 44];
|
|
402
|
-
const found2 = array3.find((element: number, index: number): boolean => element < 5);
|
|
403
|
-
console.log(found2) // null
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
### find(predicate, thisArg?)
|
|
407
|
-
|
|
408
|
-
::: preview
|
|
409
|
-
|
|
410
|
-
>UTS
|
|
411
|
-
```uts
|
|
412
|
-
const array1: number[] = [5, 12, 8, 130, 44];
|
|
413
|
-
const found1 = array1.find((element: number): boolean => element > 10);
|
|
414
|
-
console.log(found1) //12
|
|
415
|
-
```
|
|
416
|
-
|
|
417
395
|
### findIndex(predicate, thisArg?)
|
|
418
396
|
|
|
419
397
|
findIndex() 方法返回数组中满足提供的测试函数的第一个元素的索引。若没有找到对应元素则返回 -1。
|
|
@@ -459,46 +437,6 @@ findIndex() 方法返回数组中满足提供的测试函数的第一个元素
|
|
|
459
437
|
| :- | :- | :- |
|
|
460
438
|
| √ | √ | √ |
|
|
461
439
|
|
|
462
|
-
### findIndex(predicate, thisArg?)
|
|
463
|
-
|
|
464
|
-
::: preview
|
|
465
|
-
|
|
466
|
-
>UTS
|
|
467
|
-
```uts
|
|
468
|
-
const array1: number[] = [5, 12, 8, 130, 44];
|
|
469
|
-
let isLargeNumber = (element: number, index: number): boolean => element > 13;
|
|
470
|
-
console.log(isLargeNumber)//3
|
|
471
|
-
|
|
472
|
-
const array2: number[] = [10, 11, 12];
|
|
473
|
-
console.log(array2.findIndex(isLargeNumber))//3
|
|
474
|
-
|
|
475
|
-
const array3: number[] = [1, 2, 3];
|
|
476
|
-
array3.findIndex((element: number, index: number, array: number[]): boolean => {
|
|
477
|
-
console.log(array[index]) //1=>2=>3
|
|
478
|
-
return true;
|
|
479
|
-
})
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
### findIndex(predicate, thisArg?)
|
|
483
|
-
|
|
484
|
-
::: preview
|
|
485
|
-
|
|
486
|
-
>UTS
|
|
487
|
-
```uts
|
|
488
|
-
const array1: number[] = [5, 12, 8, 130, 44];
|
|
489
|
-
let isLargeNumber = (element: number, index: number): boolean => element > 13;
|
|
490
|
-
console.log(isLargeNumber)//3
|
|
491
|
-
|
|
492
|
-
const array2: number[] = [10, 11, 12];
|
|
493
|
-
console.log(array2.findIndex(isLargeNumber))//3
|
|
494
|
-
|
|
495
|
-
const array3: number[] = [1, 2, 3];
|
|
496
|
-
array3.findIndex((element: number, index: number, array: number[]): boolean => {
|
|
497
|
-
console.log(array[index]) //1=>2=>3
|
|
498
|
-
return true;
|
|
499
|
-
})
|
|
500
|
-
```
|
|
501
|
-
|
|
502
440
|
### fill(value, start?, end?)
|
|
503
441
|
|
|
504
442
|
fill() 方法用一个固定值填充一个数组中从起始索引(默认为 0)到终止索引(默认为 array.length)内的全部元素。它返回修改后的数组。
|
|
@@ -1198,48 +1136,6 @@ every() 方法测试一个数组内的所有元素是否都能通过指定函数
|
|
|
1198
1136
|
| :- | :- | :- |
|
|
1199
1137
|
| √ | √ | √ |
|
|
1200
1138
|
|
|
1201
|
-
### every(predicate, thisArg?)
|
|
1202
|
-
|
|
1203
|
-
::: preview
|
|
1204
|
-
|
|
1205
|
-
>UTS
|
|
1206
|
-
```uts
|
|
1207
|
-
const isBelowThreshold = (currentValue: number): boolean => currentValue < 40;
|
|
1208
|
-
const array1: number[] = [1, 30, 39, 29, 10, 13];
|
|
1209
|
-
console.log(array1.every(isBelowThreshold));// true
|
|
1210
|
-
|
|
1211
|
-
const array2: number[] = [1, 30, 39, 29, 10, 13, 41];
|
|
1212
|
-
console.log(array2.every(isBelowThreshold));// false
|
|
1213
|
-
|
|
1214
|
-
const array3: number[] = [1, 2, 3];
|
|
1215
|
-
array3.every((element: number, index: number, array: number[]): boolean => {
|
|
1216
|
-
console.log(array[index])//1=>2->3
|
|
1217
|
-
return true;
|
|
1218
|
-
})
|
|
1219
|
-
|
|
1220
|
-
```
|
|
1221
|
-
|
|
1222
|
-
### every(predicate, thisArg?)
|
|
1223
|
-
|
|
1224
|
-
::: preview
|
|
1225
|
-
|
|
1226
|
-
>UTS
|
|
1227
|
-
```uts
|
|
1228
|
-
const isBelowThreshold = (currentValue: number): boolean => currentValue < 40;
|
|
1229
|
-
const array1: number[] = [1, 30, 39, 29, 10, 13];
|
|
1230
|
-
console.log(array1.every(isBelowThreshold));// true
|
|
1231
|
-
|
|
1232
|
-
const array2: number[] = [1, 30, 39, 29, 10, 13, 41];
|
|
1233
|
-
console.log(array2.every(isBelowThreshold));// false
|
|
1234
|
-
|
|
1235
|
-
const array3: number[] = [1, 2, 3];
|
|
1236
|
-
array3.every((element: number, index: number, array: number[]): boolean => {
|
|
1237
|
-
console.log(array[index])//1=>2->3
|
|
1238
|
-
return true;
|
|
1239
|
-
})
|
|
1240
|
-
|
|
1241
|
-
```
|
|
1242
|
-
|
|
1243
1139
|
### some(predicate, thisArg?)
|
|
1244
1140
|
|
|
1245
1141
|
some() 方法测试数组中是否至少有一个元素通过了由提供的函数实现的测试。如果在数组中找到一个元素使得提供的函数返回 true,则返回 true;否则返回 false。它不会修改数组。
|
|
@@ -1276,10 +1172,6 @@ some() 方法测试数组中是否至少有一个元素通过了由提供的函
|
|
|
1276
1172
|
| :- | :- | :- |
|
|
1277
1173
|
| √ | √ | √ |
|
|
1278
1174
|
|
|
1279
|
-
### some(predicate, thisArg?)
|
|
1280
|
-
|
|
1281
|
-
### some(predicate, thisArg?)
|
|
1282
|
-
|
|
1283
1175
|
### forEach(callbackfn, thisArg?)
|
|
1284
1176
|
|
|
1285
1177
|
forEach() 方法对数组的每个元素执行一次给定的函数。
|
|
@@ -1348,44 +1240,6 @@ forEach() 方法对数组的每个元素执行一次给定的函数。
|
|
|
1348
1240
|
| :- | :- | :- |
|
|
1349
1241
|
| √ | √ | √ |
|
|
1350
1242
|
|
|
1351
|
-
### forEach(callbackfn, thisArg?)
|
|
1352
|
-
|
|
1353
|
-
::: preview
|
|
1354
|
-
|
|
1355
|
-
>UTS
|
|
1356
|
-
```uts
|
|
1357
|
-
const array1: string[] = ['a', 'b', 'c'];
|
|
1358
|
-
array1.forEach(element => {console.log(element)});
|
|
1359
|
-
// expected output: "a"
|
|
1360
|
-
// expected output: "b"
|
|
1361
|
-
// expected output: "c"
|
|
1362
|
-
const items: string[] = ['item1', 'item2', 'item3'];
|
|
1363
|
-
const copyItems: string[] = [];
|
|
1364
|
-
items.forEach((item: string) => {
|
|
1365
|
-
copyItems.push(item);
|
|
1366
|
-
});
|
|
1367
|
-
console.log(copyItems)//['item1', 'item2', 'item3']
|
|
1368
|
-
```
|
|
1369
|
-
|
|
1370
|
-
### forEach(callbackfn, thisArg?)
|
|
1371
|
-
|
|
1372
|
-
::: preview
|
|
1373
|
-
|
|
1374
|
-
>UTS
|
|
1375
|
-
```uts
|
|
1376
|
-
const array1: string[] = ['a', 'b', 'c'];
|
|
1377
|
-
array1.forEach(element => {console.log(element)});
|
|
1378
|
-
// expected output: "a"
|
|
1379
|
-
// expected output: "b"
|
|
1380
|
-
// expected output: "c"
|
|
1381
|
-
const items: string[] = ['item1', 'item2', 'item3'];
|
|
1382
|
-
const copyItems: string[] = [];
|
|
1383
|
-
items.forEach((item: string) => {
|
|
1384
|
-
copyItems.push(item);
|
|
1385
|
-
});
|
|
1386
|
-
console.log(copyItems)//['item1', 'item2', 'item3']
|
|
1387
|
-
```
|
|
1388
|
-
|
|
1389
1243
|
### map(callbackfn, thisArg?)
|
|
1390
1244
|
|
|
1391
1245
|
map() 方法创建一个新数组,这个新数组由原数组中的每个元素都调用一次提供的函数后的返回值组成。
|
|
@@ -1430,44 +1284,6 @@ map() 方法创建一个新数组,这个新数组由原数组中的每个元
|
|
|
1430
1284
|
| :- | :- | :- |
|
|
1431
1285
|
| √ | √ | √ |
|
|
1432
1286
|
|
|
1433
|
-
### map(callbackfn, thisArg?)
|
|
1434
|
-
|
|
1435
|
-
::: preview
|
|
1436
|
-
|
|
1437
|
-
>UTS
|
|
1438
|
-
```uts
|
|
1439
|
-
const array1: number[] = [1, 4, 9, 16];
|
|
1440
|
-
const map1 = array1.map((x: number): number => x * 2);
|
|
1441
|
-
console.log(map1);
|
|
1442
|
-
// expected output: Array [2, 8, 18, 32]
|
|
1443
|
-
const numbers: number[] = [1, 4, 9];
|
|
1444
|
-
const roots = numbers.map((num: number): number => num + 1);
|
|
1445
|
-
|
|
1446
|
-
const array2: number[] = [1, 2, 3];
|
|
1447
|
-
array2.map((element: number, index: number, array: number[]) => {
|
|
1448
|
-
console.log(array[index]) //1=>2=>3
|
|
1449
|
-
})
|
|
1450
|
-
```
|
|
1451
|
-
|
|
1452
|
-
### map(callbackfn, thisArg?)
|
|
1453
|
-
|
|
1454
|
-
::: preview
|
|
1455
|
-
|
|
1456
|
-
>UTS
|
|
1457
|
-
```uts
|
|
1458
|
-
const array1: number[] = [1, 4, 9, 16];
|
|
1459
|
-
const map1 = array1.map((x: number): number => x * 2);
|
|
1460
|
-
console.log(map1);
|
|
1461
|
-
// expected output: Array [2, 8, 18, 32]
|
|
1462
|
-
const numbers: number[] = [1, 4, 9];
|
|
1463
|
-
const roots = numbers.map((num: number): number => num + 1);
|
|
1464
|
-
|
|
1465
|
-
const array2: number[] = [1, 2, 3];
|
|
1466
|
-
array2.map((element: number, index: number, array: number[]) => {
|
|
1467
|
-
console.log(array[index]) //1=>2=>3
|
|
1468
|
-
})
|
|
1469
|
-
```
|
|
1470
|
-
|
|
1471
1287
|
### filter(predicate, thisArg?)
|
|
1472
1288
|
|
|
1473
1289
|
filter() 方法创建给定数组一部分的浅拷贝,其包含通过所提供函数实现的测试的所有元素。
|
|
@@ -1576,64 +1392,6 @@ filter() 方法创建给定数组一部分的浅拷贝,其包含通过所提
|
|
|
1576
1392
|
| :- | :- | :- |
|
|
1577
1393
|
| √ | √ | √ |
|
|
1578
1394
|
|
|
1579
|
-
### filter(predicate, thisArg?)
|
|
1580
|
-
|
|
1581
|
-
::: preview
|
|
1582
|
-
|
|
1583
|
-
>UTS
|
|
1584
|
-
```uts
|
|
1585
|
-
const words: string[] = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
|
|
1586
|
-
const result = words.filter((word: string): boolean => word.length > 6);
|
|
1587
|
-
console.log(result);// ["exuberant", "destruction", "present"]
|
|
1588
|
-
|
|
1589
|
-
const array1: number[] = [-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
|
1590
|
-
const isPrime = array1.filter((num: number): boolean => {
|
|
1591
|
-
for (let i = 2; num > i; i++) {
|
|
1592
|
-
// swift里,基础类型暂不支持!==,===对比
|
|
1593
|
-
if (num % i == 0) {
|
|
1594
|
-
return false;
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
return num > 1;
|
|
1598
|
-
})
|
|
1599
|
-
console.log(isPrime)//[2, 3, 5, 7, 11, 13]
|
|
1600
|
-
|
|
1601
|
-
const array2: number[] = [1, 2, 3];
|
|
1602
|
-
array2.filter((element: number, index: number, array: number[]): boolean => {
|
|
1603
|
-
console.log(array[index])//1=>2=>3
|
|
1604
|
-
return true;
|
|
1605
|
-
})
|
|
1606
|
-
```
|
|
1607
|
-
|
|
1608
|
-
### filter(predicate, thisArg?)
|
|
1609
|
-
|
|
1610
|
-
::: preview
|
|
1611
|
-
|
|
1612
|
-
>UTS
|
|
1613
|
-
```uts
|
|
1614
|
-
const words: string[] = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
|
|
1615
|
-
const result = words.filter((word: string): boolean => word.length > 6);
|
|
1616
|
-
console.log(result);// ["exuberant", "destruction", "present"]
|
|
1617
|
-
|
|
1618
|
-
const array1: number[] = [-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
|
1619
|
-
const isPrime = array1.filter((num: number): boolean => {
|
|
1620
|
-
for (let i = 2; num > i; i++) {
|
|
1621
|
-
// swift里,基础类型暂不支持!==,===对比
|
|
1622
|
-
if (num % i == 0) {
|
|
1623
|
-
return false;
|
|
1624
|
-
}
|
|
1625
|
-
}
|
|
1626
|
-
return num > 1;
|
|
1627
|
-
})
|
|
1628
|
-
console.log(isPrime)//[2, 3, 5, 7, 11, 13]
|
|
1629
|
-
|
|
1630
|
-
const array2: number[] = [1, 2, 3];
|
|
1631
|
-
array2.filter((element: number, index: number, array: number[]): boolean => {
|
|
1632
|
-
console.log(array[index])//1=>2=>3
|
|
1633
|
-
return true;
|
|
1634
|
-
})
|
|
1635
|
-
```
|
|
1636
|
-
|
|
1637
1395
|
### reduce(callbackfn)
|
|
1638
1396
|
|
|
1639
1397
|
reduce() 方法对数组中的每个元素按序执行一个提供的 reducer 函数,每一次运行 reducer 会将先前元素的计算结果作为参数传入,最后将其结果汇总为单个返回值。
|
|
@@ -1753,51 +1511,6 @@ reduce() 方法对数组中的每个元素按序执行一个提供的 reducer
|
|
|
1753
1511
|
| :- | :- | :- |
|
|
1754
1512
|
| √ | x | √ |
|
|
1755
1513
|
|
|
1756
|
-
### reduce(callbackfn, initialValue)
|
|
1757
|
-
|
|
1758
|
-
::: preview
|
|
1759
|
-
|
|
1760
|
-
>UTS
|
|
1761
|
-
```uts
|
|
1762
|
-
const array1: number[] = [1, 2, 3, 4];
|
|
1763
|
-
const initialValue: number = 0;
|
|
1764
|
-
const sumWithInitial = array1.reduce(
|
|
1765
|
-
(previousValue: number, currentValue: number): number => previousValue + currentValue,
|
|
1766
|
-
initialValue
|
|
1767
|
-
);
|
|
1768
|
-
console.log(sumWithInitial)//10
|
|
1769
|
-
```
|
|
1770
|
-
|
|
1771
|
-
### reduce(callbackfn, initialValue)
|
|
1772
|
-
|
|
1773
|
-
::: preview
|
|
1774
|
-
|
|
1775
|
-
>UTS
|
|
1776
|
-
```uts
|
|
1777
|
-
const array1: number[] = [1, 2, 3, 4];
|
|
1778
|
-
const initialValue: number = 0;
|
|
1779
|
-
const sumWithInitial = array1.reduce(
|
|
1780
|
-
(previousValue: number, currentValue: number): number => previousValue + currentValue,
|
|
1781
|
-
initialValue
|
|
1782
|
-
);
|
|
1783
|
-
console.log(sumWithInitial)//10
|
|
1784
|
-
```
|
|
1785
|
-
|
|
1786
|
-
### reduce(callbackfn, initialValue)
|
|
1787
|
-
|
|
1788
|
-
::: preview
|
|
1789
|
-
|
|
1790
|
-
>UTS
|
|
1791
|
-
```uts
|
|
1792
|
-
const array1: number[] = [1, 2, 3, 4];
|
|
1793
|
-
const initialValue: number = 0;
|
|
1794
|
-
const sumWithInitial = array1.reduce(
|
|
1795
|
-
(previousValue: number, currentValue: number): number => previousValue + currentValue,
|
|
1796
|
-
initialValue
|
|
1797
|
-
);
|
|
1798
|
-
console.log(sumWithInitial)//10
|
|
1799
|
-
```
|
|
1800
|
-
|
|
1801
1514
|
### reduceRight(callbackfn)
|
|
1802
1515
|
|
|
1803
1516
|
reduceRight() 方法对累加器(accumulator)和数组的每个值(按从右到左的顺序)应用一个函数,并使其成为单个值。
|
|
@@ -1935,90 +1648,6 @@ reduceRight() 方法对累加器(accumulator)和数组的每个值(按从
|
|
|
1935
1648
|
| :- | :- | :- |
|
|
1936
1649
|
| √ | x | √ |
|
|
1937
1650
|
|
|
1938
|
-
### reduceRight(callbackfn, initialValue)
|
|
1939
|
-
|
|
1940
|
-
::: preview
|
|
1941
|
-
|
|
1942
|
-
>UTS
|
|
1943
|
-
```uts
|
|
1944
|
-
const array1: number[][] = [[0, 1], [2, 3], [4, 5]];
|
|
1945
|
-
const result1 = array1.reduceRight((accumulator: number[], currentValue: number[]): number[] => accumulator.concat(currentValue));
|
|
1946
|
-
console.log(result1) //[4, 5, 2, 3, 0, 1]
|
|
1947
|
-
|
|
1948
|
-
const array2: number[] = [1, 2, 3, 4];
|
|
1949
|
-
let result2 = array2.reduceRight((acc: number, cur: number, index: number, array: number[]): number => {
|
|
1950
|
-
return acc + cur;
|
|
1951
|
-
});
|
|
1952
|
-
|
|
1953
|
-
console.log(result2) //10
|
|
1954
|
-
|
|
1955
|
-
const result3 = array2.reduceRight((acc: number, cur: number): number => acc + cur, 5);
|
|
1956
|
-
console.log(result3) //15
|
|
1957
|
-
```
|
|
1958
|
-
|
|
1959
|
-
### reduceRight(callbackfn, initialValue)
|
|
1960
|
-
|
|
1961
|
-
::: preview
|
|
1962
|
-
|
|
1963
|
-
>UTS
|
|
1964
|
-
```uts
|
|
1965
|
-
const array1: number[][] = [[0, 1], [2, 3], [4, 5]];
|
|
1966
|
-
const result1 = array1.reduceRight((accumulator: number[], currentValue: number[]): number[] => accumulator.concat(currentValue));
|
|
1967
|
-
console.log(result1) //[4, 5, 2, 3, 0, 1]
|
|
1968
|
-
|
|
1969
|
-
const array2: number[] = [1, 2, 3, 4];
|
|
1970
|
-
let result2 = array2.reduceRight((acc: number, cur: number, index: number, array: number[]): number => {
|
|
1971
|
-
return acc + cur;
|
|
1972
|
-
});
|
|
1973
|
-
|
|
1974
|
-
console.log(result2) //10
|
|
1975
|
-
|
|
1976
|
-
const result3 = array2.reduceRight((acc: number, cur: number): number => acc + cur, 5);
|
|
1977
|
-
console.log(result3) //15
|
|
1978
|
-
```
|
|
1979
|
-
|
|
1980
|
-
### reduceRight(callbackfn, initialValue)
|
|
1981
|
-
|
|
1982
|
-
::: preview
|
|
1983
|
-
|
|
1984
|
-
>UTS
|
|
1985
|
-
```uts
|
|
1986
|
-
const array1: number[][] = [[0, 1], [2, 3], [4, 5]];
|
|
1987
|
-
const result1 = array1.reduceRight((accumulator: number[], currentValue: number[]): number[] => accumulator.concat(currentValue));
|
|
1988
|
-
console.log(result1) //[4, 5, 2, 3, 0, 1]
|
|
1989
|
-
|
|
1990
|
-
const array2: number[] = [1, 2, 3, 4];
|
|
1991
|
-
let result2 = array2.reduceRight((acc: number, cur: number, index: number, array: number[]): number => {
|
|
1992
|
-
return acc + cur;
|
|
1993
|
-
});
|
|
1994
|
-
|
|
1995
|
-
console.log(result2) //10
|
|
1996
|
-
|
|
1997
|
-
const result3 = array2.reduceRight((acc: number, cur: number): number => acc + cur, 5);
|
|
1998
|
-
console.log(result3) //15
|
|
1999
|
-
```
|
|
2000
|
-
|
|
2001
|
-
### reduceRight(callbackfn, initialValue)
|
|
2002
|
-
|
|
2003
|
-
::: preview
|
|
2004
|
-
|
|
2005
|
-
>UTS
|
|
2006
|
-
```uts
|
|
2007
|
-
const array1: number[][] = [[0, 1], [2, 3], [4, 5]];
|
|
2008
|
-
const result1 = array1.reduceRight((accumulator: number[], currentValue: number[]): number[] => accumulator.concat(currentValue));
|
|
2009
|
-
console.log(result1) //[4, 5, 2, 3, 0, 1]
|
|
2010
|
-
|
|
2011
|
-
const array2: number[] = [1, 2, 3, 4];
|
|
2012
|
-
let result2 = array2.reduceRight((acc: number, cur: number, index: number, array: number[]): number => {
|
|
2013
|
-
return acc + cur;
|
|
2014
|
-
});
|
|
2015
|
-
|
|
2016
|
-
console.log(result2) //10
|
|
2017
|
-
|
|
2018
|
-
const result3 = array2.reduceRight((acc: number, cur: number): number => acc + cur, 5);
|
|
2019
|
-
console.log(result3) //15
|
|
2020
|
-
```
|
|
2021
|
-
|
|
2022
1651
|
### includes(searchElement, fromIndex?)
|
|
2023
1652
|
|
|
2024
1653
|
includes() 方法用来判断一个数组是否包含一个指定的值,根据情况,如果包含则返回 true,否则返回 false。
|
|
@@ -19,7 +19,7 @@ uts在编译运行目标为js时,会通过uts2js来编译。
|
|
|
19
19
|
如果开发者写了js,可能会在编译器或IDE静态校验时提示类型错误,但不影响实际运行时表现。
|
|
20
20
|
|
|
21
21
|
1. 为了拉齐uts编译原生强类型的跨端表现,uts编译后的js,与标准js有略微差异:
|
|
22
|
-
+ 支持UTSJSONObject。尤其是UTSJSONObject有几个方法,在标准js object
|
|
22
|
+
+ 支持UTSJSONObject。尤其是UTSJSONObject有几个方法,在标准js object中不存在,包括`parse`,`get`,`set`,`getAny`,`getBoolean`,`getNumber`,`getString`,`getArray`,`getJSON`,`toMap`。
|
|
23
23
|
+ type没有擦除而是编译成了class。这也是为了保持和uts2kt、uts2swift一致。
|
|
24
24
|
+ 把部分js内置API返回值从undefined改为null。因为kt、swift等强类型语言没有undefined概念,为拉齐而反向修改了js端逻辑。以下js内置API在uts2js编译后,会将返回值从undefined改为null:
|
|
25
25
|
* Array.prototype.pop
|
|
@@ -283,7 +283,10 @@ HBuilderX 4.71 起,App 端可以使用深度选择器控制台不再告警,
|
|
|
283
283
|
9. 在组合式 API 下,子组件方法不会自动暴露给父组件,只有通过 `defineExpose` 显式暴露的方法,父组件才能通过 ref 调用,避免父组件无法访问子组件方法。
|
|
284
284
|
10. 在测试例页面用到页面中的数据或方法时,必须通过 `defineExpose` 显式暴露数据和方法,避免测试无法访问。
|
|
285
285
|
11. 在页面生命周期中,`onPullDownRefresh` 应作为页面生命周期函数处理,而不是写成普通方法。
|
|
286
|
-
12.
|
|
286
|
+
12. 组合式写法不支持 `mixins` 选项:
|
|
287
|
+
- 选项中若使用了 `mixins: [...]`,必须去掉,把 mixin 提供的 data、computed、watch、methods 和生命周期合并进当前组件的组合式代码,或抽成普通 composable 函数;
|
|
288
|
+
- 若使用了 `uniCloud.mixinDatacom`,改用其对应的组合式 API:用 `const props = defineProps({ ...uniCloud.datacomProps })` 展开内置 props,再 `const datacom = uniCloud.useDatacom(props)` 创建实例并调用 `datacom.easyGet({})`,模板改用 `datacom.resData`/`datacom.loading`/`datacom.errorMessage`(不用 `.value`),不要手动拷贝其内部实现;注意:`uniCloud.useDatacom` 从 HBuilderX 5.32 版本起才支持,且仅在项目已关联 uniCloud 服务空间时可用,使用前需先关联服务空间。
|
|
289
|
+
13. 检查控制台的编译报错,如果有报错自行修复,并再次检查编译报错,直到无报错编译通过。
|
|
287
290
|
|
|
288
291
|
## 利用 AI 适配蒸汽模式@ai-vapor
|
|
289
292
|
|
|
@@ -300,7 +303,9 @@ HBuilderX 4.71 起,App 端可以使用深度选择器控制台不再告警,
|
|
|
300
303
|
7. 选项式 API 中的 `beforeUnmount`、`mounted`、`unmounted`,改为组合式 API 时分别使用 `onBeforeUnmount`、`onMounted`、`onUnmounted`;`created` 的逻辑放到 `<script setup>` 顶层执行。
|
|
301
304
|
8. 页面生命周期 `onPullDownRefresh` 不要当作普通方法处理;如果蒸汽模式当前平台不支持页面下拉刷新,改为使用页面内 `scroll-view` 等可兼容方案,并保持交互等价。
|
|
302
305
|
9. 子组件方法、页面测试入口或外部需要访问的数据和方法,必须通过 `defineExpose` 显式暴露,避免父组件、测试用例或外部调用失效。
|
|
303
|
-
10. 不要继续使用 `mixin
|
|
306
|
+
10. 不要继续使用 `mixin`:
|
|
307
|
+
- 普通 `mixins: [...]` 必须去掉,把 mixin 提供的 data、computed、watch、methods 和生命周期合并进当前组件的组合式代码,或抽成普通 composable 函数;
|
|
308
|
+
- 若使用了 `uniCloud.mixinDatacom`,改用其对应的组合式 API:用 `const props = defineProps({ ...uniCloud.datacomProps })` 展开内置 props,再 `const datacom = uniCloud.useDatacom(props)` 创建实例并调用 `datacom.easyGet({})`,模板改用 `datacom.resData`/`datacom.loading`/`datacom.errorMessage`(不用 `.value`),不要手动拷贝其内部实现;注意:`uniCloud.useDatacom` 从 HBuilderX 5.32 版本起才支持,且仅在项目已关联 uniCloud 服务空间时可用,使用前需先关联服务空间。
|
|
304
309
|
11. 检查模板中蒸汽模式不支持或行为变化的写法,按项目现有规范改成兼容写法,保持页面结构和交互不变。
|
|
305
310
|
12. 检查 `scroll-view`、`swiper` 等组件的布尔属性;不要依赖旧默认值,按页面实际需要显式补齐 `true` 或 `false`,避免行为变化。
|
|
306
311
|
13. 检查 `list-view` / `list-item`:用于复用的 `list-item` 循环必须有稳定 `:key`;`list-view` 和需要复用的 `list-item` 应在同一个 uvue 文件内;`list-item` 内文本必须使用 `text` 包裹;不要依赖横向滚动、`margin` 等不兼容能力。
|
|
@@ -2063,8 +2063,8 @@
|
|
|
2063
2063
|
|
|
2064
2064
|
<template>
|
|
2065
2065
|
<view>
|
|
2066
|
-
<input ref="input" />
|
|
2067
|
-
<text v-for="item in 3" ref="textItems" :key="item">{{
|
|
2066
|
+
<input id="input" ref="input" />
|
|
2067
|
+
<text v-for="item in 3" :id="'text-item-' + item" ref="textItems" :key="item">{{
|
|
2068
2068
|
item
|
|
2069
2069
|
}}</text>
|
|
2070
2070
|
<Foo ref="foo" />
|
|
@@ -2073,13 +2073,25 @@
|
|
|
2073
2073
|
```
|
|
2074
2074
|
`this.$refs` 也是非响应式的,因此你不应该尝试在模板中使用它来进行数据绑定。
|
|
2075
2075
|
|
|
2076
|
+
对应的 `Foo` 组件(选项式 API):
|
|
2077
|
+
|
|
2078
|
+
```vue
|
|
2079
|
+
|
|
2080
|
+
<template>
|
|
2081
|
+
<view>
|
|
2082
|
+
<text>title: {{title}}</text>
|
|
2083
|
+
</view>
|
|
2084
|
+
</template>
|
|
2085
|
+
|
|
2086
|
+
```
|
|
2087
|
+
|
|
2076
2088
|
使用组合式 API,引用将存储在与名字匹配的 ref 里:
|
|
2077
2089
|
```vue
|
|
2078
2090
|
|
|
2079
2091
|
<template>
|
|
2080
2092
|
<view>
|
|
2081
|
-
<input ref="input" />
|
|
2082
|
-
<text v-for="item in 3" ref="textItems" :key="item">{{
|
|
2093
|
+
<input id="input" ref="input" />
|
|
2094
|
+
<text v-for="item in 3" :id="'text-item-' + item" ref="textItems" :key="item">{{
|
|
2083
2095
|
item
|
|
2084
2096
|
}}</text>
|
|
2085
2097
|
<Foo ref="foo" />
|
|
@@ -2087,6 +2099,8 @@
|
|
|
2087
2099
|
</template>
|
|
2088
2100
|
```
|
|
2089
2101
|
|
|
2102
|
+
对应的 `Foo` 组件(组合式 API),通过 `defineExpose` 暴露供父组件调用的方法:
|
|
2103
|
+
|
|
2090
2104
|
```vue
|
|
2091
2105
|
|
|
2092
2106
|
<template>
|
|
@@ -2098,9 +2112,9 @@
|
|
|
2098
2112
|
```
|
|
2099
2113
|
|
|
2100
2114
|
#### 获取内置组件与自定义组件的区别
|
|
2101
|
-
- 使用 `ref` 获取内置组件实例时会获取到对应的 `Element`,例如上述代码示例中,`input` 组件获取到的是 `UniInputElement`, `text` 组件获取到的是 `UniTextElement`,可以调用 `Element` 的方法和属性。
|
|
2115
|
+
- App、Web 使用 `ref` 获取内置组件实例时会获取到对应的 `Element`,例如上述代码示例中,`input` 组件获取到的是 `UniInputElement`, `text` 组件获取到的是 `UniTextElement`,可以调用 `Element` 的方法和属性。
|
|
2102
2116
|
- 使用 `ref` 获取自定义组件实例时会获取到对应的 vue 组件实例,例如上述代码示例中,`Foo` 组件获取到的是 `ComponentPublicInstance`,可以获取自定义组件的属性或调用方法,[详情](./component.md#page-call-component-method)。
|
|
2103
|
-
-
|
|
2117
|
+
- 小程序平台使用 `ref` 获取内置组件引用时,需要为节点设置 `id`,`v-for` 中各节点的 `id` 应保持唯一。小程序仅支持 `UniElement`,不支持 `UniInputElement`、`UniTextElement` 等类型,且可用的属性和方法受限,详情参考:[UniElement](../mp/README.md#unielement)。
|
|
2104
2118
|
|
|
2105
2119
|
### is
|
|
2106
2120
|
|
|
@@ -912,6 +912,8 @@ ComponentPublicInstance
|
|
|
912
912
|
```
|
|
913
913
|
这个 `$attrs` 对象包含了除组件所声明的 `props` 和 `emits` 之外的所有其他 attribute,例如 `class`,`style`,`v-on` 监听器等等。
|
|
914
914
|
|
|
915
|
+
uni-app x 编译到小程序时,`v-bind="$attrs"` 的显式透传范围存在限制,详见[文档](../mp/README.md#v-bind-attrs)。
|
|
916
|
+
|
|
915
917
|
有几点需要注意:
|
|
916
918
|
|
|
917
919
|
- 和 `props` 有所不同,透传 attributes 在 JavaScript 中保留了它们原始的大小写,所以像 `foo-bar` 这样的一个 attribute 需要通过 `$attrs['foo-bar']` 来访问。
|
|
@@ -235,15 +235,15 @@
|
|
|
235
235
|
如果你想让用户输入自动转换为数字,你可以在 `v-model` 后添加 `.number` 修饰符来管理输入
|
|
236
236
|
|
|
237
237
|
**兼容性 **
|
|
238
|
-
| Web | 微信小程序 | Android | iOS | HarmonyOS |
|
|
239
|
-
| :- | :- | :- | :- | :- |
|
|
240
|
-
| 4.0 | √ | 3.9 | x | x |
|
|
238
|
+
| Web | 微信小程序 | Android | iOS(VDOM) | iOS(Vapor) | HarmonyOS(VDOM) | HarmonyOS(Vapor) |
|
|
239
|
+
| :- | :- | :- | :- | :- | :- | :- |
|
|
240
|
+
| 4.0 | √ | 3.9 | x | 5.11 | x | 5.0 |
|
|
241
241
|
|
|
242
242
|
### trim
|
|
243
243
|
|
|
244
244
|
如果你想要默认自动去除用户输入内容中两端的空格,你可以在 `v-model` 后添加 `.trim` 修饰符
|
|
245
245
|
|
|
246
246
|
**兼容性 **
|
|
247
|
-
| Web | 微信小程序 | Android | iOS | HarmonyOS |
|
|
248
|
-
| :- | :- | :- | :- | :- |
|
|
249
|
-
| 4.0 | √ | 3.9 | x | x |
|
|
247
|
+
| Web | 微信小程序 | Android | iOS(VDOM) | iOS(Vapor) | HarmonyOS(VDOM) | HarmonyOS(Vapor) |
|
|
248
|
+
| :- | :- | :- | :- | :- | :- | :- |
|
|
249
|
+
| 4.0 | √ | 3.9 | x | 5.11 | x | 5.0 |
|
package/data/uniappx/web/ssr.md
CHANGED
|
@@ -42,7 +42,9 @@ export default defineConfig({
|
|
|
42
42
|
|
|
43
43
|
**示例**
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
下面示例假设 `@/store/index.uts` 已导出 `useItemsStore`,包含按 ID 保存数据的 `items` 状态和异步 `fetchItem(id)` 方法。SSR 配置见下方 [Pinia](#pinia) 章节。
|
|
46
|
+
|
|
47
|
+
```vue
|
|
46
48
|
<template>
|
|
47
49
|
<text v-if="item">{{ item.title }}</text>
|
|
48
50
|
<text v-else>...</text>
|
|
@@ -58,80 +60,37 @@ export default defineConfig({
|
|
|
58
60
|
const categories = ssrRef(['c1', 'c2'], 'categories');
|
|
59
61
|
```
|
|
60
62
|
|
|
61
|
-
####
|
|
63
|
+
#### Pinia
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
Pinia 的引入和 store 定义见[全局变量与状态管理](../tutorial/store.md#pinia)。SSR 时需为每次请求创建独立的 Pinia 实例,并返回以下 `store` 适配对象,以同步服务端和客户端状态:
|
|
64
66
|
|
|
65
67
|
**main.uts**
|
|
66
68
|
|
|
67
69
|
```ts
|
|
68
70
|
import { createSSRApp } from 'vue'
|
|
71
|
+
import { createPinia } from 'pinia'
|
|
72
|
+
import type { StateTree } from 'pinia'
|
|
69
73
|
import App from './App.uvue'
|
|
70
|
-
|
|
74
|
+
|
|
71
75
|
export function createApp() {
|
|
72
76
|
const app = createSSRApp(App)
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
app.use(store)
|
|
77
|
+
const pinia = createPinia()
|
|
78
|
+
app.use(pinia)
|
|
76
79
|
|
|
77
80
|
return {
|
|
78
81
|
app,
|
|
79
|
-
store
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**store/index.uts**
|
|
85
|
-
|
|
86
|
-
```ts
|
|
87
|
-
import { createStore } from 'vuex'
|
|
88
|
-
|
|
89
|
-
// 模拟接口获取数据
|
|
90
|
-
function fetchItem(id) {
|
|
91
|
-
return new Promise((resolve) => {
|
|
92
|
-
setTimeout(() => {
|
|
93
|
-
resolve({
|
|
94
|
-
id,
|
|
95
|
-
title: 'title' + id,
|
|
96
|
-
})
|
|
97
|
-
}, 300)
|
|
98
|
-
})
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export default () => {
|
|
102
|
-
return createStore({
|
|
103
|
-
state() {
|
|
104
|
-
return {
|
|
105
|
-
items: {},
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
actions: {
|
|
109
|
-
fetchItem({ commit }, id) {
|
|
110
|
-
return fetchItem(id).then((item) => {
|
|
111
|
-
commit('setItem', { id, item })
|
|
112
|
-
})
|
|
82
|
+
store: {
|
|
83
|
+
get state() {
|
|
84
|
+
return pinia.state.value
|
|
113
85
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
setItem(state, { id, item }) {
|
|
117
|
-
state.items[id] = item
|
|
86
|
+
replaceState(state: Record<string, StateTree>) {
|
|
87
|
+
pinia.state.value = state
|
|
118
88
|
},
|
|
119
89
|
},
|
|
120
|
-
}
|
|
90
|
+
}
|
|
121
91
|
}
|
|
122
92
|
```
|
|
123
93
|
|
|
124
|
-
**pages/index/index.uvue**
|
|
125
|
-
|
|
126
|
-
```vue
|
|
127
|
-
<template>
|
|
128
|
-
<text v-if="item">{{ item.title }}</text>
|
|
129
|
-
<text v-else>...</text>
|
|
130
|
-
<text>{{ JSON.stringify(categories) }}</text>
|
|
131
|
-
</template>
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
|
|
135
94
|
#### page-meta
|
|
136
95
|
|
|
137
96
|
uni-app-x内page-meta仅保留了存放head的功能,page-meta内的head节点在最终渲染时会传送到html的head内,可用于存放keyword、description等信息
|
|
@@ -226,7 +185,7 @@ uni-app-x内page-meta仅保留了存放head的功能,page-meta内的head节点
|
|
|
226
185
|
|
|
227
186
|
### 注意事项
|
|
228
187
|
|
|
229
|
-
-
|
|
188
|
+
- 浏览器控制台提示如下警告,说明服务器和客户端渲染的结果不一致,检查模板绑定的状态是否通过 `ssrRef` 或上述 Pinia SSR 方式同步
|
|
230
189
|
|
|
231
190
|
```
|
|
232
191
|
[Vue warn]: Hydration node mismatch:
|