tmui-cli 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1160) hide show
  1. package/README.md +22 -14
  2. package/data/components.json +1 -1
  3. package/data/config.json +1 -1
  4. package/data/doc-index.json +1 -1
  5. package/data/tmui4x-doc-index.json +1 -1
  6. package/data/uni-app-x-docs/.vuepress/components/md/banner.vue +241 -0
  7. package/data/uni-app-x-docs/.vuepress/components/md/hperm.vue +59 -0
  8. package/data/uni-app-x-docs/.vuepress/components/md/virtual.vue +49 -0
  9. package/data/uni-app-x-docs/.vuepress/config/copy.js +7 -0
  10. package/data/uni-app-x-docs/.vuepress/config/footer.js +220 -0
  11. package/data/uni-app-x-docs/.vuepress/config/help.js +4 -0
  12. package/data/uni-app-x-docs/.vuepress/config/i18n/index.js +2 -0
  13. package/data/uni-app-x-docs/.vuepress/config/navbar.js +144 -0
  14. package/data/uni-app-x-docs/.vuepress/config/redirectRouter.js +35 -0
  15. package/data/uni-app-x-docs/.vuepress/config/routerMap.js +30 -0
  16. package/data/uni-app-x-docs/.vuepress/config/searchPage.js +53 -0
  17. package/data/uni-app-x-docs/.vuepress/config/siderbar/index.js +6 -0
  18. package/data/uni-app-x-docs/.vuepress/config/siderbar/uni-app-x.js +69 -0
  19. package/data/uni-app-x-docs/.vuepress/config/toc.js +13 -0
  20. package/data/uni-app-x-docs/.vuepress/config.js +130 -0
  21. package/data/uni-app-x-docs/.vuepress/markdown/inject-json-to-md.js +248 -0
  22. package/data/uni-app-x-docs/.vuepress/public/baidu.js +7 -0
  23. package/data/uni-app-x-docs/.vuepress/public/h5/hybrid/html/local.html +88 -0
  24. package/data/uni-app-x-docs/.vuepress/public/h5/index.html +14 -0
  25. package/data/uni-app-x-docs/.vuepress/public/h5/pcguide.html +241 -0
  26. package/data/uni-app-x-docs/.vuepress/public/h5/touch-emulator.js +363 -0
  27. package/data/uni-app-x-docs/.vuepress/public/js/miku.js +10 -0
  28. package/data/uni-app-x-docs/.vuepress/public/miku-delivery-1.2.1.js +7 -0
  29. package/data/uni-app-x-docs/.vuepress/public/miku-delivery-sw-1.2.1.js +7 -0
  30. package/data/uni-app-x-docs/.vuepress/public/pc.html +157 -0
  31. package/data/uni-app-x-docs/.vuepress/public/static/web-view-forum.html +119 -0
  32. package/data/uni-app-x-docs/.vuepress/public/static/web-view.html +119 -0
  33. package/data/uni-app-x-docs/.vuepress/public/svg/uni-open-bridge.svg +1 -0
  34. package/data/uni-app-x-docs/.vuepress/utils/code.js +61 -0
  35. package/data/uni-app-x-docs/.vuepress/utils/cssJson.json +1 -0
  36. package/data/uni-app-x-docs/.vuepress/utils/customTypeJson.json +1 -0
  37. package/data/uni-app-x-docs/.vuepress/utils/example-mapping.json +39 -0
  38. package/data/uni-app-x-docs/.vuepress/utils/example.js +107 -0
  39. package/data/uni-app-x-docs/.vuepress/utils/index.js +20 -0
  40. package/data/uni-app-x-docs/.vuepress/utils/maniFestJson.json +1 -0
  41. package/data/uni-app-x-docs/.vuepress/utils/pageInstanceJson.json +1 -0
  42. package/data/uni-app-x-docs/.vuepress/utils/pagesJson.json +1 -0
  43. package/data/uni-app-x-docs/.vuepress/utils/specialStringJson.json +1 -0
  44. package/data/uni-app-x-docs/.vuepress/utils/utsApiJson.json +1 -0
  45. package/data/uni-app-x-docs/.vuepress/utils/utsComJson.json +1 -0
  46. package/data/uni-app-x-docs/.vuepress/utils/utsDiffTSJson.json +1 -0
  47. package/data/uni-app-x-docs/.vuepress/utils/utsJson.json +1 -0
  48. package/data/uni-app-x-docs/.vuepress/utils/utsUnicloudApiJson.json +1 -0
  49. package/data/uni-app-x-docs/.vuepress/utils/vueJson.json +1 -0
  50. package/data/uni-app-x-docs/404.md +2 -0
  51. package/data/uni-app-x-docs/_sidebar.md +135 -0
  52. package/data/uni-app-x-docs/adapt.md +169 -0
  53. package/data/uni-app-x-docs/ai/NOTE.md +7 -0
  54. package/data/uni-app-x-docs/api/README.md +105 -0
  55. package/data/uni-app-x-docs/api/_sidebar.md +165 -0
  56. package/data/uni-app-x-docs/api/accelerometer.md +72 -0
  57. package/data/uni-app-x-docs/api/action-sheet.md +40 -0
  58. package/data/uni-app-x-docs/api/animation-frame.md +57 -0
  59. package/data/uni-app-x-docs/api/app-route.md +323 -0
  60. package/data/uni-app-x-docs/api/authentication.md +62 -0
  61. package/data/uni-app-x-docs/api/base64.md +33 -0
  62. package/data/uni-app-x-docs/api/bio-auth.md +5 -0
  63. package/data/uni-app-x-docs/api/calendar.md +40 -0
  64. package/data/uni-app-x-docs/api/canvas-get-image-data.md +5 -0
  65. package/data/uni-app-x-docs/api/canvas-put-image-data.md +5 -0
  66. package/data/uni-app-x-docs/api/canvas-to-temp-file-path.md +17 -0
  67. package/data/uni-app-x-docs/api/canvasrenderingcontext2d.md +673 -0
  68. package/data/uni-app-x-docs/api/capture-screen.md +55 -0
  69. package/data/uni-app-x-docs/api/capturescreen.md +5 -0
  70. package/data/uni-app-x-docs/api/choose-file.md +27 -0
  71. package/data/uni-app-x-docs/api/choose-image.md +40 -0
  72. package/data/uni-app-x-docs/api/choose-location.md +304 -0
  73. package/data/uni-app-x-docs/api/choose-media.md +29 -0
  74. package/data/uni-app-x-docs/api/choose-video.md +31 -0
  75. package/data/uni-app-x-docs/api/clipboard.md +44 -0
  76. package/data/uni-app-x-docs/api/compass.md +53 -0
  77. package/data/uni-app-x-docs/api/compress-image.md +25 -0
  78. package/data/uni-app-x-docs/api/compress-video.md +21 -0
  79. package/data/uni-app-x-docs/api/connect-event-source.md +34 -0
  80. package/data/uni-app-x-docs/api/contact.md +37 -0
  81. package/data/uni-app-x-docs/api/create-camera-context.md +27 -0
  82. package/data/uni-app-x-docs/api/create-canvas-context-async.md +36 -0
  83. package/data/uni-app-x-docs/api/create-editor-context-async.md +23 -0
  84. package/data/uni-app-x-docs/api/create-inner-audio-context.md +67 -0
  85. package/data/uni-app-x-docs/api/create-intersection-observer.md +17 -0
  86. package/data/uni-app-x-docs/api/create-interstitial-ad.md +43 -0
  87. package/data/uni-app-x-docs/api/create-live-player-context.md +26 -0
  88. package/data/uni-app-x-docs/api/create-live-pusher-context.md +26 -0
  89. package/data/uni-app-x-docs/api/create-map-context.md +13 -0
  90. package/data/uni-app-x-docs/api/create-request-permission-listener.md +37 -0
  91. package/data/uni-app-x-docs/api/create-rewarded-video-ad.md +58 -0
  92. package/data/uni-app-x-docs/api/create-selector-query.md +161 -0
  93. package/data/uni-app-x-docs/api/create-video-context.md +46 -0
  94. package/data/uni-app-x-docs/api/create-webview-context.md +66 -0
  95. package/data/uni-app-x-docs/api/create-worker.md +293 -0
  96. package/data/uni-app-x-docs/api/dialog-page.md +113 -0
  97. package/data/uni-app-x-docs/api/dom/README.md +520 -0
  98. package/data/uni-app-x-docs/api/dom/cssstyledeclaration.md +515 -0
  99. package/data/uni-app-x-docs/api/dom/domrect.md +11 -0
  100. package/data/uni-app-x-docs/api/dom/drawablecontext.md +212 -0
  101. package/data/uni-app-x-docs/api/dom/element.md +5 -0
  102. package/data/uni-app-x-docs/api/dom/unicanvaselement.md +101 -0
  103. package/data/uni-app-x-docs/api/dom/unielement.md +608 -0
  104. package/data/uni-app-x-docs/api/dom/uniimageelement.md +25 -0
  105. package/data/uni-app-x-docs/api/dom/uniinputelement.md +11 -0
  106. package/data/uni-app-x-docs/api/dom/uninativeviewelement.md +98 -0
  107. package/data/uni-app-x-docs/api/dom/uniresizeobserver.md +48 -0
  108. package/data/uni-app-x-docs/api/dom/unitextareaelement.md +11 -0
  109. package/data/uni-app-x-docs/api/dom/unitextelement.md +49 -0
  110. package/data/uni-app-x-docs/api/dom/univideoelement.md +108 -0
  111. package/data/uni-app-x-docs/api/dom/uniwebviewelement.md +97 -0
  112. package/data/uni-app-x-docs/api/download-file.md +52 -0
  113. package/data/uni-app-x-docs/api/env.md +19 -0
  114. package/data/uni-app-x-docs/api/event-bus.md +81 -0
  115. package/data/uni-app-x-docs/api/exit.md +63 -0
  116. package/data/uni-app-x-docs/api/ext.md +61 -0
  117. package/data/uni-app-x-docs/api/facial-recognition-meta-info.md +47 -0
  118. package/data/uni-app-x-docs/api/facial-recognition-verify.md +5 -0
  119. package/data/uni-app-x-docs/api/file-system-spec.md +224 -0
  120. package/data/uni-app-x-docs/api/get-accessibility-info.md +23 -0
  121. package/data/uni-app-x-docs/api/get-app-authorize-setting.md +29 -0
  122. package/data/uni-app-x-docs/api/get-app-base-info.md +32 -0
  123. package/data/uni-app-x-docs/api/get-app.md +28 -0
  124. package/data/uni-app-x-docs/api/get-background-audio-manager.md +54 -0
  125. package/data/uni-app-x-docs/api/get-battery-info.md +31 -0
  126. package/data/uni-app-x-docs/api/get-current-pages.md +39 -0
  127. package/data/uni-app-x-docs/api/get-device-info.md +35 -0
  128. package/data/uni-app-x-docs/api/get-element-by-id.md +55 -0
  129. package/data/uni-app-x-docs/api/get-element.md +5 -0
  130. package/data/uni-app-x-docs/api/get-file-system-manager.md +62 -0
  131. package/data/uni-app-x-docs/api/get-image-info.md +22 -0
  132. package/data/uni-app-x-docs/api/get-launch-options-sync.md +5 -0
  133. package/data/uni-app-x-docs/api/get-location.md +210 -0
  134. package/data/uni-app-x-docs/api/get-network-type.md +23 -0
  135. package/data/uni-app-x-docs/api/get-performance.md +17 -0
  136. package/data/uni-app-x-docs/api/get-provider.md +5 -0
  137. package/data/uni-app-x-docs/api/get-recorder-manager.md +51 -0
  138. package/data/uni-app-x-docs/api/get-system-info.md +100 -0
  139. package/data/uni-app-x-docs/api/get-system-setting.md +24 -0
  140. package/data/uni-app-x-docs/api/get-univerify-manager.md +306 -0
  141. package/data/uni-app-x-docs/api/get-video-info.md +21 -0
  142. package/data/uni-app-x-docs/api/get-window-info.md +55 -0
  143. package/data/uni-app-x-docs/api/gyroscope.md +80 -0
  144. package/data/uni-app-x-docs/api/image.md +32 -0
  145. package/data/uni-app-x-docs/api/install-apk.md +26 -0
  146. package/data/uni-app-x-docs/api/interceptor.md +35 -0
  147. package/data/uni-app-x-docs/api/is-simulator.md +29 -0
  148. package/data/uni-app-x-docs/api/keyboard.md +55 -0
  149. package/data/uni-app-x-docs/api/launch.md +43 -0
  150. package/data/uni-app-x-docs/api/load-font-face.md +46 -0
  151. package/data/uni-app-x-docs/api/loading.md +61 -0
  152. package/data/uni-app-x-docs/api/locale.md +43 -0
  153. package/data/uni-app-x-docs/api/location-change.md +123 -0
  154. package/data/uni-app-x-docs/api/make-phone-call.md +25 -0
  155. package/data/uni-app-x-docs/api/memory.md +29 -0
  156. package/data/uni-app-x-docs/api/modal.md +50 -0
  157. package/data/uni-app-x-docs/api/navigator-bar-loading.md +40 -0
  158. package/data/uni-app-x-docs/api/navigator.md +89 -0
  159. package/data/uni-app-x-docs/api/network-status-change.md +41 -0
  160. package/data/uni-app-x-docs/api/network-summarize.md +40 -0
  161. package/data/uni-app-x-docs/api/nodes-info.md +5 -0
  162. package/data/uni-app-x-docs/api/on-tab-bar-mid-button-tap.md +20 -0
  163. package/data/uni-app-x-docs/api/open-app-authorize-setting.md +23 -0
  164. package/data/uni-app-x-docs/api/open-document.md +21 -0
  165. package/data/uni-app-x-docs/api/open-location.md +22 -0
  166. package/data/uni-app-x-docs/api/page-scroll-to.md +57 -0
  167. package/data/uni-app-x-docs/api/path2d.md +160 -0
  168. package/data/uni-app-x-docs/api/preview-image.md +44 -0
  169. package/data/uni-app-x-docs/api/privacy.md +84 -0
  170. package/data/uni-app-x-docs/api/provider.md +123 -0
  171. package/data/uni-app-x-docs/api/pull-down-refresh.md +46 -0
  172. package/data/uni-app-x-docs/api/push.md +1 -0
  173. package/data/uni-app-x-docs/api/report.md +44 -0
  174. package/data/uni-app-x-docs/api/request-merchant-transfer.md +31 -0
  175. package/data/uni-app-x-docs/api/request-payment.md +212 -0
  176. package/data/uni-app-x-docs/api/request-system-permission.md +21 -0
  177. package/data/uni-app-x-docs/api/request.md +72 -0
  178. package/data/uni-app-x-docs/api/rpx2px.md +19 -0
  179. package/data/uni-app-x-docs/api/save-image-to-photos-album.md +19 -0
  180. package/data/uni-app-x-docs/api/save-video-to-photos-album.md +17 -0
  181. package/data/uni-app-x-docs/api/scan-code.md +39 -0
  182. package/data/uni-app-x-docs/api/screen-brightness.md +53 -0
  183. package/data/uni-app-x-docs/api/set-navigation-bar-color.md +27 -0
  184. package/data/uni-app-x-docs/api/set-navigation-bar-title.md +22 -0
  185. package/data/uni-app-x-docs/api/set-tab-bar.md +121 -0
  186. package/data/uni-app-x-docs/api/set-tabbar.md +5 -0
  187. package/data/uni-app-x-docs/api/share-with-system.md +27 -0
  188. package/data/uni-app-x-docs/api/share.md +128 -0
  189. package/data/uni-app-x-docs/api/show-action-sheet.md +5 -0
  190. package/data/uni-app-x-docs/api/show-loading.md +5 -0
  191. package/data/uni-app-x-docs/api/show-modal.md +5 -0
  192. package/data/uni-app-x-docs/api/show-toast.md +5 -0
  193. package/data/uni-app-x-docs/api/sign-in.md +141 -0
  194. package/data/uni-app-x-docs/api/storage.md +347 -0
  195. package/data/uni-app-x-docs/api/theme-change.md +477 -0
  196. package/data/uni-app-x-docs/api/theme.md +5 -0
  197. package/data/uni-app-x-docs/api/toast.md +62 -0
  198. package/data/uni-app-x-docs/api/uni-push.md +251 -0
  199. package/data/uni-app-x-docs/api/unicloud/README.md +25 -0
  200. package/data/uni-app-x-docs/api/unicloud/database.md +27 -0
  201. package/data/uni-app-x-docs/api/unicloud/function.md +58 -0
  202. package/data/uni-app-x-docs/api/unicloud/object.md +75 -0
  203. package/data/uni-app-x-docs/api/unicloud/sse-channel.md +103 -0
  204. package/data/uni-app-x-docs/api/unicloud/storage.md +46 -0
  205. package/data/uni-app-x-docs/api/unicloud/utils.md +71 -0
  206. package/data/uni-app-x-docs/api/unipage.md +389 -0
  207. package/data/uni-app-x-docs/api/upload-file.md +40 -0
  208. package/data/uni-app-x-docs/api/vibrate.md +37 -0
  209. package/data/uni-app-x-docs/api/virtual-payment.md +228 -0
  210. package/data/uni-app-x-docs/api/websocket-global.md +5 -0
  211. package/data/uni-app-x-docs/api/websocket.md +116 -0
  212. package/data/uni-app-x-docs/api/wide-screen-adaptation.md +197 -0
  213. package/data/uni-app-x-docs/api/wifi.md +135 -0
  214. package/data/uni-app-x-docs/api/window.md +37 -0
  215. package/data/uni-app-x-docs/app-harmony/README.md +75 -0
  216. package/data/uni-app-x-docs/app-harmony/harmony-vapor.md +5 -0
  217. package/data/uni-app-x-docs/app-vapor.md +599 -0
  218. package/data/uni-app-x-docs/benchmark/vapor-benchmark-android.md +488 -0
  219. package/data/uni-app-x-docs/benchmark/vapor-benchmark-harmony.md +312 -0
  220. package/data/uni-app-x-docs/benchmark/vapor-benchmark-ios.md +375 -0
  221. package/data/uni-app-x-docs/collocation/_sidebar.md +15 -0
  222. package/data/uni-app-x-docs/collocation/app.md +263 -0
  223. package/data/uni-app-x-docs/collocation/manifest-android.md +1321 -0
  224. package/data/uni-app-x-docs/collocation/manifest-harmony.md +152 -0
  225. package/data/uni-app-x-docs/collocation/manifest-ios.md +731 -0
  226. package/data/uni-app-x-docs/collocation/manifest-modules.md +521 -0
  227. package/data/uni-app-x-docs/collocation/manifest-splashscreen.md +232 -0
  228. package/data/uni-app-x-docs/collocation/manifest.md +591 -0
  229. package/data/uni-app-x-docs/collocation/pagesjson.md +462 -0
  230. package/data/uni-app-x-docs/collocation/themejson.md +177 -0
  231. package/data/uni-app-x-docs/compiler/README.md +125 -0
  232. package/data/uni-app-x-docs/compiler/_sidebar.md +4 -0
  233. package/data/uni-app-x-docs/component/README.md +228 -0
  234. package/data/uni-app-x-docs/component/_sidebar.md +118 -0
  235. package/data/uni-app-x-docs/component/ad-custom.md +19 -0
  236. package/data/uni-app-x-docs/component/ad.md +45 -0
  237. package/data/uni-app-x-docs/component/animation-view.md +19 -0
  238. package/data/uni-app-x-docs/component/aria-component.md +19 -0
  239. package/data/uni-app-x-docs/component/audio.md +7 -0
  240. package/data/uni-app-x-docs/component/block.md +21 -0
  241. package/data/uni-app-x-docs/component/button.md +105 -0
  242. package/data/uni-app-x-docs/component/camera.md +54 -0
  243. package/data/uni-app-x-docs/component/canvas.md +163 -0
  244. package/data/uni-app-x-docs/component/channel-live.md +19 -0
  245. package/data/uni-app-x-docs/component/channel-video.md +19 -0
  246. package/data/uni-app-x-docs/component/checkbox-group.md +21 -0
  247. package/data/uni-app-x-docs/component/checkbox.md +27 -0
  248. package/data/uni-app-x-docs/component/common.md +304 -0
  249. package/data/uni-app-x-docs/component/cover-image.md +25 -0
  250. package/data/uni-app-x-docs/component/cover-view.md +25 -0
  251. package/data/uni-app-x-docs/component/custom-tab-bar.md +19 -0
  252. package/data/uni-app-x-docs/component/double-tap-gesture-handler.md +19 -0
  253. package/data/uni-app-x-docs/component/draggable-sheet.md +19 -0
  254. package/data/uni-app-x-docs/component/editor.md +33 -0
  255. package/data/uni-app-x-docs/component/flow-item.md +5 -0
  256. package/data/uni-app-x-docs/component/force-press-gesture-handler.md +19 -0
  257. package/data/uni-app-x-docs/component/form.md +108 -0
  258. package/data/uni-app-x-docs/component/functional-page-navigator.md +19 -0
  259. package/data/uni-app-x-docs/component/glass-effect-view.md +32 -0
  260. package/data/uni-app-x-docs/component/grid-builder.md +19 -0
  261. package/data/uni-app-x-docs/component/grid-view.md +19 -0
  262. package/data/uni-app-x-docs/component/horizontal-drag-gesture-handler.md +19 -0
  263. package/data/uni-app-x-docs/component/icon.md +19 -0
  264. package/data/uni-app-x-docs/component/image.md +79 -0
  265. package/data/uni-app-x-docs/component/input.md +121 -0
  266. package/data/uni-app-x-docs/component/keyboard-accessory.md +19 -0
  267. package/data/uni-app-x-docs/component/label.md +21 -0
  268. package/data/uni-app-x-docs/component/list-builder.md +19 -0
  269. package/data/uni-app-x-docs/component/list-item.md +1 -0
  270. package/data/uni-app-x-docs/component/list-view.md +191 -0
  271. package/data/uni-app-x-docs/component/live-player.md +29 -0
  272. package/data/uni-app-x-docs/component/live-pusher.md +31 -0
  273. package/data/uni-app-x-docs/component/loading.md +31 -0
  274. package/data/uni-app-x-docs/component/long-press-gesture-handler.md +19 -0
  275. package/data/uni-app-x-docs/component/map.md +114 -0
  276. package/data/uni-app-x-docs/component/match-media.md +21 -0
  277. package/data/uni-app-x-docs/component/movable-area.md +27 -0
  278. package/data/uni-app-x-docs/component/movable-view.md +27 -0
  279. package/data/uni-app-x-docs/component/native-component.md +19 -0
  280. package/data/uni-app-x-docs/component/native-view.md +210 -0
  281. package/data/uni-app-x-docs/component/navigation-bar.md +19 -0
  282. package/data/uni-app-x-docs/component/navigator.md +22 -0
  283. package/data/uni-app-x-docs/component/nested-scroll-body.md +32 -0
  284. package/data/uni-app-x-docs/component/nested-scroll-header.md +32 -0
  285. package/data/uni-app-x-docs/component/nested-scroll.md +8 -0
  286. package/data/uni-app-x-docs/component/official-account.md +19 -0
  287. package/data/uni-app-x-docs/component/open-container.md +19 -0
  288. package/data/uni-app-x-docs/component/page-container.md +37 -0
  289. package/data/uni-app-x-docs/component/page-meta.md +19 -0
  290. package/data/uni-app-x-docs/component/pan-gesture-handler.md +19 -0
  291. package/data/uni-app-x-docs/component/picker-view-column.md +5 -0
  292. package/data/uni-app-x-docs/component/picker-view.md +48 -0
  293. package/data/uni-app-x-docs/component/picker.md +29 -0
  294. package/data/uni-app-x-docs/component/progress.md +19 -0
  295. package/data/uni-app-x-docs/component/radio-group.md +21 -0
  296. package/data/uni-app-x-docs/component/radio.md +27 -0
  297. package/data/uni-app-x-docs/component/rich-text.md +108 -0
  298. package/data/uni-app-x-docs/component/root-portal.md +19 -0
  299. package/data/uni-app-x-docs/component/scale-gesture-handler.md +19 -0
  300. package/data/uni-app-x-docs/component/scroll-view.md +213 -0
  301. package/data/uni-app-x-docs/component/share-element.md +84 -0
  302. package/data/uni-app-x-docs/component/slider.md +44 -0
  303. package/data/uni-app-x-docs/component/snapshot.md +19 -0
  304. package/data/uni-app-x-docs/component/span.md +19 -0
  305. package/data/uni-app-x-docs/component/sticky-header.md +50 -0
  306. package/data/uni-app-x-docs/component/sticky-section.md +54 -0
  307. package/data/uni-app-x-docs/component/sticky.md +8 -0
  308. package/data/uni-app-x-docs/component/store-home.md +19 -0
  309. package/data/uni-app-x-docs/component/store-product.md +19 -0
  310. package/data/uni-app-x-docs/component/swiper-item.md +5 -0
  311. package/data/uni-app-x-docs/component/swiper.md +94 -0
  312. package/data/uni-app-x-docs/component/switch.md +28 -0
  313. package/data/uni-app-x-docs/component/tap-gesture-handler.md +19 -0
  314. package/data/uni-app-x-docs/component/text.md +242 -0
  315. package/data/uni-app-x-docs/component/textarea.md +90 -0
  316. package/data/uni-app-x-docs/component/uni-ui-x/README.md +1 -0
  317. package/data/uni-app-x-docs/component/uni-ui-x/uni-badge-view.md +25 -0
  318. package/data/uni-app-x-docs/component/uni-ui-x/uni-collapse-item.md +5 -0
  319. package/data/uni-app-x-docs/component/uni-ui-x/uni-collapse.md +48 -0
  320. package/data/uni-app-x-docs/component/uni-ui-x/uni-drag-cell.md +25 -0
  321. package/data/uni-app-x-docs/component/uni-ui-x/uni-fab-button.md +25 -0
  322. package/data/uni-app-x-docs/component/uni-ui-x/uni-index-bar.md +25 -0
  323. package/data/uni-app-x-docs/component/uni-ui-x/uni-link.md +25 -0
  324. package/data/uni-app-x-docs/component/uni-ui-x/uni-nav-bar.md +25 -0
  325. package/data/uni-app-x-docs/component/uni-ui-x/uni-number-box.md +25 -0
  326. package/data/uni-app-x-docs/component/uni-ui-x/uni-rate.md +25 -0
  327. package/data/uni-app-x-docs/component/uni-ui-x/uni-refresh-box.md +25 -0
  328. package/data/uni-app-x-docs/component/uni-ui-x/uni-tab-bar.md +5 -0
  329. package/data/uni-app-x-docs/component/uni-ui-x/uni-tab-content.md +5 -0
  330. package/data/uni-app-x-docs/component/uni-ui-x/uni-tab-item.md +5 -0
  331. package/data/uni-app-x-docs/component/uni-ui-x/uni-tab-midbutton.md +5 -0
  332. package/data/uni-app-x-docs/component/uni-ui-x/uni-tab.md +111 -0
  333. package/data/uni-app-x-docs/component/uni-ui-x/uni-time-format.md +25 -0
  334. package/data/uni-app-x-docs/component/unicloud-db.md +19 -0
  335. package/data/uni-app-x-docs/component/vertical-drag-gesture-handler.md +19 -0
  336. package/data/uni-app-x-docs/component/video.md +135 -0
  337. package/data/uni-app-x-docs/component/view.md +86 -0
  338. package/data/uni-app-x-docs/component/voip-room.md +19 -0
  339. package/data/uni-app-x-docs/component/waterflow.md +122 -0
  340. package/data/uni-app-x-docs/component/web-view.md +160 -0
  341. package/data/uni-app-x-docs/css/README.md +274 -0
  342. package/data/uni-app-x-docs/css/_sidebar.md +104 -0
  343. package/data/uni-app-x-docs/css/align-content.md +22 -0
  344. package/data/uni-app-x-docs/css/align-items.md +20 -0
  345. package/data/uni-app-x-docs/css/align-self.md +20 -0
  346. package/data/uni-app-x-docs/css/animation-composition.md +18 -0
  347. package/data/uni-app-x-docs/css/animation-delay.md +18 -0
  348. package/data/uni-app-x-docs/css/animation-direction.md +18 -0
  349. package/data/uni-app-x-docs/css/animation-duration.md +18 -0
  350. package/data/uni-app-x-docs/css/animation-fill-mode.md +18 -0
  351. package/data/uni-app-x-docs/css/animation-iteration-count.md +18 -0
  352. package/data/uni-app-x-docs/css/animation-name.md +18 -0
  353. package/data/uni-app-x-docs/css/animation-play-state.md +18 -0
  354. package/data/uni-app-x-docs/css/animation-range-end.md +18 -0
  355. package/data/uni-app-x-docs/css/animation-range-start.md +18 -0
  356. package/data/uni-app-x-docs/css/animation-range.md +18 -0
  357. package/data/uni-app-x-docs/css/animation-timeline.md +18 -0
  358. package/data/uni-app-x-docs/css/animation-timing-function.md +18 -0
  359. package/data/uni-app-x-docs/css/animation.md +18 -0
  360. package/data/uni-app-x-docs/css/backdrop-filter.md +21 -0
  361. package/data/uni-app-x-docs/css/background-clip.md +20 -0
  362. package/data/uni-app-x-docs/css/background-color.md +25 -0
  363. package/data/uni-app-x-docs/css/background-image.md +48 -0
  364. package/data/uni-app-x-docs/css/background.md +20 -0
  365. package/data/uni-app-x-docs/css/border-bottom-color.md +20 -0
  366. package/data/uni-app-x-docs/css/border-bottom-left-radius.md +23 -0
  367. package/data/uni-app-x-docs/css/border-bottom-right-radius.md +23 -0
  368. package/data/uni-app-x-docs/css/border-bottom-style.md +20 -0
  369. package/data/uni-app-x-docs/css/border-bottom-width.md +27 -0
  370. package/data/uni-app-x-docs/css/border-bottom.md +20 -0
  371. package/data/uni-app-x-docs/css/border-color.md +20 -0
  372. package/data/uni-app-x-docs/css/border-left-color.md +20 -0
  373. package/data/uni-app-x-docs/css/border-left-style.md +20 -0
  374. package/data/uni-app-x-docs/css/border-left-width.md +27 -0
  375. package/data/uni-app-x-docs/css/border-left.md +20 -0
  376. package/data/uni-app-x-docs/css/border-radius.md +27 -0
  377. package/data/uni-app-x-docs/css/border-right-color.md +20 -0
  378. package/data/uni-app-x-docs/css/border-right-style.md +20 -0
  379. package/data/uni-app-x-docs/css/border-right-width.md +27 -0
  380. package/data/uni-app-x-docs/css/border-right.md +20 -0
  381. package/data/uni-app-x-docs/css/border-style.md +24 -0
  382. package/data/uni-app-x-docs/css/border-top-color.md +20 -0
  383. package/data/uni-app-x-docs/css/border-top-left-radius.md +23 -0
  384. package/data/uni-app-x-docs/css/border-top-right-radius.md +23 -0
  385. package/data/uni-app-x-docs/css/border-top-style.md +20 -0
  386. package/data/uni-app-x-docs/css/border-top-width.md +27 -0
  387. package/data/uni-app-x-docs/css/border-top.md +20 -0
  388. package/data/uni-app-x-docs/css/border-width.md +24 -0
  389. package/data/uni-app-x-docs/css/border.md +23 -0
  390. package/data/uni-app-x-docs/css/bottom.md +20 -0
  391. package/data/uni-app-x-docs/css/box-shadow.md +26 -0
  392. package/data/uni-app-x-docs/css/box-sizing.md +20 -0
  393. package/data/uni-app-x-docs/css/color.md +27 -0
  394. package/data/uni-app-x-docs/css/common/at-rules.md +293 -0
  395. package/data/uni-app-x-docs/css/common/color.md +9 -0
  396. package/data/uni-app-x-docs/css/common/function.md +161 -0
  397. package/data/uni-app-x-docs/css/common/length.md +89 -0
  398. package/data/uni-app-x-docs/css/common/selector.md +48 -0
  399. package/data/uni-app-x-docs/css/common/style-isolation.md +258 -0
  400. package/data/uni-app-x-docs/css/common/variable.md +1 -0
  401. package/data/uni-app-x-docs/css/css_diff_web.md +802 -0
  402. package/data/uni-app-x-docs/css/direction.md +18 -0
  403. package/data/uni-app-x-docs/css/display.md +23 -0
  404. package/data/uni-app-x-docs/css/flex-basis.md +20 -0
  405. package/data/uni-app-x-docs/css/flex-direction.md +20 -0
  406. package/data/uni-app-x-docs/css/flex-flow.md +20 -0
  407. package/data/uni-app-x-docs/css/flex-grow.md +20 -0
  408. package/data/uni-app-x-docs/css/flex-shrink.md +20 -0
  409. package/data/uni-app-x-docs/css/flex-wrap.md +20 -0
  410. package/data/uni-app-x-docs/css/flex.md +20 -0
  411. package/data/uni-app-x-docs/css/font-family.md +50 -0
  412. package/data/uni-app-x-docs/css/font-size.md +51 -0
  413. package/data/uni-app-x-docs/css/font-style.md +23 -0
  414. package/data/uni-app-x-docs/css/font-weight.md +24 -0
  415. package/data/uni-app-x-docs/css/height.md +23 -0
  416. package/data/uni-app-x-docs/css/justify-content.md +20 -0
  417. package/data/uni-app-x-docs/css/left.md +20 -0
  418. package/data/uni-app-x-docs/css/letter-spacing.md +20 -0
  419. package/data/uni-app-x-docs/css/line-height.md +37 -0
  420. package/data/uni-app-x-docs/css/lines.md +23 -0
  421. package/data/uni-app-x-docs/css/margin-bottom.md +25 -0
  422. package/data/uni-app-x-docs/css/margin-left.md +25 -0
  423. package/data/uni-app-x-docs/css/margin-right.md +25 -0
  424. package/data/uni-app-x-docs/css/margin-top.md +25 -0
  425. package/data/uni-app-x-docs/css/margin.md +33 -0
  426. package/data/uni-app-x-docs/css/max-height.md +20 -0
  427. package/data/uni-app-x-docs/css/max-width.md +20 -0
  428. package/data/uni-app-x-docs/css/min-height.md +27 -0
  429. package/data/uni-app-x-docs/css/min-width.md +20 -0
  430. package/data/uni-app-x-docs/css/opacity.md +20 -0
  431. package/data/uni-app-x-docs/css/overflow.md +28 -0
  432. package/data/uni-app-x-docs/css/padding-bottom.md +23 -0
  433. package/data/uni-app-x-docs/css/padding-left.md +23 -0
  434. package/data/uni-app-x-docs/css/padding-right.md +23 -0
  435. package/data/uni-app-x-docs/css/padding-top.md +23 -0
  436. package/data/uni-app-x-docs/css/padding.md +23 -0
  437. package/data/uni-app-x-docs/css/pointer-events.md +26 -0
  438. package/data/uni-app-x-docs/css/position.md +50 -0
  439. package/data/uni-app-x-docs/css/right.md +20 -0
  440. package/data/uni-app-x-docs/css/text-align.md +23 -0
  441. package/data/uni-app-x-docs/css/text-decoration-color.md +25 -0
  442. package/data/uni-app-x-docs/css/text-decoration-line.md +24 -0
  443. package/data/uni-app-x-docs/css/text-decoration-style.md +23 -0
  444. package/data/uni-app-x-docs/css/text-decoration-thickness.md +23 -0
  445. package/data/uni-app-x-docs/css/text-decoration.md +24 -0
  446. package/data/uni-app-x-docs/css/text-overflow.md +24 -0
  447. package/data/uni-app-x-docs/css/text-shadow.md +22 -0
  448. package/data/uni-app-x-docs/css/top.md +20 -0
  449. package/data/uni-app-x-docs/css/transform-origin.md +20 -0
  450. package/data/uni-app-x-docs/css/transform.md +32 -0
  451. package/data/uni-app-x-docs/css/transition-delay.md +27 -0
  452. package/data/uni-app-x-docs/css/transition-duration.md +27 -0
  453. package/data/uni-app-x-docs/css/transition-property.md +23 -0
  454. package/data/uni-app-x-docs/css/transition-timing-function.md +23 -0
  455. package/data/uni-app-x-docs/css/transition.md +43 -0
  456. package/data/uni-app-x-docs/css/visibility.md +26 -0
  457. package/data/uni-app-x-docs/css/white-space.md +49 -0
  458. package/data/uni-app-x-docs/css/width.md +23 -0
  459. package/data/uni-app-x-docs/css/z-index.md +127 -0
  460. package/data/uni-app-x-docs/debug/android-inspector.md +55 -0
  461. package/data/uni-app-x-docs/i18n.md +379 -0
  462. package/data/uni-app-x-docs/mp/README.md +159 -0
  463. package/data/uni-app-x-docs/native/README.md +67 -0
  464. package/data/uni-app-x-docs/native/debug/android.md +126 -0
  465. package/data/uni-app-x-docs/native/debug/harmony.md +119 -0
  466. package/data/uni-app-x-docs/native/debug/ios.md +92 -0
  467. package/data/uni-app-x-docs/native/download/android.md +45 -0
  468. package/data/uni-app-x-docs/native/download/ios.md +30 -0
  469. package/data/uni-app-x-docs/native/modules/android/others.md +1441 -0
  470. package/data/uni-app-x-docs/native/modules/android/uni-ad.md +104 -0
  471. package/data/uni-app-x-docs/native/modules/android/uni-facialRecognitionVerify.md +74 -0
  472. package/data/uni-app-x-docs/native/modules/android/uni-getLocation.md +131 -0
  473. package/data/uni-app-x-docs/native/modules/android/uni-map-tencent.md +101 -0
  474. package/data/uni-app-x-docs/native/modules/android/uni-oauth.md +61 -0
  475. package/data/uni-app-x-docs/native/modules/android/uni-payment.md +120 -0
  476. package/data/uni-app-x-docs/native/modules/android/uni-push.md +229 -0
  477. package/data/uni-app-x-docs/native/modules/android/uni-share.md +61 -0
  478. package/data/uni-app-x-docs/native/modules/android/uni-verify.md +105 -0
  479. package/data/uni-app-x-docs/native/modules/android/uni-video.md +135 -0
  480. package/data/uni-app-x-docs/native/modules/harmony/facialVerify.md +47 -0
  481. package/data/uni-app-x-docs/native/modules/harmony/location.md +43 -0
  482. package/data/uni-app-x-docs/native/modules/harmony/map.md +64 -0
  483. package/data/uni-app-x-docs/native/modules/harmony/modules.md +23 -0
  484. package/data/uni-app-x-docs/native/modules/harmony/oauth.md +47 -0
  485. package/data/uni-app-x-docs/native/modules/harmony/pay.md +87 -0
  486. package/data/uni-app-x-docs/native/modules/harmony/push.md +74 -0
  487. package/data/uni-app-x-docs/native/modules/harmony/verify.md +45 -0
  488. package/data/uni-app-x-docs/native/modules/ios/modules.md +962 -0
  489. package/data/uni-app-x-docs/native/permission/android_permission_adapter.md +63 -0
  490. package/data/uni-app-x-docs/native/use/android.md +541 -0
  491. package/data/uni-app-x-docs/native/use/androidcomm.md +164 -0
  492. package/data/uni-app-x-docs/native/use/androiduts.md +398 -0
  493. package/data/uni-app-x-docs/native/use/harmony.md +105 -0
  494. package/data/uni-app-x-docs/native/use/harmonyapi.md +205 -0
  495. package/data/uni-app-x-docs/native/use/harmonyuts.md +62 -0
  496. package/data/uni-app-x-docs/native/use/ios.md +96 -0
  497. package/data/uni-app-x-docs/native/use/iosapi.md +290 -0
  498. package/data/uni-app-x-docs/native/use/iosuts.md +89 -0
  499. package/data/uni-app-x-docs/page.md +501 -0
  500. package/data/uni-app-x-docs/performance.md +181 -0
  501. package/data/uni-app-x-docs/plugin/NOTE.md +7 -0
  502. package/data/uni-app-x-docs/project.md +154 -0
  503. package/data/uni-app-x-docs/readme.md +401 -0
  504. package/data/uni-app-x-docs/release-note-alpha.md +2219 -0
  505. package/data/uni-app-x-docs/release.md +1961 -0
  506. package/data/uni-app-x-docs/sample.md +157 -0
  507. package/data/uni-app-x-docs/select.md +365 -0
  508. package/data/uni-app-x-docs/static/4050-hello-flatten-optimized-device1-r1.png +0 -0
  509. package/data/uni-app-x-docs/static/calendar.jpg +0 -0
  510. package/data/uni-app-x-docs/static/go-to-definition.png +0 -0
  511. package/data/uni-app-x-docs/static/hxconsolepageperformance.png +0 -0
  512. package/data/uni-app-x-docs/static/json2type.png +0 -0
  513. package/data/uni-app-x-docs/static/newproject.png +0 -0
  514. package/data/uni-app-x-docs/static/playground.jpg +0 -0
  515. package/data/uni-app-x-docs/static/project-icon.png +0 -0
  516. package/data/uni-app-x-docs/static/uaxding.png +0 -0
  517. package/data/uni-app-x-docs/static/view-API-type-info.png +0 -0
  518. package/data/uni-app-x-docs/tutorial/android-16kb.md +96 -0
  519. package/data/uni-app-x-docs/tutorial/android-memoryleak.md +553 -0
  520. package/data/uni-app-x-docs/tutorial/app-env.md +84 -0
  521. package/data/uni-app-x-docs/tutorial/app-market.md +58 -0
  522. package/data/uni-app-x-docs/tutorial/app-package.md +196 -0
  523. package/data/uni-app-x-docs/tutorial/app-playground.md +188 -0
  524. package/data/uni-app-x-docs/tutorial/bug_repair.md +40 -0
  525. package/data/uni-app-x-docs/tutorial/codegap.md +291 -0
  526. package/data/uni-app-x-docs/tutorial/compatibility.md +120 -0
  527. package/data/uni-app-x-docs/tutorial/compliance.md +833 -0
  528. package/data/uni-app-x-docs/tutorial/debug/devtools.md +137 -0
  529. package/data/uni-app-x-docs/tutorial/idref.md +126 -0
  530. package/data/uni-app-x-docs/tutorial/ls-plugin.md +186 -0
  531. package/data/uni-app-x-docs/tutorial/request.md +321 -0
  532. package/data/uni-app-x-docs/tutorial/rules_mcp.md +123 -0
  533. package/data/uni-app-x-docs/tutorial/stickynestlist.md +68 -0
  534. package/data/uni-app-x-docs/tutorial/store.md +162 -0
  535. package/data/uni-app-x-docs/uniapptox.md +145 -0
  536. package/data/uni-app-x-docs/uts/README.md +456 -0
  537. package/data/uni-app-x-docs/uts/_sidebar.md +57 -0
  538. package/data/uni-app-x-docs/uts/buildin-object-api/array.md +981 -0
  539. package/data/uni-app-x-docs/uts/buildin-object-api/arraybuffer.md +257 -0
  540. package/data/uni-app-x-docs/uts/buildin-object-api/console.md +208 -0
  541. package/data/uni-app-x-docs/uts/buildin-object-api/dataview.md +304 -0
  542. package/data/uni-app-x-docs/uts/buildin-object-api/date.md +707 -0
  543. package/data/uni-app-x-docs/uts/buildin-object-api/error.md +31 -0
  544. package/data/uni-app-x-docs/uts/buildin-object-api/float32array.md +485 -0
  545. package/data/uni-app-x-docs/uts/buildin-object-api/float64array.md +473 -0
  546. package/data/uni-app-x-docs/uts/buildin-object-api/global.md +222 -0
  547. package/data/uni-app-x-docs/uts/buildin-object-api/int16array.md +455 -0
  548. package/data/uni-app-x-docs/uts/buildin-object-api/int32array.md +483 -0
  549. package/data/uni-app-x-docs/uts/buildin-object-api/int8array.md +473 -0
  550. package/data/uni-app-x-docs/uts/buildin-object-api/json.md +236 -0
  551. package/data/uni-app-x-docs/uts/buildin-object-api/map.md +187 -0
  552. package/data/uni-app-x-docs/uts/buildin-object-api/math.md +502 -0
  553. package/data/uni-app-x-docs/uts/buildin-object-api/number.md +363 -0
  554. package/data/uni-app-x-docs/uts/buildin-object-api/promise.md +265 -0
  555. package/data/uni-app-x-docs/uts/buildin-object-api/regexp.md +263 -0
  556. package/data/uni-app-x-docs/uts/buildin-object-api/set.md +170 -0
  557. package/data/uni-app-x-docs/uts/buildin-object-api/string.md +723 -0
  558. package/data/uni-app-x-docs/uts/buildin-object-api/textdecoder.md +70 -0
  559. package/data/uni-app-x-docs/uts/buildin-object-api/textencoder.md +41 -0
  560. package/data/uni-app-x-docs/uts/buildin-object-api/timers.md +99 -0
  561. package/data/uni-app-x-docs/uts/buildin-object-api/uint16array.md +483 -0
  562. package/data/uni-app-x-docs/uts/buildin-object-api/uint32array.md +484 -0
  563. package/data/uni-app-x-docs/uts/buildin-object-api/uint8array.md +483 -0
  564. package/data/uni-app-x-docs/uts/buildin-object-api/uint8clampedarray.md +483 -0
  565. package/data/uni-app-x-docs/uts/buildin-object-api/utsjsonobject.md +361 -0
  566. package/data/uni-app-x-docs/uts/class.md +504 -0
  567. package/data/uni-app-x-docs/uts/compiler-known-issues.md +1242 -0
  568. package/data/uni-app-x-docs/uts/conditional.md +209 -0
  569. package/data/uni-app-x-docs/uts/data-type.md +2248 -0
  570. package/data/uni-app-x-docs/uts/enumerability.md +16 -0
  571. package/data/uni-app-x-docs/uts/enumerability_iterable.md +211 -0
  572. package/data/uni-app-x-docs/uts/exception.md +25 -0
  573. package/data/uni-app-x-docs/uts/function.md +359 -0
  574. package/data/uni-app-x-docs/uts/generics.md +251 -0
  575. package/data/uni-app-x-docs/uts/interface.md +37 -0
  576. package/data/uni-app-x-docs/uts/iterable.md +150 -0
  577. package/data/uni-app-x-docs/uts/keywords.md +436 -0
  578. package/data/uni-app-x-docs/uts/literal.md +252 -0
  579. package/data/uni-app-x-docs/uts/loops.md +240 -0
  580. package/data/uni-app-x-docs/uts/module.md +92 -0
  581. package/data/uni-app-x-docs/uts/object.md +156 -0
  582. package/data/uni-app-x-docs/uts/operator.md +304 -0
  583. package/data/uni-app-x-docs/uts/runtime-known-issues.md +99 -0
  584. package/data/uni-app-x-docs/uts/type-aliases.md +43 -0
  585. package/data/uni-app-x-docs/uts/type-compatibility.md +133 -0
  586. package/data/uni-app-x-docs/uts/uts-optimize.md +33 -0
  587. package/data/uni-app-x-docs/uts/uts_diff_ts.md +2292 -0
  588. package/data/uni-app-x-docs/uts/utsactivitycallback.md +1357 -0
  589. package/data/uni-app-x-docs/uts/utsandroid.md +850 -0
  590. package/data/uni-app-x-docs/uts/utsandroidhookproxy.md +17 -0
  591. package/data/uni-app-x-docs/uts/utsharmony.md +219 -0
  592. package/data/uni-app-x-docs/uts/utsios.md +305 -0
  593. package/data/uni-app-x-docs/uts/utsioshookproxy.md +148 -0
  594. package/data/uni-app-x-docs/vapor-benchmark.md +11 -0
  595. package/data/uni-app-x-docs/vue/README.md +553 -0
  596. package/data/uni-app-x-docs/vue/_sidebar.md +10 -0
  597. package/data/uni-app-x-docs/vue/advanced-api.md +138 -0
  598. package/data/uni-app-x-docs/vue/built-in.md +741 -0
  599. package/data/uni-app-x-docs/vue/component.md +704 -0
  600. package/data/uni-app-x-docs/vue/composition-api.md +792 -0
  601. package/data/uni-app-x-docs/vue/data-bind.md +163 -0
  602. package/data/uni-app-x-docs/vue/global-api.md +109 -0
  603. package/data/uni-app-x-docs/vue/modifier.md +202 -0
  604. package/data/uni-app-x-docs/vue/options-api.md +512 -0
  605. package/data/uni-app-x-docs/vue/others.md +20 -0
  606. package/data/uni-app-x-docs/web/README.md +279 -0
  607. package/data/uni-app-x-docs/web/ssr.md +290 -0
  608. package/data/uni-app-x-docs/worktile/NOTE.md +7 -0
  609. package/data/uniappx/404.md +2 -0
  610. package/data/uniappx/_sidebar.md +135 -0
  611. package/data/uniappx/adapt.md +165 -0
  612. package/data/uniappx/ai/NOTE.md +5 -0
  613. package/data/uniappx/api/README.md +98 -0
  614. package/data/uniappx/api/_sidebar.md +165 -0
  615. package/data/uniappx/api/accelerometer.md +322 -0
  616. package/data/uniappx/api/action-sheet.md +192 -0
  617. package/data/uniappx/api/animation-frame.md +125 -0
  618. package/data/uniappx/api/app-route.md +632 -0
  619. package/data/uniappx/api/authentication.md +267 -0
  620. package/data/uniappx/api/base64.md +127 -0
  621. package/data/uniappx/api/bio-auth.md +3 -0
  622. package/data/uniappx/api/calendar.md +400 -0
  623. package/data/uniappx/api/canvas-get-image-data.md +3 -0
  624. package/data/uniappx/api/canvas-put-image-data.md +3 -0
  625. package/data/uniappx/api/canvas-to-temp-file-path.md +62 -0
  626. package/data/uniappx/api/canvasrenderingcontext2d.md +128 -0
  627. package/data/uniappx/api/capture-screen.md +173 -0
  628. package/data/uniappx/api/capturescreen.md +3 -0
  629. package/data/uniappx/api/choose-file.md +174 -0
  630. package/data/uniappx/api/choose-image.md +312 -0
  631. package/data/uniappx/api/choose-location.md +412 -0
  632. package/data/uniappx/api/choose-media.md +272 -0
  633. package/data/uniappx/api/choose-video.md +165 -0
  634. package/data/uniappx/api/clipboard.md +155 -0
  635. package/data/uniappx/api/compass.md +351 -0
  636. package/data/uniappx/api/compress-image.md +147 -0
  637. package/data/uniappx/api/compress-video.md +136 -0
  638. package/data/uniappx/api/connect-event-source.md +225 -0
  639. package/data/uniappx/api/contact.md +153 -0
  640. package/data/uniappx/api/create-camera-context.md +346 -0
  641. package/data/uniappx/api/create-canvas-context-async.md +167 -0
  642. package/data/uniappx/api/create-editor-context-async.md +605 -0
  643. package/data/uniappx/api/create-inner-audio-context.md +704 -0
  644. package/data/uniappx/api/create-intersection-observer.md +195 -0
  645. package/data/uniappx/api/create-interstitial-ad.md +253 -0
  646. package/data/uniappx/api/create-live-player-context.md +185 -0
  647. package/data/uniappx/api/create-live-pusher-context.md +282 -0
  648. package/data/uniappx/api/create-map-context.md +677 -0
  649. package/data/uniappx/api/create-request-permission-listener.md +147 -0
  650. package/data/uniappx/api/create-rewarded-video-ad.md +302 -0
  651. package/data/uniappx/api/create-selector-query.md +609 -0
  652. package/data/uniappx/api/create-video-context.md +190 -0
  653. package/data/uniappx/api/create-webview-context.md +274 -0
  654. package/data/uniappx/api/create-worker.md +607 -0
  655. package/data/uniappx/api/dialog-page.md +377 -0
  656. package/data/uniappx/api/dom/README.md +319 -0
  657. package/data/uniappx/api/dom/cssstyledeclaration.md +341 -0
  658. package/data/uniappx/api/dom/domrect.md +30 -0
  659. package/data/uniappx/api/dom/drawablecontext.md +63 -0
  660. package/data/uniappx/api/dom/element.md +3 -0
  661. package/data/uniappx/api/dom/unicanvaselement.md +29 -0
  662. package/data/uniappx/api/dom/unielement.md +211 -0
  663. package/data/uniappx/api/dom/uniimageelement.md +23 -0
  664. package/data/uniappx/api/dom/uniinputelement.md +25 -0
  665. package/data/uniappx/api/dom/uninativeviewelement.md +18 -0
  666. package/data/uniappx/api/dom/uniresizeobserver.md +20 -0
  667. package/data/uniappx/api/dom/unitextareaelement.md +25 -0
  668. package/data/uniappx/api/dom/unitextelement.md +23 -0
  669. package/data/uniappx/api/dom/univideoelement.md +18 -0
  670. package/data/uniappx/api/dom/uniwebviewelement.md +18 -0
  671. package/data/uniappx/api/download-file.md +226 -0
  672. package/data/uniappx/api/env.md +101 -0
  673. package/data/uniappx/api/event-bus.md +184 -0
  674. package/data/uniappx/api/exit.md +134 -0
  675. package/data/uniappx/api/ext.md +61 -0
  676. package/data/uniappx/api/facial-recognition-meta-info.md +131 -0
  677. package/data/uniappx/api/facial-recognition-verify.md +3 -0
  678. package/data/uniappx/api/file-system-spec.md +223 -0
  679. package/data/uniappx/api/get-accessibility-info.md +113 -0
  680. package/data/uniappx/api/get-app-authorize-setting.md +276 -0
  681. package/data/uniappx/api/get-app-base-info.md +175 -0
  682. package/data/uniappx/api/get-app.md +175 -0
  683. package/data/uniappx/api/get-background-audio-manager.md +509 -0
  684. package/data/uniappx/api/get-battery-info.md +106 -0
  685. package/data/uniappx/api/get-current-pages.md +215 -0
  686. package/data/uniappx/api/get-device-info.md +188 -0
  687. package/data/uniappx/api/get-element-by-id.md +103 -0
  688. package/data/uniappx/api/get-element.md +3 -0
  689. package/data/uniappx/api/get-file-system-manager.md +2351 -0
  690. package/data/uniappx/api/get-image-info.md +143 -0
  691. package/data/uniappx/api/get-launch-options-sync.md +3 -0
  692. package/data/uniappx/api/get-location.md +362 -0
  693. package/data/uniappx/api/get-network-type.md +96 -0
  694. package/data/uniappx/api/get-performance.md +299 -0
  695. package/data/uniappx/api/get-provider.md +3 -0
  696. package/data/uniappx/api/get-recorder-manager.md +408 -0
  697. package/data/uniappx/api/get-system-info.md +527 -0
  698. package/data/uniappx/api/get-system-setting.md +133 -0
  699. package/data/uniappx/api/get-univerify-manager.md +549 -0
  700. package/data/uniappx/api/get-video-info.md +150 -0
  701. package/data/uniappx/api/get-window-info.md +163 -0
  702. package/data/uniappx/api/gyroscope.md +389 -0
  703. package/data/uniappx/api/image.md +40 -0
  704. package/data/uniappx/api/install-apk.md +93 -0
  705. package/data/uniappx/api/interceptor.md +84 -0
  706. package/data/uniappx/api/is-simulator.md +120 -0
  707. package/data/uniappx/api/keyboard.md +194 -0
  708. package/data/uniappx/api/launch.md +200 -0
  709. package/data/uniappx/api/load-font-face.md +206 -0
  710. package/data/uniappx/api/loading.md +186 -0
  711. package/data/uniappx/api/locale.md +74 -0
  712. package/data/uniappx/api/location-change.md +533 -0
  713. package/data/uniappx/api/make-phone-call.md +102 -0
  714. package/data/uniappx/api/memory.md +135 -0
  715. package/data/uniappx/api/modal.md +232 -0
  716. package/data/uniappx/api/navigator-bar-loading.md +122 -0
  717. package/data/uniappx/api/navigator.md +478 -0
  718. package/data/uniappx/api/network-status-change.md +145 -0
  719. package/data/uniappx/api/network-summarize.md +40 -0
  720. package/data/uniappx/api/nodes-info.md +3 -0
  721. package/data/uniappx/api/on-tab-bar-mid-button-tap.md +34 -0
  722. package/data/uniappx/api/open-app-authorize-setting.md +117 -0
  723. package/data/uniappx/api/open-document.md +122 -0
  724. package/data/uniappx/api/open-location.md +154 -0
  725. package/data/uniappx/api/page-scroll-to.md +170 -0
  726. package/data/uniappx/api/path2d.md +48 -0
  727. package/data/uniappx/api/preview-image.md +341 -0
  728. package/data/uniappx/api/privacy.md +232 -0
  729. package/data/uniappx/api/provider.md +329 -0
  730. package/data/uniappx/api/pull-down-refresh.md +154 -0
  731. package/data/uniappx/api/push.md +1 -0
  732. package/data/uniappx/api/report.md +150 -0
  733. package/data/uniappx/api/request-merchant-transfer.md +117 -0
  734. package/data/uniappx/api/request-payment.md +315 -0
  735. package/data/uniappx/api/request-system-permission.md +220 -0
  736. package/data/uniappx/api/request.md +517 -0
  737. package/data/uniappx/api/rpx2px.md +94 -0
  738. package/data/uniappx/api/save-image-to-photos-album.md +115 -0
  739. package/data/uniappx/api/save-video-to-photos-album.md +102 -0
  740. package/data/uniappx/api/scan-code.md +118 -0
  741. package/data/uniappx/api/screen-brightness.md +333 -0
  742. package/data/uniappx/api/set-navigation-bar-color.md +133 -0
  743. package/data/uniappx/api/set-navigation-bar-title.md +117 -0
  744. package/data/uniappx/api/set-tab-bar.md +651 -0
  745. package/data/uniappx/api/set-tabbar.md +3 -0
  746. package/data/uniappx/api/share-with-system.md +139 -0
  747. package/data/uniappx/api/share.md +325 -0
  748. package/data/uniappx/api/show-action-sheet.md +3 -0
  749. package/data/uniappx/api/show-loading.md +3 -0
  750. package/data/uniappx/api/show-modal.md +3 -0
  751. package/data/uniappx/api/show-toast.md +3 -0
  752. package/data/uniappx/api/sign-in.md +358 -0
  753. package/data/uniappx/api/storage.md +719 -0
  754. package/data/uniappx/api/theme-change.md +742 -0
  755. package/data/uniappx/api/theme.md +3 -0
  756. package/data/uniappx/api/toast.md +180 -0
  757. package/data/uniappx/api/uni-push.md +513 -0
  758. package/data/uniappx/api/unicloud/README.md +87 -0
  759. package/data/uniappx/api/unicloud/database.md +1028 -0
  760. package/data/uniappx/api/unicloud/function.md +83 -0
  761. package/data/uniappx/api/unicloud/object.md +138 -0
  762. package/data/uniappx/api/unicloud/sse-channel.md +92 -0
  763. package/data/uniappx/api/unicloud/storage.md +204 -0
  764. package/data/uniappx/api/unicloud/utils.md +153 -0
  765. package/data/uniappx/api/unipage.md +263 -0
  766. package/data/uniappx/api/upload-file.md +233 -0
  767. package/data/uniappx/api/vibrate.md +177 -0
  768. package/data/uniappx/api/virtual-payment.md +517 -0
  769. package/data/uniappx/api/websocket-global.md +3 -0
  770. package/data/uniappx/api/websocket.md +562 -0
  771. package/data/uniappx/api/wide-screen-adaptation.md +433 -0
  772. package/data/uniappx/api/wifi.md +508 -0
  773. package/data/uniappx/api/window.md +86 -0
  774. package/data/uniappx/app-harmony/README.md +74 -0
  775. package/data/uniappx/app-harmony/harmony-vapor.md +3 -0
  776. package/data/uniappx/app-vapor.md +583 -0
  777. package/data/uniappx/benchmark/vapor-benchmark-android.md +483 -0
  778. package/data/uniappx/benchmark/vapor-benchmark-harmony.md +309 -0
  779. package/data/uniappx/benchmark/vapor-benchmark-ios.md +373 -0
  780. package/data/uniappx/collocation/_sidebar.md +15 -0
  781. package/data/uniappx/collocation/app.md +370 -0
  782. package/data/uniappx/collocation/manifest-android.md +1289 -0
  783. package/data/uniappx/collocation/manifest-harmony.md +152 -0
  784. package/data/uniappx/collocation/manifest-ios.md +709 -0
  785. package/data/uniappx/collocation/manifest-modules.md +508 -0
  786. package/data/uniappx/collocation/manifest-splashscreen.md +227 -0
  787. package/data/uniappx/collocation/manifest.md +745 -0
  788. package/data/uniappx/collocation/pagesjson.md +790 -0
  789. package/data/uniappx/collocation/themejson.md +176 -0
  790. package/data/uniappx/compiler/README.md +121 -0
  791. package/data/uniappx/compiler/_sidebar.md +4 -0
  792. package/data/uniappx/component/README.md +206 -0
  793. package/data/uniappx/component/_sidebar.md +118 -0
  794. package/data/uniappx/component/ad-custom.md +29 -0
  795. package/data/uniappx/component/ad.md +124 -0
  796. package/data/uniappx/component/animation-view.md +51 -0
  797. package/data/uniappx/component/aria-component.md +21 -0
  798. package/data/uniappx/component/audio.md +4 -0
  799. package/data/uniappx/component/block.md +26 -0
  800. package/data/uniappx/component/button.md +298 -0
  801. package/data/uniappx/component/camera.md +303 -0
  802. package/data/uniappx/component/canvas.md +230 -0
  803. package/data/uniappx/component/channel-live.md +27 -0
  804. package/data/uniappx/component/channel-video.md +38 -0
  805. package/data/uniappx/component/checkbox-group.md +56 -0
  806. package/data/uniappx/component/checkbox.md +247 -0
  807. package/data/uniappx/component/common.md +637 -0
  808. package/data/uniappx/component/cover-image.md +42 -0
  809. package/data/uniappx/component/cover-view.md +93 -0
  810. package/data/uniappx/component/custom-tab-bar.md +36 -0
  811. package/data/uniappx/component/double-tap-gesture-handler.md +36 -0
  812. package/data/uniappx/component/draggable-sheet.md +31 -0
  813. package/data/uniappx/component/editor.md +329 -0
  814. package/data/uniappx/component/flow-item.md +3 -0
  815. package/data/uniappx/component/force-press-gesture-handler.md +36 -0
  816. package/data/uniappx/component/form.md +378 -0
  817. package/data/uniappx/component/functional-page-navigator.md +43 -0
  818. package/data/uniappx/component/glass-effect-view.md +217 -0
  819. package/data/uniappx/component/grid-builder.md +39 -0
  820. package/data/uniappx/component/grid-view.md +35 -0
  821. package/data/uniappx/component/horizontal-drag-gesture-handler.md +40 -0
  822. package/data/uniappx/component/icon.md +41 -0
  823. package/data/uniappx/component/image.md +264 -0
  824. package/data/uniappx/component/input.md +905 -0
  825. package/data/uniappx/component/keyboard-accessory.md +21 -0
  826. package/data/uniappx/component/label.md +134 -0
  827. package/data/uniappx/component/list-builder.md +36 -0
  828. package/data/uniappx/component/list-item.md +1 -0
  829. package/data/uniappx/component/list-view.md +508 -0
  830. package/data/uniappx/component/live-player.md +267 -0
  831. package/data/uniappx/component/live-pusher.md +343 -0
  832. package/data/uniappx/component/loading.md +309 -0
  833. package/data/uniappx/component/long-press-gesture-handler.md +40 -0
  834. package/data/uniappx/component/map.md +376 -0
  835. package/data/uniappx/component/match-media.md +132 -0
  836. package/data/uniappx/component/movable-area.md +37 -0
  837. package/data/uniappx/component/movable-view.md +157 -0
  838. package/data/uniappx/component/native-component.md +21 -0
  839. package/data/uniappx/component/native-view.md +342 -0
  840. package/data/uniappx/component/navigation-bar.md +44 -0
  841. package/data/uniappx/component/navigator.md +143 -0
  842. package/data/uniappx/component/nested-scroll-body.md +122 -0
  843. package/data/uniappx/component/nested-scroll-header.md +121 -0
  844. package/data/uniappx/component/nested-scroll.md +6 -0
  845. package/data/uniappx/component/official-account.md +21 -0
  846. package/data/uniappx/component/open-container.md +38 -0
  847. package/data/uniappx/component/page-container.md +386 -0
  848. package/data/uniappx/component/page-meta.md +79 -0
  849. package/data/uniappx/component/pan-gesture-handler.md +40 -0
  850. package/data/uniappx/component/picker-view-column.md +3 -0
  851. package/data/uniappx/component/picker-view.md +180 -0
  852. package/data/uniappx/component/picker.md +370 -0
  853. package/data/uniappx/component/progress.md +163 -0
  854. package/data/uniappx/component/radio-group.md +56 -0
  855. package/data/uniappx/component/radio.md +218 -0
  856. package/data/uniappx/component/rich-text.md +244 -0
  857. package/data/uniappx/component/root-portal.md +26 -0
  858. package/data/uniappx/component/scale-gesture-handler.md +45 -0
  859. package/data/uniappx/component/scroll-view.md +556 -0
  860. package/data/uniappx/component/share-element.md +221 -0
  861. package/data/uniappx/component/slider.md +232 -0
  862. package/data/uniappx/component/snapshot.md +30 -0
  863. package/data/uniappx/component/span.md +21 -0
  864. package/data/uniappx/component/sticky-header.md +138 -0
  865. package/data/uniappx/component/sticky-section.md +152 -0
  866. package/data/uniappx/component/sticky.md +6 -0
  867. package/data/uniappx/component/store-home.md +26 -0
  868. package/data/uniappx/component/store-product.md +28 -0
  869. package/data/uniappx/component/swiper-item.md +3 -0
  870. package/data/uniappx/component/swiper.md +380 -0
  871. package/data/uniappx/component/switch.md +189 -0
  872. package/data/uniappx/component/tap-gesture-handler.md +36 -0
  873. package/data/uniappx/component/text.md +384 -0
  874. package/data/uniappx/component/textarea.md +603 -0
  875. package/data/uniappx/component/uni-ui-x/README.md +165 -0
  876. package/data/uniappx/component/uni-ui-x/uni-badge-view.md +260 -0
  877. package/data/uniappx/component/uni-ui-x/uni-collapse-item.md +3 -0
  878. package/data/uniappx/component/uni-ui-x/uni-collapse.md +696 -0
  879. package/data/uniappx/component/uni-ui-x/uni-drag-cell.md +782 -0
  880. package/data/uniappx/component/uni-ui-x/uni-fab-button.md +137 -0
  881. package/data/uniappx/component/uni-ui-x/uni-index-bar.md +224 -0
  882. package/data/uniappx/component/uni-ui-x/uni-link.md +190 -0
  883. package/data/uniappx/component/uni-ui-x/uni-nav-bar.md +173 -0
  884. package/data/uniappx/component/uni-ui-x/uni-number-box.md +234 -0
  885. package/data/uniappx/component/uni-ui-x/uni-rate.md +151 -0
  886. package/data/uniappx/component/uni-ui-x/uni-refresh-box.md +250 -0
  887. package/data/uniappx/component/uni-ui-x/uni-tab-bar.md +3 -0
  888. package/data/uniappx/component/uni-ui-x/uni-tab-content.md +3 -0
  889. package/data/uniappx/component/uni-ui-x/uni-tab-item.md +3 -0
  890. package/data/uniappx/component/uni-ui-x/uni-tab-midbutton.md +3 -0
  891. package/data/uniappx/component/uni-ui-x/uni-tab.md +1161 -0
  892. package/data/uniappx/component/uni-ui-x/uni-time-format.md +213 -0
  893. package/data/uniappx/component/unicloud-db.md +270 -0
  894. package/data/uniappx/component/vertical-drag-gesture-handler.md +40 -0
  895. package/data/uniappx/component/video.md +627 -0
  896. package/data/uniappx/component/view.md +216 -0
  897. package/data/uniappx/component/voip-room.md +43 -0
  898. package/data/uniappx/component/waterflow.md +407 -0
  899. package/data/uniappx/component/web-view.md +460 -0
  900. package/data/uniappx/css/README.md +436 -0
  901. package/data/uniappx/css/_sidebar.md +104 -0
  902. package/data/uniappx/css/align-content.md +338 -0
  903. package/data/uniappx/css/align-items.md +276 -0
  904. package/data/uniappx/css/align-self.md +291 -0
  905. package/data/uniappx/css/animation-composition.md +33 -0
  906. package/data/uniappx/css/animation-delay.md +26 -0
  907. package/data/uniappx/css/animation-direction.md +34 -0
  908. package/data/uniappx/css/animation-duration.md +31 -0
  909. package/data/uniappx/css/animation-fill-mode.md +34 -0
  910. package/data/uniappx/css/animation-iteration-count.md +31 -0
  911. package/data/uniappx/css/animation-name.md +31 -0
  912. package/data/uniappx/css/animation-play-state.md +32 -0
  913. package/data/uniappx/css/animation-range-end.md +26 -0
  914. package/data/uniappx/css/animation-range-start.md +26 -0
  915. package/data/uniappx/css/animation-range.md +34 -0
  916. package/data/uniappx/css/animation-timeline.md +34 -0
  917. package/data/uniappx/css/animation-timing-function.md +45 -0
  918. package/data/uniappx/css/animation.md +36 -0
  919. package/data/uniappx/css/backdrop-filter.md +255 -0
  920. package/data/uniappx/css/background-clip.md +36 -0
  921. package/data/uniappx/css/background-color.md +353 -0
  922. package/data/uniappx/css/background-image.md +152 -0
  923. package/data/uniappx/css/background.md +35 -0
  924. package/data/uniappx/css/border-bottom-color.md +39 -0
  925. package/data/uniappx/css/border-bottom-left-radius.md +33 -0
  926. package/data/uniappx/css/border-bottom-right-radius.md +33 -0
  927. package/data/uniappx/css/border-bottom-style.md +37 -0
  928. package/data/uniappx/css/border-bottom-width.md +44 -0
  929. package/data/uniappx/css/border-bottom.md +201 -0
  930. package/data/uniappx/css/border-color.md +284 -0
  931. package/data/uniappx/css/border-left-color.md +34 -0
  932. package/data/uniappx/css/border-left-style.md +37 -0
  933. package/data/uniappx/css/border-left-width.md +44 -0
  934. package/data/uniappx/css/border-left.md +200 -0
  935. package/data/uniappx/css/border-radius.md +391 -0
  936. package/data/uniappx/css/border-right-color.md +34 -0
  937. package/data/uniappx/css/border-right-style.md +37 -0
  938. package/data/uniappx/css/border-right-width.md +44 -0
  939. package/data/uniappx/css/border-right.md +201 -0
  940. package/data/uniappx/css/border-style.md +271 -0
  941. package/data/uniappx/css/border-top-color.md +34 -0
  942. package/data/uniappx/css/border-top-left-radius.md +33 -0
  943. package/data/uniappx/css/border-top-right-radius.md +33 -0
  944. package/data/uniappx/css/border-top-style.md +37 -0
  945. package/data/uniappx/css/border-top-width.md +44 -0
  946. package/data/uniappx/css/border-top.md +201 -0
  947. package/data/uniappx/css/border-width.md +415 -0
  948. package/data/uniappx/css/border.md +302 -0
  949. package/data/uniappx/css/bottom.md +259 -0
  950. package/data/uniappx/css/box-shadow.md +879 -0
  951. package/data/uniappx/css/box-sizing.md +353 -0
  952. package/data/uniappx/css/color.md +158 -0
  953. package/data/uniappx/css/common/at-rules.md +244 -0
  954. package/data/uniappx/css/common/color.md +40 -0
  955. package/data/uniappx/css/common/function.md +661 -0
  956. package/data/uniappx/css/common/length.md +178 -0
  957. package/data/uniappx/css/common/selector.md +55 -0
  958. package/data/uniappx/css/common/style-isolation.md +215 -0
  959. package/data/uniappx/css/common/variable.md +1 -0
  960. package/data/uniappx/css/css_diff_web.md +802 -0
  961. package/data/uniappx/css/direction.md +146 -0
  962. package/data/uniappx/css/display.md +42 -0
  963. package/data/uniappx/css/flex-basis.md +306 -0
  964. package/data/uniappx/css/flex-direction.md +243 -0
  965. package/data/uniappx/css/flex-flow.md +283 -0
  966. package/data/uniappx/css/flex-grow.md +318 -0
  967. package/data/uniappx/css/flex-shrink.md +313 -0
  968. package/data/uniappx/css/flex-wrap.md +259 -0
  969. package/data/uniappx/css/flex.md +216 -0
  970. package/data/uniappx/css/font-family.md +187 -0
  971. package/data/uniappx/css/font-size.md +176 -0
  972. package/data/uniappx/css/font-style.md +139 -0
  973. package/data/uniappx/css/font-weight.md +167 -0
  974. package/data/uniappx/css/height.md +239 -0
  975. package/data/uniappx/css/justify-content.md +286 -0
  976. package/data/uniappx/css/left.md +260 -0
  977. package/data/uniappx/css/letter-spacing.md +149 -0
  978. package/data/uniappx/css/line-height.md +173 -0
  979. package/data/uniappx/css/lines.md +37 -0
  980. package/data/uniappx/css/margin-bottom.md +281 -0
  981. package/data/uniappx/css/margin-left.md +281 -0
  982. package/data/uniappx/css/margin-right.md +278 -0
  983. package/data/uniappx/css/margin-top.md +274 -0
  984. package/data/uniappx/css/margin.md +315 -0
  985. package/data/uniappx/css/max-height.md +242 -0
  986. package/data/uniappx/css/max-width.md +251 -0
  987. package/data/uniappx/css/min-height.md +252 -0
  988. package/data/uniappx/css/min-width.md +243 -0
  989. package/data/uniappx/css/opacity.md +248 -0
  990. package/data/uniappx/css/overflow.md +330 -0
  991. package/data/uniappx/css/padding-bottom.md +241 -0
  992. package/data/uniappx/css/padding-left.md +234 -0
  993. package/data/uniappx/css/padding-right.md +242 -0
  994. package/data/uniappx/css/padding-top.md +234 -0
  995. package/data/uniappx/css/padding.md +309 -0
  996. package/data/uniappx/css/pointer-events.md +155 -0
  997. package/data/uniappx/css/position.md +444 -0
  998. package/data/uniappx/css/right.md +260 -0
  999. package/data/uniappx/css/text-align.md +154 -0
  1000. package/data/uniappx/css/text-decoration-color.md +35 -0
  1001. package/data/uniappx/css/text-decoration-line.md +144 -0
  1002. package/data/uniappx/css/text-decoration-style.md +41 -0
  1003. package/data/uniappx/css/text-decoration-thickness.md +39 -0
  1004. package/data/uniappx/css/text-decoration.md +52 -0
  1005. package/data/uniappx/css/text-overflow.md +176 -0
  1006. package/data/uniappx/css/text-shadow.md +146 -0
  1007. package/data/uniappx/css/top.md +258 -0
  1008. package/data/uniappx/css/transform-origin.md +298 -0
  1009. package/data/uniappx/css/transform.md +50 -0
  1010. package/data/uniappx/css/transition-delay.md +253 -0
  1011. package/data/uniappx/css/transition-duration.md +275 -0
  1012. package/data/uniappx/css/transition-property.md +67 -0
  1013. package/data/uniappx/css/transition-timing-function.md +259 -0
  1014. package/data/uniappx/css/transition.md +527 -0
  1015. package/data/uniappx/css/visibility.md +198 -0
  1016. package/data/uniappx/css/white-space.md +162 -0
  1017. package/data/uniappx/css/width.md +300 -0
  1018. package/data/uniappx/css/z-index.md +411 -0
  1019. package/data/uniappx/debug/android-inspector.md +54 -0
  1020. package/data/uniappx/i18n.md +358 -0
  1021. package/data/uniappx/mp/README.md +159 -0
  1022. package/data/uniappx/native/README.md +65 -0
  1023. package/data/uniappx/native/debug/android.md +122 -0
  1024. package/data/uniappx/native/debug/harmony.md +116 -0
  1025. package/data/uniappx/native/debug/ios.md +84 -0
  1026. package/data/uniappx/native/download/android.md +45 -0
  1027. package/data/uniappx/native/download/ios.md +29 -0
  1028. package/data/uniappx/native/modules/android/others.md +1343 -0
  1029. package/data/uniappx/native/modules/android/uni-ad.md +99 -0
  1030. package/data/uniappx/native/modules/android/uni-facialRecognitionVerify.md +69 -0
  1031. package/data/uniappx/native/modules/android/uni-getLocation.md +121 -0
  1032. package/data/uniappx/native/modules/android/uni-map-tencent.md +92 -0
  1033. package/data/uniappx/native/modules/android/uni-oauth.md +57 -0
  1034. package/data/uniappx/native/modules/android/uni-payment.md +110 -0
  1035. package/data/uniappx/native/modules/android/uni-push.md +217 -0
  1036. package/data/uniappx/native/modules/android/uni-share.md +57 -0
  1037. package/data/uniappx/native/modules/android/uni-verify.md +101 -0
  1038. package/data/uniappx/native/modules/android/uni-video.md +125 -0
  1039. package/data/uniappx/native/modules/harmony/facialVerify.md +45 -0
  1040. package/data/uniappx/native/modules/harmony/location.md +43 -0
  1041. package/data/uniappx/native/modules/harmony/map.md +64 -0
  1042. package/data/uniappx/native/modules/harmony/modules.md +23 -0
  1043. package/data/uniappx/native/modules/harmony/oauth.md +47 -0
  1044. package/data/uniappx/native/modules/harmony/pay.md +85 -0
  1045. package/data/uniappx/native/modules/harmony/push.md +74 -0
  1046. package/data/uniappx/native/modules/harmony/verify.md +45 -0
  1047. package/data/uniappx/native/modules/ios/modules.md +943 -0
  1048. package/data/uniappx/native/permission/android_permission_adapter.md +62 -0
  1049. package/data/uniappx/native/use/android.md +521 -0
  1050. package/data/uniappx/native/use/androidcomm.md +104 -0
  1051. package/data/uniappx/native/use/androiduts.md +388 -0
  1052. package/data/uniappx/native/use/harmony.md +99 -0
  1053. package/data/uniappx/native/use/harmonyapi.md +190 -0
  1054. package/data/uniappx/native/use/harmonyuts.md +62 -0
  1055. package/data/uniappx/native/use/ios.md +90 -0
  1056. package/data/uniappx/native/use/iosapi.md +288 -0
  1057. package/data/uniappx/native/use/iosuts.md +87 -0
  1058. package/data/uniappx/page.md +486 -0
  1059. package/data/uniappx/performance.md +175 -0
  1060. package/data/uniappx/plugin/NOTE.md +5 -0
  1061. package/data/uniappx/project.md +149 -0
  1062. package/data/uniappx/readme.md +381 -0
  1063. package/data/uniappx/release-note-alpha.md +2219 -0
  1064. package/data/uniappx/release.md +1961 -0
  1065. package/data/uniappx/sample.md +157 -0
  1066. package/data/uniappx/select.md +3 -0
  1067. package/data/uniappx/tutorial/android-16kb.md +87 -0
  1068. package/data/uniappx/tutorial/android-memoryleak.md +542 -0
  1069. package/data/uniappx/tutorial/app-env.md +80 -0
  1070. package/data/uniappx/tutorial/app-market.md +51 -0
  1071. package/data/uniappx/tutorial/app-package.md +195 -0
  1072. package/data/uniappx/tutorial/app-playground.md +188 -0
  1073. package/data/uniappx/tutorial/bug_repair.md +40 -0
  1074. package/data/uniappx/tutorial/codegap.md +223 -0
  1075. package/data/uniappx/tutorial/compatibility.md +119 -0
  1076. package/data/uniappx/tutorial/compliance.md +671 -0
  1077. package/data/uniappx/tutorial/debug/devtools.md +134 -0
  1078. package/data/uniappx/tutorial/idref.md +121 -0
  1079. package/data/uniappx/tutorial/ls-plugin.md +181 -0
  1080. package/data/uniappx/tutorial/request.md +204 -0
  1081. package/data/uniappx/tutorial/rules_mcp.md +121 -0
  1082. package/data/uniappx/tutorial/stickynestlist.md +68 -0
  1083. package/data/uniappx/tutorial/store.md +130 -0
  1084. package/data/uniappx/uniapptox.md +145 -0
  1085. package/data/uniappx/uts/README.md +441 -0
  1086. package/data/uniappx/uts/_sidebar.md +55 -0
  1087. package/data/uniappx/uts/buildin-object-api/array.md +2265 -0
  1088. package/data/uniappx/uts/buildin-object-api/arraybuffer.md +480 -0
  1089. package/data/uniappx/uts/buildin-object-api/console.md +520 -0
  1090. package/data/uniappx/uts/buildin-object-api/dataview.md +853 -0
  1091. package/data/uniappx/uts/buildin-object-api/date.md +1534 -0
  1092. package/data/uniappx/uts/buildin-object-api/error.md +30 -0
  1093. package/data/uniappx/uts/buildin-object-api/float32array.md +581 -0
  1094. package/data/uniappx/uts/buildin-object-api/float64array.md +626 -0
  1095. package/data/uniappx/uts/buildin-object-api/global.md +600 -0
  1096. package/data/uniappx/uts/buildin-object-api/int16array.md +1069 -0
  1097. package/data/uniappx/uts/buildin-object-api/int32array.md +1137 -0
  1098. package/data/uniappx/uts/buildin-object-api/int8array.md +1166 -0
  1099. package/data/uniappx/uts/buildin-object-api/json.md +407 -0
  1100. package/data/uniappx/uts/buildin-object-api/map.md +479 -0
  1101. package/data/uniappx/uts/buildin-object-api/math.md +1525 -0
  1102. package/data/uniappx/uts/buildin-object-api/number.md +852 -0
  1103. package/data/uniappx/uts/buildin-object-api/promise.md +1444 -0
  1104. package/data/uniappx/uts/buildin-object-api/regexp.md +534 -0
  1105. package/data/uniappx/uts/buildin-object-api/set.md +317 -0
  1106. package/data/uniappx/uts/buildin-object-api/string.md +1604 -0
  1107. package/data/uniappx/uts/buildin-object-api/textdecoder.md +133 -0
  1108. package/data/uniappx/uts/buildin-object-api/textencoder.md +60 -0
  1109. package/data/uniappx/uts/buildin-object-api/timers.md +145 -0
  1110. package/data/uniappx/uts/buildin-object-api/uint16array.md +1154 -0
  1111. package/data/uniappx/uts/buildin-object-api/uint32array.md +1165 -0
  1112. package/data/uniappx/uts/buildin-object-api/uint8array.md +1146 -0
  1113. package/data/uniappx/uts/buildin-object-api/uint8clampedarray.md +1147 -0
  1114. package/data/uniappx/uts/buildin-object-api/utsjsonobject.md +1297 -0
  1115. package/data/uniappx/uts/class.md +462 -0
  1116. package/data/uniappx/uts/compiler-known-issues.md +865 -0
  1117. package/data/uniappx/uts/conditional.md +206 -0
  1118. package/data/uniappx/uts/data-type.md +2242 -0
  1119. package/data/uniappx/uts/enumerability.md +15 -0
  1120. package/data/uniappx/uts/enumerability_iterable.md +200 -0
  1121. package/data/uniappx/uts/exception.md +25 -0
  1122. package/data/uniappx/uts/function.md +358 -0
  1123. package/data/uniappx/uts/generics.md +246 -0
  1124. package/data/uniappx/uts/interface.md +35 -0
  1125. package/data/uniappx/uts/iterable.md +137 -0
  1126. package/data/uniappx/uts/keywords.md +393 -0
  1127. package/data/uniappx/uts/literal.md +216 -0
  1128. package/data/uniappx/uts/loops.md +236 -0
  1129. package/data/uniappx/uts/module.md +92 -0
  1130. package/data/uniappx/uts/object.md +155 -0
  1131. package/data/uniappx/uts/operator.md +295 -0
  1132. package/data/uniappx/uts/runtime-known-issues.md +94 -0
  1133. package/data/uniappx/uts/type-aliases.md +43 -0
  1134. package/data/uniappx/uts/type-compatibility.md +133 -0
  1135. package/data/uniappx/uts/uts-optimize.md +33 -0
  1136. package/data/uniappx/uts/uts_diff_ts.md +2443 -0
  1137. package/data/uniappx/uts/utsactivitycallback.md +3099 -0
  1138. package/data/uniappx/uts/utsandroid.md +1461 -0
  1139. package/data/uniappx/uts/utsandroidhookproxy.md +34 -0
  1140. package/data/uniappx/uts/utsharmony.md +348 -0
  1141. package/data/uniappx/uts/utsios.md +466 -0
  1142. package/data/uniappx/uts/utsioshookproxy.md +374 -0
  1143. package/data/uniappx/vapor-benchmark.md +9 -0
  1144. package/data/uniappx/vue/README.md +384 -0
  1145. package/data/uniappx/vue/_sidebar.md +10 -0
  1146. package/data/uniappx/vue/advanced-api.md +253 -0
  1147. package/data/uniappx/vue/built-in.md +2133 -0
  1148. package/data/uniappx/vue/component.md +1134 -0
  1149. package/data/uniappx/vue/composition-api.md +2169 -0
  1150. package/data/uniappx/vue/data-bind.md +463 -0
  1151. package/data/uniappx/vue/global-api.md +307 -0
  1152. package/data/uniappx/vue/modifier.md +249 -0
  1153. package/data/uniappx/vue/options-api.md +1489 -0
  1154. package/data/uniappx/vue/others.md +20 -0
  1155. package/data/uniappx/web/README.md +263 -0
  1156. package/data/uniappx/web/ssr.md +238 -0
  1157. package/data/uniappx/worktile/NOTE.md +5 -0
  1158. package/data/uniappx-doc-index.json +7664 -0
  1159. package/dist/main.mjs +67 -45
  1160. package/package.json +1 -1
@@ -0,0 +1,2133 @@
1
+ # 内置内容
2
+
3
+ ## 指令 @directives
4
+
5
+ | | 兼容性 |
6
+ | :- | :- |
7
+ | v-text | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) |
8
+ | v-html | Web 4.0 / 微信小程序 x / Android(VDOM) 3.99 / Android(Vapor) x / iOS x / HarmonyOS x(部分支持,见上) |
9
+ | v-show | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
10
+ | v-if | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
11
+ | v-else | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
12
+ | v-else-if | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
13
+ | v-for | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
14
+ | v-on | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
15
+ | v-bind | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
16
+ | v-model | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
17
+ | v-slot | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
18
+ | v-pre | Web 4.0 / 微信小程序 x / Android 3.99 / iOS 4.11 / HarmonyOS 4.61(部分支持,见上) |
19
+ | v-once | Web x / 微信小程序 x / Android 3.99 / iOS 4.11 / HarmonyOS 4.61(部分支持,见上) |
20
+ | v-memo | Web x / 微信小程序 x / Android(VDOM) 3.99 / Android(Vapor) x / iOS(VDOM) 4.11 / iOS(Vapor) x / HarmonyOS(VDOM) 4.61 / HarmonyOS(Vapor) x(部分支持,见上) |
21
+ | v-cloak | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) |
22
+
23
+ ### v-text
24
+
25
+ 更新元素的文本内容。
26
+
27
+ - 期望的绑定值类型:string
28
+ - 详细信息
29
+
30
+ v-text 将覆盖元素中所有现有的内容。
31
+
32
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-text/v-text-composition.uvue)
33
+
34
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-text/v-text-composition
35
+
36
+ > 组合式 API
37
+
38
+ ```vue
39
+ <template>
40
+ <view class="page">
41
+ <view class="flex flex-row justify-between mb-10">
42
+ <text>v-txt for text:</text>
43
+ <text id="v-text-text" v-text="vTextForText"></text>
44
+ </view>
45
+ <view class="flex flex-row justify-between mb-10">
46
+ <text>v-txt for view:</text>
47
+ <view id="v-text-view" v-text="vTextForView"></view>
48
+ </view>
49
+ </view>
50
+ </template>
51
+
52
+ ```
53
+
54
+ >选项式 API
55
+
56
+ ```vue
57
+ <template>
58
+ <view class="page">
59
+ <view class="flex flex-row justify-between mb-10">
60
+ <text>v-txt for text:</text>
61
+ <text id="v-text-text" v-text="vTextForText"></text>
62
+ </view>
63
+ <view class="flex flex-row justify-between mb-10">
64
+ <text>v-txt for view:</text>
65
+ <view id="v-text-view" v-text="vTextForView"></view>
66
+ </view>
67
+ </view>
68
+ </template>
69
+
70
+ ```
71
+
72
+ ### v-html
73
+
74
+ 更新元素的内容,并且不会被解析。
75
+
76
+ ::: warning 注意
77
+ 在 `App-android` 平台,`v-html` 指令通过编译为 [rich-text](../component/rich-text.md) 组件实现。因此,`v-html` 指令的内容必须是 `rich-text` 支持的格式, 并且要遵循标签嵌套规则,例如, `swiper` 标签内只允许嵌套 `swiper-item` 标签。\
78
+ 同时,受限于 `rich-text` 组件不支持 `class` 样式,`v-html` 指令中同样不支持 `class` 样式。\
79
+ 绑定 `v-html` 的标签内的内容会被忽略,`v-html` 指令的内容会编译为 `rich-text` 组件渲染为该标签的子节点。
80
+
81
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-html/v-html-composition.uvue)
82
+
83
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-html/v-html-composition
84
+
85
+ > 组合式 API
86
+
87
+ ```vue
88
+ <template>
89
+ <view v-html="html" />
90
+ </template>
91
+
92
+ ```
93
+
94
+ > 选项式 API
95
+
96
+ ```vue
97
+ <template>
98
+ <view v-html="html" />
99
+ </template>
100
+
101
+ ```
102
+
103
+ ### v-show
104
+
105
+ 基于表达式值的真假性,来改变元素的可见性。
106
+
107
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-show/v-show-composition.uvue)
108
+
109
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-show/v-show-composition
110
+
111
+ > 组合式 API
112
+
113
+ ```vue
114
+ <template>
115
+ <view class="page">
116
+ <button id="toggle-btn" @click="toggleShow">toggle show/hide</button>
117
+ <text>点击上方按钮,切换下方 view 显示/隐藏</text>
118
+ <text>show default true: {{dataInfo.showDefaultTrue}}</text>
119
+ <view class="mt-10 default-true" id="v-show-element-default-true" v-show="dataInfo.showDefaultTrue"></view>
120
+ <text>show default false: {{dataInfo.showDefaultFalse}}</text>
121
+ <view class="mt-10 default-false" id="v-show-element-default-false" v-show="dataInfo.showDefaultFalse"></view>
122
+ <Foo v-show="dataInfo.showDefaultFalse" />
123
+ </view>
124
+ </template>
125
+
126
+
127
+
128
+ <style>
129
+ .default-true,
130
+ .default-false {
131
+ display: flex;
132
+ width: 100px;
133
+ height: 50px;
134
+ }
135
+
136
+ .default-true {
137
+ background-color: greenyellow;
138
+ }
139
+
140
+ .default-false {
141
+ background-color: antiquewhite;
142
+ }
143
+ </style>
144
+ ```
145
+
146
+ > 选项式 API
147
+
148
+ ```vue
149
+ <template>
150
+ <view class="page">
151
+ <button id="toggle-btn" @click="toggleShow">toggle show/hide</button>
152
+ <text>点击上方按钮,切换下方 view 显示/隐藏</text>
153
+ <text>show default true: {{dataInfo.showDefaultTrue}}</text>
154
+ <view class="mt-10 default-true" id="v-show-element-default-true" v-show="dataInfo.showDefaultTrue"></view>
155
+ <text>show default false: {{dataInfo.showDefaultFalse}}</text>
156
+ <view class="mt-10 default-false" id="v-show-element-default-false" v-show="dataInfo.showDefaultFalse"></view>
157
+ <Foo v-show="dataInfo.showDefaultFalse" />
158
+ </view>
159
+ </template>
160
+
161
+
162
+
163
+ <style>
164
+ .default-true,
165
+ .default-false {
166
+ display: flex;
167
+ width: 100px;
168
+ height: 50px;
169
+ }
170
+
171
+ .default-true {
172
+ background-color: greenyellow;
173
+ }
174
+
175
+ .default-false {
176
+ background-color: antiquewhite;
177
+ }
178
+ </style>
179
+ ```
180
+
181
+ ### v-if
182
+
183
+ 基于表达式值的真假性,来条件性地渲染元素或者模板片段。
184
+
185
+ - 详细信息
186
+
187
+ 当 `v-if` 元素被触发,元素及其所包含的指令/组件都会销毁和重构。如果初始条件是假,那么其内部的内容根本都不会被渲染。
188
+
189
+ 可用于 `<template>` 表示仅包含文本或多个元素的条件块。
190
+
191
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-if/v-if-composition.uvue)
192
+
193
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-if/v-if-composition
194
+
195
+ > 组合式 API
196
+
197
+ ```vue
198
+ <template>
199
+
200
+ <scroll-view style="flex: 1">
201
+
202
+ <view class="page">
203
+ <view class="mb-10 flex justify-between flex-row">
204
+ <text>v-if</text>
205
+ <text id="v-if-show" v-if="show">show</text>
206
+ </view>
207
+ <button id="switch-v-if-btn" @click="show = !show">switch v-if</button>
208
+
209
+ <view class="mt-10 mb-10 flex justify-between flex-row">
210
+ <text>num:</text>
211
+ <text id="num">{{ num }}</text>
212
+ </view>
213
+ <view class="mb-10 flex justify-between flex-row">
214
+ <text>v-if v-else-if v-else</text>
215
+ <text id="num-v-if" v-if="num == 1">v-if num = 1</text>
216
+ <text id="num-v-else-if" v-else-if="num == 2">v-else-if num = 2</text>
217
+ <text id="num-v-else" v-else>v-else</text>
218
+ </view>
219
+ <button id="change-num-btn" @click="changeNum">change num</button>
220
+
221
+
222
+ <view class="mt-10">
223
+ <text class="section-title">多层嵌套v-if测试</text>
224
+ </view>
225
+
226
+
227
+ <view class="mt-10">
228
+ <text class="test-label">1. view 普通版本 </text>
229
+ <view class="test-item" v-if="viewNormalChild1">
230
+ <view v-if="viewNormalChild1" id="view-normal-child1">
231
+ <text>view二层嵌套内容</text>
232
+ <view v-if="viewNormalChild2" id="view-normal-child2">
233
+ <text>view三层嵌套内容</text>
234
+ </view>
235
+ <button id="toggle-view-normal-child2" @click="viewNormalChild2 = !viewNormalChild2">内层切换显示</button>
236
+ </view>
237
+ </view>
238
+ <button id="toggle-view-normal-child1" @click="viewNormalChild1 = !viewNormalChild1">外层切换显示</button>
239
+ </view>
240
+
241
+
242
+ <view class="mt-10">
243
+ <text class="test-label">2. view 拍平版本 </text>
244
+ <view class="test-item" v-if="viewFlattenChild1">
245
+ <view flatten v-if="viewFlattenChild1" id="view-flatten-child1">
246
+ <view flatten v-if="viewFlattenChild1">
247
+ <text>view拍平三层嵌套内容(应该能消失)</text>
248
+ </view>
249
+ </view>
250
+ </view>
251
+ <button id="toggle-view-flatten-child1" @click="viewFlattenChild1 = !viewFlattenChild1">
252
+ 切换显示
253
+ </button>
254
+ </view>
255
+
256
+
257
+ <view class="mt-10">
258
+ <text class="test-label">3. text 普通版本 </text>
259
+ <view class="test-item">
260
+ <text v-if="textNormalChild1">
261
+ <text v-if="textNormalChild1" id="text-normal-child1">text二层嵌套内容(应该能消失)</text>
262
+ </text>
263
+ </view>
264
+ <button id="toggle-text-normal-child1" @click="textNormalChild1 = !textNormalChild1">
265
+ 切换显示
266
+ </button>
267
+ </view>
268
+
269
+
270
+ <view class="mt-10">
271
+ <text class="test-label">4. text 拍平版本 </text>
272
+ <view flatten class="test-item">
273
+ <text flatten v-if="textFlattenChild1">
274
+ <text flatten v-if="textFlattenChild1" id="text-flatten-child1">text拍平二层嵌套内容(应该能消失)</text>
275
+ </text>
276
+ </view>
277
+ <button id="toggle-text-flatten-child1" @click="textFlattenChild1 = !textFlattenChild1">
278
+ 切换显示
279
+ </button>
280
+ </view>
281
+
282
+
283
+ <view class="mt-10">
284
+ <text class="test-label">5. image 普通版本 </text>
285
+ <view class="test-item">
286
+ <image v-if="imageNormalChild1" id="image-normal-child1" src="/static/logo.png" class="test-image"></image>
287
+ </view>
288
+ <button id="toggle-image-normal-child1" @click="imageNormalChild1 = !imageNormalChild1">
289
+ 切换显示
290
+ </button>
291
+ </view>
292
+
293
+
294
+ <view class="mt-10">
295
+ <text class="test-label">6. image 拍平版本(多层嵌套v-if)</text>
296
+ <view flatten class="test-item">
297
+ <image flatten v-if="imageFlattenChild1" id="image-flatten-child1" src="/static/logo.png" class="test-image"></image>
298
+ </view>
299
+ <button id="toggle-image-flatten-child1" @click="imageFlattenChild1 = !imageFlattenChild1">
300
+ 切换显示
301
+ </button>
302
+ </view>
303
+
304
+
305
+ <view class="mt-10">
306
+ <text class="test-label">8. scroll-view(动态v-if)</text>
307
+ <view class="test-item">
308
+ <scroll-view v-if="scrollViewChild1" id="scroll-view-child1" class="scroll-view-test">
309
+ <text>scroll-view内容1(应该能消失)</text>
310
+ <view><text>scroll-view内容2(应该能消失)</text></view>
311
+ </scroll-view>
312
+ <button id="toggle-scroll-view-child1" @click="scrollViewChild1 = !scrollViewChild1">
313
+ 切换scroll-view显示
314
+ </button>
315
+ </view>
316
+ </view>
317
+
318
+
319
+ <view class="mt-10">
320
+ <text class="test-label">9. child 组件(子child动态v-if普通版本➕拍平版本)</text>
321
+ <view class="test-item">
322
+ <child v-if="childComponent1" id="child-component1"></child>
323
+ <view flatten>
324
+ <child v-if="childComponent1" id="child-component2" flatten></child>
325
+ </view>
326
+ <button id="toggle-child-component1" @click="childComponent1 = !childComponent1">
327
+ 切换child组件显示
328
+ </button>
329
+ </view>
330
+ </view>
331
+
332
+ </view>
333
+
334
+ </scroll-view>
335
+
336
+ </template>
337
+
338
+ <style>
339
+ .section-title {
340
+ font-size: 16px;
341
+ font-weight: bold;
342
+ margin-bottom: 10px;
343
+ }
344
+
345
+ .test-label {
346
+ font-size: 14px;
347
+ color: #666;
348
+ margin-bottom: 5px;
349
+ }
350
+
351
+ .test-item {
352
+ padding: 10px;
353
+ background-color: #f5f5f5;
354
+ border-radius: 5px;
355
+ }
356
+
357
+ .test-image {
358
+ width: 50px;
359
+ height: 50px;
360
+ }
361
+
362
+ .scroll-view-test {
363
+ height: 100px;
364
+ background-color: #e0e0e0;
365
+ padding: 10px;
366
+ }
367
+ </style>
368
+
369
+ ```
370
+
371
+ > 选项式 API
372
+
373
+ ```vue
374
+ <template>
375
+ <view class="page">
376
+ <view class="mb-10 flex justify-between flex-row">
377
+ <text>v-if</text>
378
+ <text id="v-if-show" v-if="show">show</text>
379
+ </view>
380
+ <button id="switch-v-if-btn" @click="show = !show">switch v-if</button>
381
+
382
+ <view class="mt-10 mb-10 flex justify-between flex-row">
383
+ <text>num:</text>
384
+ <text id="num">{{ num }}</text>
385
+ </view>
386
+ <view class="mb-10 flex justify-between flex-row">
387
+ <text>v-if v-else-if v-else</text>
388
+ <text id="num-v-if" v-if="num == 1">v-if num = 1</text>
389
+ <text id="num-v-else-if" v-else-if="num == 2">v-else-if num = 2</text>
390
+ <text id="num-v-else" v-else>v-else</text>
391
+ </view>
392
+ <button id="change-num-btn" @click="changeNum">change num</button>
393
+ </view>
394
+ </template>
395
+
396
+ ```
397
+
398
+ ### v-for
399
+
400
+ 基于原始数据多次渲染元素或模板块。
401
+
402
+ - 期望的绑定值类型:`Array | UTSJSONObject | number | string | Iterable`
403
+
404
+ - 详细信息
405
+
406
+ 指令值必须使用特殊语法 `alias in expression` 为正在迭代的元素提供一个别名:
407
+
408
+ ```vue
409
+ <view v-for="item in items">
410
+ {{ item.text }}
411
+ </view>
412
+ ```
413
+ `v-for` 的默认方式是尝试就地更新元素而不移动它们。要强制其重新排序元素,你需要用特殊 attribute `key` 来提供一个排序提示:
414
+
415
+ ```vue
416
+ <view v-for="item in items" :key="item.id">
417
+ {{ item.text }}
418
+ </view>
419
+ ```
420
+
421
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-for/v-for-composition.uvue)
422
+
423
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-for/v-for-composition
424
+
425
+ > 组合式 API
426
+
427
+ ```vue
428
+ <template>
429
+
430
+ <scroll-view style="flex: 1">
431
+
432
+ <view class="page">
433
+ <text class="bold mb-10">v-for number</text>
434
+ <view class="mb-10" v-for="item in 3" :key="item">
435
+ <text :id="`number-${item}`">{{ item }}</text>
436
+ </view>
437
+
438
+ <view class="mb-10" v-for="item in utsNumber" :key="item">
439
+ <text :id="`uts-number-${item}`">{{ item }}</text>
440
+ </view>
441
+
442
+ <view class="bold mb-10">v-for object</view>
443
+ <view
444
+ v-for="(value, key) in object"
445
+ :key="key"
446
+ class="mb-10 flex justify-between flex-row">
447
+ <text :id="key">{{ key }}</text>
448
+ <text :id="value">{{ value }}</text>
449
+ </view>
450
+
451
+ <view class="bold mb-10">v-for & v-if list items</view>
452
+ <view
453
+ id="v-for-v-if-list-items"
454
+ v-for="item in listItems"
455
+ :key="item.name">
456
+ <template v-if="item.show">
457
+ <view class="mb-10 flex justify-between flex-row">
458
+ <text :id="item.name">{{ item.name }}</text>
459
+ <text @click="item.count++" :id="`v-if-${item.name}-count`">{{
460
+ item.count
461
+ }}</text>
462
+ </view>
463
+ <template v-for="child in item.items">
464
+ <view
465
+ v-if="child.show"
466
+ :key="child.name"
467
+ class="mb-10 flex justify-between flex-row">
468
+ <text :id="child.name">{{ child.name }}</text>
469
+ <text @click="child.count++" :id="`v-if-${child.name}-count`">{{
470
+ child.count
471
+ }}</text>
472
+ </view>
473
+ </template>
474
+ </template>
475
+ </view>
476
+
477
+ <view class="bold mb-10">v-for & v-show list items</view>
478
+ <view
479
+ id="v-for-v-if-list-items"
480
+ v-for="item in listItems"
481
+ :key="item.name"
482
+ v-show="item.show">
483
+ <view class="mb-10 flex justify-between flex-row">
484
+ <text :id="item.name">{{ item.name }}</text>
485
+ <text @click="item.count++" :id="`v-show-${item.name}-count`">{{
486
+ item.count
487
+ }}</text>
488
+ </view>
489
+ <view
490
+ v-for="child in item.items"
491
+ v-show="child.show"
492
+ :key="child.name"
493
+ class="mb-10 flex justify-between flex-row">
494
+ <text :id="child.name">{{ child.name }}</text>
495
+ <text @click="child.count++" :id="`v-show-${child.name}-count`">{{
496
+ child.count
497
+ }}</text>
498
+ </view>
499
+ </view>
500
+
501
+ <view
502
+ class="mb-10 flex justify-between flex-row"
503
+ v-for="item in mapList"
504
+ :key="item[0]">
505
+ <text>{{ item[0] }}</text>
506
+ <text :id="item[0]">{{ item[1] }}</text>
507
+ </view>
508
+
509
+ <view class="mb-10" v-for="(item, index) in setList" :key="index">
510
+ <text :id="`set-value-${index + 1}`">{{ item }}</text>
511
+ </view>
512
+
513
+ <view class="bold mb-10">v-for UTSJSONObject</view>
514
+ <view
515
+ v-for="(value, key) in utsJSONObject"
516
+ :key="key"
517
+ class="mb-10 flex justify-between flex-row">
518
+ <text :id="key">{{ key }}</text>
519
+ <text :id="value">{{ value }}</text>
520
+ </view>
521
+ </view>
522
+
523
+ </scroll-view>
524
+
525
+ </template>
526
+
527
+
528
+
529
+ ```
530
+
531
+ > 选项式 API
532
+
533
+ ```vue
534
+ <template>
535
+
536
+ <scroll-view style="flex: 1">
537
+
538
+ <view class="page">
539
+ <text class="bold mb-10">v-for number</text>
540
+ <view class="mb-10" v-for="item in 3" :key="item">
541
+ <text :id="`number-${item}`">{{ item }}</text>
542
+ </view>
543
+
544
+ <view class="mb-10" v-for="item in utsNumber" :key="item">
545
+ <text :id="`uts-number-${item}`">{{ item }}</text>
546
+ </view>
547
+
548
+ <view class="bold mb-10">v-for object</view>
549
+ <view
550
+ v-for="(value, key) in object"
551
+ :key="key"
552
+ class="mb-10 flex justify-between flex-row">
553
+ <text :id="key">{{ key }}</text>
554
+ <text :id="value">{{ value }}</text>
555
+ </view>
556
+
557
+ <view class="bold mb-10">v-for & v-if list items</view>
558
+ <view
559
+ id="v-for-v-if-list-items"
560
+ v-for="item in listItems"
561
+ :key="item.name">
562
+ <template v-if="item.show">
563
+ <view class="mb-10 flex justify-between flex-row">
564
+ <text :id="item.name">{{ item.name }}</text>
565
+ <text @click="item.count++" :id="`v-if-${item.name}-count`">{{
566
+ item.count
567
+ }}</text>
568
+ </view>
569
+ <template v-for="child in item.items">
570
+ <view
571
+ v-if="child.show"
572
+ :key="child.name"
573
+ class="mb-10 flex justify-between flex-row">
574
+ <text :id="child.name">{{ child.name }}</text>
575
+ <text @click="child.count++" :id="`v-if-${child.name}-count`">{{
576
+ child.count
577
+ }}</text>
578
+ </view>
579
+ </template>
580
+ </template>
581
+ </view>
582
+
583
+ <view class="bold mb-10">v-for & v-show list items</view>
584
+ <view
585
+ id="v-for-v-show-list-items"
586
+ v-for="item in listItems"
587
+ v-show="item.show"
588
+ :key="item.name">
589
+ <view class="mb-10 flex justify-between flex-row">
590
+ <text :id="item.name">{{ item.name }}</text>
591
+ <text @click="item.count++" :id="`v-show-${item.name}-count`">{{
592
+ item.count
593
+ }}</text>
594
+ </view>
595
+ <view
596
+ v-for="child in item.items"
597
+ v-show="child.show"
598
+ :key="child.name"
599
+ class="mb-10 flex justify-between flex-row">
600
+ <text :id="child.name">{{ child.name }}</text>
601
+ <text @click="child.count++" :id="`v-show-${child.name}-count`">{{
602
+ child.count
603
+ }}</text>
604
+ </view>
605
+ </view>
606
+
607
+ <view
608
+ class="mb-10 flex justify-between flex-row"
609
+ v-for="item in mapList"
610
+ :key="item[0]">
611
+ <text>{{ item[0] }}</text>
612
+ <text :id="item[0]">{{ item[1] }}</text>
613
+ </view>
614
+
615
+ <view class="mb-10" v-for="(item, index) in setList" :key="index">
616
+ <text :id="`set-value-${index + 1}`">{{ item }}</text>
617
+ </view>
618
+
619
+ <view class="bold mb-10">v-for UTSJSONObject</view>
620
+ <view
621
+ v-for="(value, key) in utsJSONObject"
622
+ :key="key"
623
+ class="mb-10 flex justify-between flex-row">
624
+ <text :id="key">{{ key }}</text>
625
+ <text :id="value">{{ value }}</text>
626
+ </view>
627
+ </view>
628
+
629
+ </scroll-view>
630
+
631
+ </template>
632
+
633
+
634
+
635
+ ```
636
+
637
+ ### v-on
638
+
639
+ 给元素绑定事件监听器。
640
+
641
+ - 缩写:`@`
642
+
643
+ - 期望的绑定值类型:`Function | Object (不带参数)`
644
+
645
+ - 参数:`event` (使用对象语法则为可选项)
646
+
647
+ - 修饰符
648
+ - `.stop` - 调用 `event.stopPropagation()`
649
+ - `.once` - 最多触发一次处理函数。
650
+
651
+ - 详见[事件修饰符](https://uniapp.dcloud.net.cn/tutorial/vue3-basics.html#%E4%BA%8B%E4%BB%B6%E4%BF%AE%E9%A5%B0%E7%AC%A6)。
652
+
653
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-on/v-on-composition.uvue)
654
+
655
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-on/v-on-composition
656
+
657
+ > 组合式 API
658
+
659
+ ```vue
660
+ <template>
661
+ <view class="page">
662
+ <text class="bold mb-10">下方按钮点击累加 count</text>
663
+ <view class="flex justify-between flex-row mb-10">
664
+ <text>count:</text>
665
+ <text id="count">{{ count }}</text>
666
+ </view>
667
+ <button class="mb-10 btn" @click="handleClick">
668
+ @click="handleClick" 缩写
669
+ </button>
670
+ <button class="mb-10 btn" v-on:click="handleClick">
671
+ v-on:click="handleClick" 方法处理函数
672
+ </button>
673
+ <button class="mb-10 btn" v-on:click="count++">
674
+ v-on:click="count++" 内联事件
675
+ </button>
676
+ <button class="mb-10 btn" v-on:click="handleClick($event as MouseEvent)">
677
+ v-on:click="handleClick($event as MouseEvent)"
678
+ 内联声明,注意要显式声明$event的类型
679
+ </button>
680
+
681
+ <button class="mb-10 btn" v-on:[event]="handleClick">
682
+ v-on:[event]="handleClick" 动态事件
683
+ </button>
684
+ <button class="mb-10 btn" v-on="{ click: handleClick }">
685
+ v-on="{ click: handleClick }" 对象语法
686
+ </button>
687
+
688
+
689
+
690
+ <button class="mb-10 btn" id="btn-once" @click.once="handleClick">@click once</button>
691
+
692
+ <view @click="handleClick">
693
+ <button class="mb-10 btn" id="btn-stop" @click.stop="handleClick">@click stop</button>
694
+ </view>
695
+ <button class="mb-10" id="btn-prevent" @touchstart.prevent="handleTouchstart" @click="handleClick">@touch prevent</button>
696
+ </view>
697
+ </template>
698
+
699
+
700
+
701
+ ```
702
+
703
+ > 选项式 API
704
+
705
+ ```vue
706
+ <template>
707
+ <view class="page">
708
+ <text class="bold mb-10">下方按钮点击累加 count</text>
709
+ <view class="flex justify-between flex-row mb-10">
710
+ <text>count:</text>
711
+ <text id="count">{{ count }}</text>
712
+ </view>
713
+ <button class="mb-10 btn" @click="handleClick">@click="handleClick" 缩写</button>
714
+ <button class="mb-10 btn" v-on:click="handleClick">
715
+ v-on:click="handleClick" 方法处理函数
716
+ </button>
717
+ <button class="mb-10 btn" v-on:click="count++">
718
+ v-on:click="count++" 内联事件
719
+ </button>
720
+ <button class="mb-10 btn" v-on:click="handleClick($event as MouseEvent)">
721
+ v-on:click="handleClick($event as MouseEvent)"
722
+ 内联声明,注意要显式声明$event的类型
723
+ </button>
724
+
725
+ <button class="mb-10 btn" v-on:[event]="handleClick">
726
+ v-on:[event]="handleClick" 动态事件
727
+ </button>
728
+ <button class="mb-10 btn" v-on="{ click: handleClick }">
729
+ v-on="{ click: handleClick }" 对象语法
730
+ </button>
731
+
732
+
733
+
734
+ <button class="mb-10 btn" id="btn-once" @click.once="handleClick">@click once</button>
735
+
736
+ <view @click="handleClick">
737
+ <button class="mb-10 btn" id="btn-stop" @click.stop="handleClick">@click stop</button>
738
+ </view>
739
+ <button class="mb-10" id="btn-prevent" @touchstart.prevent="handleTouchstart" @click="handleClick">@touch prevent</button>
740
+ </view>
741
+ </template>
742
+
743
+
744
+
745
+ ```
746
+
747
+ ### v-bind
748
+
749
+ 动态的绑定一个或多个 attribute,也可以是组件的 prop。
750
+
751
+ - 缩写:
752
+ - `:` 或者 `.` (当使用 `.prop` 修饰符)
753
+ - 值可以省略 (当 attribute 和绑定的值同名时)
754
+
755
+ - 期望:`any (带参数) | Object (不带参数)`
756
+
757
+ - 参数:`attrOrProp (可选的)`
758
+
759
+ - 用途
760
+
761
+ 当用于绑定 `class` 或 `style` attribute,`v-bind` 支持额外的值类型如数组或对象。
762
+
763
+ 当用于组件 props 绑定时,所绑定的 props 必须在子组件中已被正确声明。
764
+
765
+ 当不带参数使用时,可以用于绑定一个包含了多个 attribute 名称-绑定值对的对象。
766
+
767
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-bind/v-bind-composition.uvue)
768
+
769
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-bind/v-bind-composition
770
+
771
+ > 组合式 API
772
+
773
+ ```vue
774
+ <template>
775
+
776
+ <scroll-view style="flex: 1">
777
+
778
+ <view class="page">
779
+
780
+ <button id="disabled-btn" class="mb-10" :disabled="true">
781
+ :disabled true
782
+ </button>
783
+ <button id="v-bind-disabled-btn" class="mb-10" v-bind:disabled="false">
784
+ v-bind:disabled false
785
+ </button>
786
+
787
+
788
+ <view class="flex justify-between flex-row mb-10">
789
+ <text>bind object style fontSize:</text>
790
+ <text id="bind-object-style" :style="{ fontSize: dataInfo.fontSize }">
791
+ {{ dataInfo.fontSize }}
792
+ </text>
793
+ </view>
794
+ <view id="bind-array-style" class="mb-10 p-10" :style="[dataInfo.backgroundColor, dataInfo.border]">
795
+ <view>bind arr style</view>
796
+ <view class="my-10">{{ dataInfo.backgroundColor }}</view>
797
+ <view>{{ dataInfo.border }}</view>
798
+ </view>
799
+ <view class="mb-10 p-10">
800
+ <text id="bind-raw-object-style" :style="rawObjectStyle">rawObjectStyle</text>
801
+ </view>
802
+
803
+ <view class="mb-10 p-10">
804
+ <text id="bind-raw-array-style" :style="rawArrayStyle">rawArrayStyle</text>
805
+ </view>
806
+
807
+
808
+ <Foo class="foo-props" :title="dataInfo.fooProps.title" :num="dataInfo.fooProps.num" :obj="dataInfo.fooProps.obj" />
809
+
810
+
811
+ <Foo checked />
812
+
813
+
814
+ <Foo id="bindObj1" v-bind="{ title: dataInfo.fooProps.title,num: dataInfo.fooProps.num,obj: dataInfo.fooProps.obj }" />
815
+
816
+ <Foo id="bindObj2" v-bind="{ title: dataInfo.fooProps.title,num: dataInfo.fooProps.num,obj: dataInfo.fooProps.obj }" title="foo title override" />
817
+
818
+ <Foo id="bindObj3" title="foo" v-bind="{ title: dataInfo.fooProps.title,num: dataInfo.fooProps.num,obj: dataInfo.fooProps.obj }" />
819
+
820
+ <Foo id="bindObj4" v-bind="fooProps" title="foo title(json) override" />
821
+
822
+ <Foo id="bindObj5" title="foo" v-bind="fooProps" />
823
+
824
+
825
+
826
+ <view class="mb-10 v-bind-css"></view>
827
+
828
+ </view>
829
+
830
+ </scroll-view>
831
+
832
+ </template>
833
+
834
+
835
+
836
+ <style>
837
+ /* #ifdef WEB */
838
+ .v-bind-css {
839
+ background-color: v-bind(dataInfo.vBindClassBackgroundColor);
840
+ height: v-bind(dataInfo.vBindClassRpxHeight);
841
+ }
842
+ /* #endif */
843
+ </style>
844
+
845
+ ```
846
+
847
+ > 选项式 API
848
+
849
+ ```vue
850
+ <template>
851
+
852
+ <scroll-view style="flex: 1">
853
+
854
+ <view class="page">
855
+
856
+ <button id="disabled-btn" class="mb-10" :disabled="true">:disabled true</button>
857
+ <button id="v-bind-disabled-btn" class="mb-10" v-bind:disabled="false">v-bind:disabled false</button>
858
+
859
+
860
+ <view class="flex justify-between flex-row mb-10">
861
+ <text>bind object style fontSize:</text>
862
+ <text id="bind-object-style" :style="{ fontSize: dataInfo.fontSize }">
863
+ {{ dataInfo.fontSize }}
864
+ </text>
865
+ </view>
866
+ <view id="bind-array-style" class="mb-10 p-10" :style="[dataInfo.backgroundColor, dataInfo.border]">
867
+ <view>bind arr style</view>
868
+ <view class="my-10">{{ dataInfo.backgroundColor }}</view>
869
+ <view>{{ dataInfo.border }}</view>
870
+ </view>
871
+ <view class="mb-10 p-10">
872
+ <text id="bind-raw-object-style" :style="rawObjectStyle">rawObjectStyle</text>
873
+ </view>
874
+ <view class="mb-10 p-10">
875
+ <text id="bind-raw-array-style" :style="rawArrayStyle">rawArrayStyle</text>
876
+ </view>
877
+
878
+
879
+ <Foo class="foo-props" :title="dataInfo.fooProps.title" :num="dataInfo.fooProps.num" :obj="dataInfo.fooProps.obj" />
880
+
881
+
882
+ <Foo checked />
883
+
884
+
885
+
886
+ <Foo v-bind="{ title: dataInfo.fooProps.title,num: dataInfo.fooProps.num,obj: dataInfo.fooProps.obj }" />
887
+ <Foo v-bind="fooProps"/>
888
+ <Foo id="bindObj1" v-bind="{ title: dataInfo.fooProps.title,num: dataInfo.fooProps.num,obj: dataInfo.fooProps.obj }" />
889
+
890
+ <Foo v-bind="{ title: dataInfo.fooProps.title,num: dataInfo.fooProps.num,obj: dataInfo.fooProps.obj }" id="bindObj2" :title="dataInfo.fooProps.title + ' override'" />
891
+
892
+ <Foo id="bindObj3" title="foo" v-bind="{ title: dataInfo.fooProps.title,num: dataInfo.fooProps.num,obj: dataInfo.fooProps.obj }" />
893
+
894
+ <Foo id="bindObj4" v-bind="fooProps" title="foo title(json) override" />
895
+
896
+ <Foo id="bindObj5" title="foo" v-bind="fooProps" />
897
+
898
+
899
+
900
+
901
+ <view class="mb-10 v-bind-css"></view>
902
+
903
+ </view>
904
+
905
+ </scroll-view>
906
+
907
+ </template>
908
+
909
+
910
+
911
+ <style>
912
+ /* #ifdef WEB */
913
+ .v-bind-css {
914
+ background-color: v-bind(dataInfo.vBindClassBackgroundColor);
915
+ height: v-bind(dataInfo.vBindClassRpxHeight);
916
+ }
917
+ /* #endif */
918
+ </style>
919
+
920
+ ```
921
+
922
+ ### v-model
923
+
924
+ 在表单输入元素或组件上创建双向绑定。
925
+
926
+ - 期望的绑定值类型:根据表单输入元素或组件输出的值而变化
927
+
928
+ - 仅限:
929
+ - `<input>`
930
+ - `<textarea>`
931
+
932
+ - 修饰符 <Badge text="仅 Android"/>
933
+ - `.lazy` - 监听 `change` 事件而不是 `input` 事件
934
+ - `.number` - 将输入的合法字符串转为数字
935
+ - `.trim` - 移除输入内容两端空格
936
+
937
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-model/v-model-composition.uvue)
938
+
939
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-model/v-model-composition
940
+
941
+ > 组合式 API
942
+
943
+ ```vue
944
+ <template>
945
+ <view class="page">
946
+ <Foo
947
+ v-model="str"
948
+ v-model:msg="msg"
949
+ v-model:strArr="strArr"
950
+ v-model:numArr="numArr"
951
+ v-model:utsObjModelValue="utsObj['modelValue']"
952
+ v-model:typeObjModelValue="typeObj.modelValue"
953
+ @update:modelValue="handleModelValueUpdate"
954
+ @update:msg="handleModelMsgUpdate"
955
+ />
956
+ <input class="mb-10 input" id="model-value-input" v-model="str" @input="onInput" />
957
+ <input class="mb-10 input" id="model-msg-input" v-model="msg" />
958
+ <input class="mb-10 input" id="model-uts-obj-value-input" v-model="utsObj['modelValue']" />
959
+ <input class="mb-10 input" id="model-type-obj-value-input" v-model="typeObj.modelValue" />
960
+ <view class="mb-10 flex justify-between flex-row">
961
+ <text>handle modelValue update res:</text>
962
+ <text id="handle-model-value-update-res">{{ handleModelValueUpdateRes }}</text>
963
+ </view>
964
+ <view class="mb-10 flex justify-between flex-row">
965
+ <text>handle model msg update res:</text>
966
+ <text id="handle-model-msg-update-res">{{ handleModelMsgUpdateRes }}</text>
967
+ </view>
968
+ <Parent v-model="value"></Parent>
969
+ <view class="mb-10 flex justify-between flex-row">
970
+ <text>arrayValue:</text>
971
+ <text id="array-value">{{ arrayValue.region }}</text>
972
+ </view>
973
+ <ArrayModelChild v-model="arrayValue.region"></ArrayModelChild>
974
+ </view>
975
+ </template>
976
+
977
+ <style>
978
+ .input {
979
+ padding: 0px 10px;
980
+ height: 40px;
981
+ border: 1px solid #ccc;
982
+ border-radius: 4px;
983
+ }
984
+ </style>
985
+
986
+ ```
987
+
988
+ > 选项式 API
989
+
990
+ ```vue
991
+ <template>
992
+ <view class="page">
993
+ <view class="mb-10 flex justify-between flex-row">
994
+ <text>str:</text>
995
+ <text id="str">{{ str }}</text>
996
+ </view>
997
+ <input class="mb-10 input" id="model-str" v-model="str" @input="onInput" />
998
+ <input class="mb-10 input" id="model-num" v-model.number="num" type="text" />
999
+ <input class="mb-10 input" id="model-str-trim" v-model.trim="strForTrim" />
1000
+ <input class="mb-10 input" id="model-str-lazy" v-model.lazy="str" type="text" />
1001
+ <view class="mb-10 flex justify-between flex-row">
1002
+ <text>typeof num:</text>
1003
+ <text id="typeof-num">{{ typeof num }}</text>
1004
+ </view>
1005
+ <view class="mb-10 flex justify-between flex-row">
1006
+ <text>str for trim length:</text>
1007
+ <text id="str-length">{{ strForTrim.length }}</text>
1008
+ </view>
1009
+ <Parent id="parent-component" v-model="value"></Parent>
1010
+ <Parent v-model="utsObj['modelValue']"></Parent>
1011
+ <Parent v-model="typeObj.modelValue"></Parent>
1012
+ <Parent v-model="typeObj.modelValue as string"></Parent>
1013
+ </view>
1014
+ </template>
1015
+
1016
+ <style>
1017
+ .input {
1018
+ padding: 0px 10px;
1019
+ height: 40px;
1020
+ border: 1px solid #ccc;
1021
+ border-radius: 4px;
1022
+ }
1023
+ </style>
1024
+
1025
+ ```
1026
+
1027
+ ### v-pre
1028
+
1029
+ 跳过该元素及其所有子元素的编译。
1030
+
1031
+ - 无需传入
1032
+
1033
+ - 详细信息
1034
+
1035
+ 元素内具有 `v-pre`,所有 Vue 模板语法都会被保留并按原样渲染。最常见的用例就是显示原始双大括号标签及内容。
1036
+
1037
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-pre/v-pre.uvue)
1038
+
1039
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-pre/v-pre
1040
+
1041
+ ```vue
1042
+ <template>
1043
+ <view class="page">
1044
+ <text class="bold mb-10">v-pre 跳过该元素及其所有子元素的编译</text>
1045
+ <text class="mb-10 v-pre-text" v-pre>{{ this will not be compiled }}</text>
1046
+ </view>
1047
+ </template>
1048
+
1049
+ ```
1050
+
1051
+ ### v-once
1052
+
1053
+ 仅渲染元素和组件一次,并跳过之后的更新。
1054
+
1055
+ - 无需传入
1056
+
1057
+ - 详细信息
1058
+
1059
+ 在随后的重新渲染,元素/组件及其所有子项将被当作静态内容并跳过渲染。这可以用来优化更新时的性能。
1060
+
1061
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-once/v-once-composition.uvue)
1062
+
1063
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-once/v-once-composition
1064
+
1065
+ > 组合式 API
1066
+
1067
+ ```vue
1068
+ <template>
1069
+ <view class="page">
1070
+
1071
+ <view class="flex flex-row justify-between mb-10" v-once>
1072
+ <text>This msg will never change:</text>
1073
+ <text id='v-once-msg'>{{ msg }}</text>
1074
+ </view>
1075
+
1076
+ <view class="flex flex-row justify-between mb-10">
1077
+ <text>msg:</text>
1078
+ <text id="msg">{{ msg }}</text>
1079
+ </view>
1080
+ <button id="btn" class="mb-10" type="primary" @click="changeMessage">
1081
+ change message
1082
+ </button>
1083
+ </view>
1084
+ </template>
1085
+
1086
+ ```
1087
+
1088
+ > 选项式 API
1089
+
1090
+ ```vue
1091
+ <template>
1092
+ <view class="page">
1093
+
1094
+ <view class="flex flex-row justify-between mb-10" v-once>
1095
+ <text>This msg will never change:</text>
1096
+ <text id='v-once-msg'>{{ msg }}</text>
1097
+ </view>
1098
+
1099
+ <view class="flex flex-row justify-between mb-10">
1100
+ <text>msg:</text>
1101
+ <text id="msg">{{ msg }}</text>
1102
+ </view>
1103
+ <button id="btn" class="mb-10" type="primary" @click="changeMessage">
1104
+ change message
1105
+ </button>
1106
+ </view>
1107
+ </template>
1108
+
1109
+ ```
1110
+
1111
+ ### v-slot
1112
+
1113
+ 用于声明具名插槽或是期望接收 props 的作用域插槽。
1114
+
1115
+ - 缩写:`#`
1116
+
1117
+ - 期望的绑定值类型:能够合法在函数参数位置使用的 JavaScript 表达式。支持解构语法。绑定值是可选的——只有在给作用域插槽传递 props 才需要。
1118
+
1119
+ - 参数:插槽名 (可选,默认是 `default`)
1120
+
1121
+ - 仅限:
1122
+ - `<template>`
1123
+ - [components](./component.md) (用于带有 prop 的单个默认插槽)
1124
+
1125
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-slot/v-slot-composition.uvue)
1126
+
1127
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-slot/v-slot-composition
1128
+
1129
+ > 组合式 API
1130
+
1131
+ ```vue
1132
+ <template>
1133
+ <view class="page">
1134
+ <Foo>
1135
+ <template #header="{ msg }">
1136
+ <view class="mb-10 flex justify-between flex-row">
1137
+ <text>header slot msg:</text>
1138
+ <text id="slot-header">{{ msg }}</text>
1139
+ </view>
1140
+ </template>
1141
+ <template #default="{ num }">
1142
+ <view class="mb-10 flex justify-between flex-row">
1143
+ <text>default slot num:</text>
1144
+ <text id="slot-default">{{ num }}</text>
1145
+ </view>
1146
+ </template>
1147
+
1148
+ <template v-for="item in 2" #[`num${item}`]="{ num }">
1149
+ <view class="mb-10 flex justify-between flex-row">
1150
+ <text>num{{ item }} slot:</text>
1151
+ <text :id="`slot-num${item}`">{{ num }}</text>
1152
+ </view>
1153
+ </template>
1154
+ <template v-if="msgTrue['isShow']" #[msgTrue['name']]="{ msg }">
1155
+ <view class="mb-10 flex justify-between flex-row">
1156
+ <text>{{ msgTrue['name'] }} slot msg:</text>
1157
+ <text id="slot-msg-true">{{ msg }}</text>
1158
+ </view>
1159
+ </template>
1160
+ <template v-if="msgFalse['isShow']" #[msgFalse['name']]="{ msg }">
1161
+ <view class="mb-10 flex justify-between flex-row">
1162
+ <text>{{ msgFalse['name'] }} slot msg:</text>
1163
+ <text id="slot-msg-false">{{ msg }}</text>
1164
+ </view>
1165
+ </template>
1166
+
1167
+ <template #footer="{ arr }">
1168
+ <view class="mb-10 flex justify-between flex-row">
1169
+ <text>footer slot arr:</text>
1170
+ <text id="slot-footer">{{ JSON.stringify(arr) }}</text>
1171
+ </view>
1172
+ </template>
1173
+ <template #withFor="{ item }">
1174
+ <view class="mb-10 flex justify-between flex-row">
1175
+ <text>v-for slot item:</text>
1176
+ <text :id="`slot-for-${item}`">{{ item }}</text>
1177
+ </view>
1178
+ </template>
1179
+ </Foo>
1180
+ </view>
1181
+ </template>
1182
+
1183
+
1184
+ ```
1185
+
1186
+ > 选项式 API
1187
+
1188
+ ```vue
1189
+ <template>
1190
+ <view class="page">
1191
+ <Foo>
1192
+ <template #header="{ msg }">
1193
+ <view class="mb-10 flex justify-between flex-row">
1194
+ <text>header slot msg:</text>
1195
+ <text id="slot-header">{{ msg }}</text>
1196
+ </view>
1197
+ </template>
1198
+ <template #default="{ num }">
1199
+ <view class="mb-10 flex justify-between flex-row">
1200
+ <text>default slot num:</text>
1201
+ <text id="slot-default">{{ num }}</text>
1202
+ </view>
1203
+ </template>
1204
+
1205
+ <template v-for="item in 2" #[`num${item}`]="{ num }">
1206
+ <view class="mb-10 flex justify-between flex-row">
1207
+ <text>num{{ item }} slot:</text>
1208
+ <text :id="`slot-num${item}`">{{ num }}</text>
1209
+ </view>
1210
+ </template>
1211
+ <template v-if="msgTrue['isShow']" #[msgTrue['name']]="{ msg }">
1212
+ <view class="mb-10 flex justify-between flex-row">
1213
+ <text>{{ msgTrue['name'] }} slot msg:</text>
1214
+ <text id="slot-msg-true">{{ msg }}</text>
1215
+ </view>
1216
+ </template>
1217
+ <template v-if="msgFalse['isShow']" #[msgFalse['name']]="{ msg }">
1218
+ <view class="mb-10 flex justify-between flex-row">
1219
+ <text>{{ msgFalse['name'] }} slot msg:</text>
1220
+ <text id="slot-msg-false">{{ msg }}</text>
1221
+ </view>
1222
+ </template>
1223
+
1224
+ <template #footer="{ arr }">
1225
+ <view class="mb-10 flex justify-between flex-row">
1226
+ <text>footer slot arr:</text>
1227
+ <text id="slot-footer">{{ JSON.stringify(arr) }}</text>
1228
+ </view>
1229
+ </template>
1230
+ <template #withFor="{ item }">
1231
+ <view class="mb-10 flex justify-between flex-row">
1232
+ <text>v-for slot item:</text>
1233
+ <text :id="`slot-for-${item}`">{{ item }}</text>
1234
+ </view>
1235
+ </template>
1236
+ </Foo>
1237
+ </view>
1238
+ </template>
1239
+
1240
+ ```
1241
+
1242
+ ### v-memo
1243
+
1244
+ - 期望的绑定值类型:`any[]`
1245
+
1246
+ - 详细信息
1247
+
1248
+ 缓存一个模板的子树。在元素和组件上都可以使用。为了实现缓存,该指令需要传入一个固定长度的依赖值数组进行比较。如果数组里的每个值都与最后一次的渲染相同,那么整个子树的更新将被跳过。举例来说:
1249
+
1250
+ ```vue
1251
+ <view v-memo="[valueA, valueB]">
1252
+ ...
1253
+ </view>
1254
+ ```
1255
+
1256
+ 当组件重新渲染,如果 `valueA` 和 `valueB` 都保持不变,这个 `<view>` 及其子项的所有更新都将被跳过。实际上,甚至虚拟 DOM 的 vnode 创建也将被跳过,因为缓存的子树副本可以被重新使用。
1257
+
1258
+ 正确指定缓存数组很重要,否则应该生效的更新可能被跳过。`v-memo` 传入空依赖数组 (`v-memo="[]"`) 将与 `v-once` 效果相同。
1259
+
1260
+ v-memo 仅用于性能至上场景中的微小优化,应该很少需要。最常见的情况可能是有助于渲染海量 v-for 列表 (长度超过 1000 的情况):
1261
+
1262
+ 当组件的 `selected` 状态改变,默认会重新创建大量的 vnode,尽管绝大部分都跟之前是一模一样的。`v-memo` 用在这里本质上是在说“只有当该项的被选中状态改变时才需要更新”。这使得每个选中状态没有变的项能完全重用之前的 vnode 并跳过差异比较。注意这里 memo 依赖数组中并不需要包含 `item.id`,因为 Vue 也会根据 item 的 `:key` 进行判断。
1263
+
1264
+ ::: warning 警告
1265
+ 当搭配 `v-for` 使用 `v-memo`,确保两者都绑定在同一个元素上。`v-memo` 不能用在 `v-for` 内部。
1266
+
1267
+ `v-memo` 也能被用于在一些默认优化失败的边际情况下,手动避免子组件出现不需要的更新。但是一样的,开发者需要负责指定正确的依赖数组以免跳过必要的更新。
1268
+
1269
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/directive/v-memo/v-memo-composition.uvue)
1270
+
1271
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/directive/v-memo/v-memo-composition
1272
+
1273
+ > 组合式 API
1274
+
1275
+ ```vue
1276
+ <template>
1277
+ <view class="page">
1278
+ <view class="flex flex-row justify-between mb-10" v-memo="[]">
1279
+ <text>msg will never change:</text>
1280
+ <text id="v-memo-never-change-msg">{{ msg }}</text>
1281
+ </view>
1282
+ <view class="flex flex-row justify-between mb-10">
1283
+ <text>msg:</text>
1284
+ <text id="msg">{{ msg }}</text>
1285
+ </view>
1286
+ <view class="flex flex-row justify-between mb-10" v-memo="[num]">
1287
+ <text>msg will change when num chang:</text>
1288
+ <text id="v-memo-num-change-msg">{{ msg }}</text>
1289
+ </view>
1290
+ <view class="flex flex-row justify-between mb-10">
1291
+ <text>num:</text>
1292
+ <text id="num">{{ num }}</text>
1293
+ </view>
1294
+ <button
1295
+ id="change-message-btn"
1296
+ class="mb-10"
1297
+ type="primary"
1298
+ @click="changeMessage">
1299
+ change message
1300
+ </button>
1301
+ <button
1302
+ id="increment-num-btn"
1303
+ class="mb-10"
1304
+ type="primary"
1305
+ @click="incrementNum">
1306
+ increment num
1307
+ </button>
1308
+ </view>
1309
+ </template>
1310
+
1311
+ ```
1312
+
1313
+ > 选项式 API
1314
+
1315
+ ```vue
1316
+ <template>
1317
+ <view class="page">
1318
+ <view class="flex flex-row justify-between mb-10" v-memo="[]">
1319
+ <text>msg will never change:</text>
1320
+ <text id="v-memo-never-change-msg">{{ msg }}</text>
1321
+ </view>
1322
+ <view class="flex flex-row justify-between mb-10">
1323
+ <text>msg:</text>
1324
+ <text id="msg">{{ msg }}</text>
1325
+ </view>
1326
+ <view class="flex flex-row justify-between mb-10" v-memo="[num]">
1327
+ <text>msg will change when num chang:</text>
1328
+ <text id="v-memo-num-change-msg">{{ msg }}</text>
1329
+ </view>
1330
+ <view class="flex flex-row justify-between mb-10">
1331
+ <text>num:</text>
1332
+ <text id="num">{{ num }}</text>
1333
+ </view>
1334
+ <button
1335
+ id="change-message-btn"
1336
+ class="mb-10"
1337
+ type="primary"
1338
+ @click="changeMessage">
1339
+ change message
1340
+ </button>
1341
+ <button
1342
+ id="increment-num-btn"
1343
+ class="mb-10"
1344
+ type="primary"
1345
+ @click="incrementNum">
1346
+ increment num
1347
+ </button>
1348
+ </view>
1349
+ </template>
1350
+
1351
+ ```
1352
+
1353
+ ## 组件 @component
1354
+
1355
+ - [props](../component/README.md#props)
1356
+ - [自定义事件](../component/README.md#自定义事件)
1357
+ - [计算属性和侦听器](../component/README.md#计算属性和侦听器)
1358
+ - [作用域插槽的类型](../component/README.md#作用域插槽的类型)
1359
+ - [监听页面生命周期](../component/README.md#监听页面生命周期)
1360
+ - [vue 与 uvue 不同文件后缀的优先级](../component/README.md#priority)
1361
+
1362
+ ::: warning 注意
1363
+ - App 端,如需页面级滚动,根节点必须是 `scroll-view` 标签。
1364
+
1365
+ ### \<KeepAlive> @keep-alive
1366
+
1367
+ > 组件类型:string
1368
+
1369
+ \<keep-alive> 包裹动态组件时,会缓存不活动的组件实例,而不是销毁它们。和 \<transition> 相似,\<keep-alive> 是一个抽象组件:它自身不会渲染一个 DOM 元素,也不会出现在父组件链中。
1370
+
1371
+ ##### 兼容性
1372
+ | Web | 微信小程序 | Android(VDOM) | Android(Vapor) | iOS(VDOM) | iOS(Vapor) | HarmonyOS(VDOM) | HarmonyOS(Vapor) |
1373
+ | :- | :- | :- | :- | :- | :- | :- | :- |
1374
+ | 4.0 | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | 4.0 | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | 4.11 | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | 4.61 | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> |
1375
+
1376
+ ##### 属性
1377
+ | 名称 | 类型 | 兼容性 | 描述 |
1378
+ | :- | :- | :-: | :- |
1379
+ | include | string | Web 4.0 / 微信小程序 x / Android(VDOM) 4.0 / Android(Vapor) x / iOS(VDOM) 4.11 / iOS(Vapor) x / HarmonyOS(VDOM) 4.61 / HarmonyOS(Vapor) x(部分支持,见上) | 字符串或正则表达式。只有名称匹配的组件会被缓存。 |
1380
+ | exclude | string | Web 4.0 / 微信小程序 x / Android(VDOM) 4.0 / Android(Vapor) x / iOS(VDOM) 4.11 / iOS(Vapor) x / HarmonyOS(VDOM) 4.61 / HarmonyOS(Vapor) x(部分支持,见上) | 字符串或正则表达式。任何名称匹配的组件都不会被缓存。 |
1381
+ | max | string | Web 4.0 / 微信小程序 x / Android(VDOM) 4.0 / Android(Vapor) x / iOS(VDOM) 4.11 / iOS(Vapor) x / HarmonyOS(VDOM) 4.61 / HarmonyOS(Vapor) x(部分支持,见上) | 最多可以缓存多少组件实例。 |
1382
+
1383
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/built-in/component/keep-alive/keep-alive-composition.uvue)
1384
+
1385
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/built-in/component/keep-alive/keep-alive-composition
1386
+
1387
+ > 组合式 API
1388
+
1389
+ ```vue
1390
+ <template>
1391
+
1392
+ <scroll-view style="flex: 1">
1393
+
1394
+ <view class="page">
1395
+ <text class="bold mb-10">include="Counter,Message"</text>
1396
+ <KeepAlive include="Counter,Message">
1397
+ <component :is="currentComponent"></component>
1398
+ </KeepAlive>
1399
+ <view class="hr"></view>
1400
+ <text class="bold mt-10 mb-10">:include="/Counter|Message/"</text>
1401
+ <KeepAlive :include="/Counter|Message/">
1402
+ <component :is="currentComponent"></component>
1403
+ </KeepAlive>
1404
+ <view class="hr"></view>
1405
+ <text class="bold mb-10 mb-10">:include="['Counter', 'Message']"</text>
1406
+ <KeepAlive :include="['Counter', 'Message']">
1407
+ <component :is="currentComponent"></component>
1408
+ </KeepAlive>
1409
+ <view class="hr"></view>
1410
+ <text class="bold mt-10 mb-10">exclude="ShouldExclude"</text>
1411
+ <KeepAlive exclude="ShouldExclude">
1412
+ <component :is="currentComponent"></component>
1413
+ </KeepAlive>
1414
+ <view class="hr"></view>
1415
+ <text class="bold mt-10 mb-10">:max="2"</text>
1416
+ <KeepAlive :max="2">
1417
+ <component :is="currentComponent"></component>
1418
+ </KeepAlive>
1419
+ <view class="hr"></view>
1420
+ <button class="mt-10 show-counter" @click="changeComponent('Counter')">show Counter</button>
1421
+ <button class="mt-10 show-message" @click="changeComponent('Message')">show Message</button>
1422
+ <button class="mt-10 show-should-exclude" @click="changeComponent('ShouldExclude')">show ShouldExclude</button>
1423
+ </view>
1424
+
1425
+ </scroll-view>
1426
+
1427
+ </template>
1428
+
1429
+ <style>
1430
+ .hr {
1431
+ margin: 30rpx 0;
1432
+ border-bottom: 1px solid #ccc;
1433
+ }
1434
+ </style>
1435
+ ```
1436
+
1437
+ >选项式 API
1438
+
1439
+ ```vue
1440
+ <template>
1441
+
1442
+ <scroll-view style="flex: 1">
1443
+
1444
+ <view class="page">
1445
+ <text class="bold mb-10">include "Counter,Message"</text>
1446
+ <KeepAlive include="Counter,Message">
1447
+ <component :is="currentComponent"></component>
1448
+ </KeepAlive>
1449
+ <view class="hr"></view>
1450
+ <text class="bold mt-10 mb-10">include "/Counter|Message/"</text>
1451
+ <KeepAlive :include="/Counter|Message/">
1452
+ <component :is="currentComponent"></component>
1453
+ </KeepAlive>
1454
+ <view class="hr"></view>
1455
+ <text class="bold mt-10 mb-10">include "['Counter', 'Message']"</text>
1456
+ <KeepAlive :include="['Counter', 'Message']">
1457
+ <component :is="currentComponent"></component>
1458
+ </KeepAlive>
1459
+ <view class="hr"></view>
1460
+ <text class="bold mt-10 mb-10">exclude "ShouldExclude"</text>
1461
+ <KeepAlive exclude="ShouldExclude">
1462
+ <component :is="currentComponent"></component>
1463
+ </KeepAlive>
1464
+ <view class="hr"></view>
1465
+ <text class="bold mt-10 mb-10">max 2</text>
1466
+ <KeepAlive :max="2">
1467
+ <component :is="currentComponent"></component>
1468
+ </KeepAlive>
1469
+ <view class="hr"></view>
1470
+ <button class="mt-10 show-counter" @click="changeComponent('Counter')">show Counter</button>
1471
+ <button class="mt-10 show-message" @click="changeComponent('Message')">show Message</button>
1472
+ <button class="mt-10 show-should-exclude" @click="changeComponent('ShouldExclude')">show ShouldExclude</button>
1473
+ </view>
1474
+
1475
+ </scroll-view>
1476
+
1477
+ </template>
1478
+
1479
+ <style>
1480
+ .hr {
1481
+ margin-top: 30rpx;
1482
+ border-bottom: 1px solid #ccc;
1483
+ }
1484
+ </style>
1485
+ ```
1486
+
1487
+ ##### 参见
1488
+ - [Reference](https://v3.cn.vuejs.org/api/built-in-components.html#keep-alive)
1489
+
1490
+ ### \<Transition> @transition
1491
+
1492
+ > 组件类型:string
1493
+
1494
+ \<transition> 元素作为单个元素/组件的过渡效果。\<transition> 只会把过渡效果应用到其包裹的内容上,而不会额外渲染 DOM 元素,也不会出现在检测过的组件层级中。
1495
+
1496
+ ##### 兼容性
1497
+ | Web | 微信小程序 | Android | iOS | HarmonyOS |
1498
+ | :- | :- | :- | :- | :- |
1499
+ | 4.0 | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> |
1500
+
1501
+ ##### 属性
1502
+ | 名称 | 类型 | 兼容性 | 描述 |
1503
+ | :- | :- | :-: | :- |
1504
+ | name | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 用于自动生成 CSS 过渡类名。例如:name: 'fade' 将自动拓展为.fade-enter,.fade-enter-active等。默认类名为 "v" |
1505
+ | appear | boolean | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 是否在初始渲染时使用过渡。默认为 false。 |
1506
+ | css | boolean | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 是否使用 CSS 过渡类。默认为 true。如果设置为 false,将只通过组件事件触发注册的 JavaScript 钩子。 |
1507
+ | type | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 指定过渡事件类型,侦听过渡何时结束。有效值为 "transition" 和 "animation"。默认 Vue.js 将自动检测出持续时间长的为过渡事件类型。 |
1508
+ | 合法值 |
1509
+ | :- |
1510
+ | transition |
1511
+ | animation |
1512
+ | mode | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 控制离开/进入的过渡时间序列。有效的模式有 "out-in" 和 "in-out";默认同时生效。 |
1513
+ | 合法值 |
1514
+ | :- |
1515
+ | out-in |
1516
+ | in-out |
1517
+ | duration | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 指定过渡的持续时间。默认情况下,Vue 会等待过渡所在根元素的第一个 transitionend 或 animationend 事件。 |
1518
+ | enter-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1519
+ | leave-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1520
+ | appear-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1521
+ | enter-to-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1522
+ | leave-to-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1523
+ | appear-to-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1524
+ | enter-active-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1525
+ | leave-active-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1526
+ | appear-active-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1527
+ | @before-enter | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1528
+ | @before-leave | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1529
+ | @before-appear | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1530
+ | @enter | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1531
+ | @leave | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1532
+ | @appear | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1533
+ | @after-enter | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1534
+ | @after-leave | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1535
+ | @after-appear | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1536
+ | @enter-cancelled | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1537
+ | @leave-cancelled | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | v-show only |
1538
+ | @appear-cancelled | Any | | |
1539
+
1540
+ ##### 参见
1541
+ - [Reference](https://v3.cn.vuejs.org/api/built-in-components.html#transition)
1542
+
1543
+ ### \<TransitionGroup> @transition-group
1544
+
1545
+ > 组件类型:string
1546
+
1547
+ \<transition-group> 元素作为多个元素/组件的过渡效果。\<transition-group> 渲染一个真实的 DOM 元素。默认渲染 \<span>,可以通过 tag 属性配置哪个元素应该被渲染。
1548
+
1549
+ ##### 兼容性
1550
+ | Web | 微信小程序 | Android | iOS | HarmonyOS |
1551
+ | :- | :- | :- | :- | :- |
1552
+ | 4.0 | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> |
1553
+
1554
+ ##### 属性
1555
+ | 名称 | 类型 | 兼容性 | 描述 |
1556
+ | :- | :- | :-: | :- |
1557
+ | tag | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 默认为 span。 |
1558
+ | move-class | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 覆盖移动过渡期间应用的 CSS 类。 |
1559
+ | name | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 用于自动生成 CSS 过渡类名。例如:name: 'fade' 将自动拓展为.fade-enter,.fade-enter-active等。默认类名为 "v" |
1560
+ | appear | boolean | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 是否在初始渲染时使用过渡。默认为 false。 |
1561
+ | css | boolean | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 是否使用 CSS 过渡类。默认为 true。如果设置为 false,将只通过组件事件触发注册的 JavaScript 钩子。 |
1562
+ | type | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 指定过渡事件类型,侦听过渡何时结束。有效值为 "transition" 和 "animation"。默认 Vue.js 将自动检测出持续时间长的为过渡事件类型。 |
1563
+ | 合法值 |
1564
+ | :- |
1565
+ | transition |
1566
+ | animation |
1567
+ | mode | Any | | |
1568
+ | duration | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | 指定过渡的持续时间。默认情况下,Vue 会等待过渡所在根元素的第一个 transitionend 或 animationend 事件。 |
1569
+ | enter-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1570
+ | leave-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1571
+ | appear-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1572
+ | enter-to-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1573
+ | leave-to-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1574
+ | appear-to-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1575
+ | enter-active-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1576
+ | leave-active-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1577
+ | appear-active-class | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1578
+ | @before-enter | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1579
+ | @before-leave | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1580
+ | @before-appear | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1581
+ | @enter | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1582
+ | @leave | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1583
+ | @appear | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1584
+ | @after-enter | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1585
+ | @after-leave | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1586
+ | @after-appear | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1587
+ | @enter-cancelled | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1588
+ | @leave-cancelled | string | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | v-show only |
1589
+ | @appear-cancelled | Any | Web 4.0 / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | |
1590
+
1591
+ ##### 参见
1592
+ - [Reference](https://v3.cn.vuejs.org/api/built-in-components.html#transition-group)
1593
+
1594
+ ### \<Teleport> @teleport
1595
+
1596
+ > 组件类型:string
1597
+
1598
+ Teleport 提供了一种干净的方法,允许我们控制在 DOM 中哪个父节点下呈现 HTML,而不必求助于全局状态或将其拆分为两个组件。
1599
+
1600
+ ##### 兼容性
1601
+ | Web | 微信小程序 | Android(VDOM) | Android(Vapor) | iOS(VDOM) | iOS(Vapor) | HarmonyOS(VDOM) | HarmonyOS(Vapor) |
1602
+ | :- | :- | :- | :- | :- | :- | :- | :- |
1603
+ | 4.0 | 5.14 | 4.0 | 5.25 | 4.11 | 5.25 | 4.61 | 5.25 |
1604
+
1605
+ ##### 属性
1606
+ | 名称 | 类型 | 兼容性 | 描述 |
1607
+ | :- | :- | :-: | :- |
1608
+ | to | string | Web 4.0 / 微信小程序 x / Android(VDOM) 4.0 / Android(Vapor) 5.25 / iOS(VDOM) 4.11 / iOS(Vapor) 5.25 / HarmonyOS(VDOM) 4.61 / HarmonyOS(Vapor) 5.25(部分支持,见上) | 必须是有效的查询选择器或 HTMLElement (如果在浏览器环境中使用)。指定将在其中移动 \<teleport> 内容的目标元素 |
1609
+ | disabled | boolean | Web 4.0 / 微信小程序 5.14 / Android(VDOM) 4.0 / Android(Vapor) 5.25 / iOS(VDOM) 4.11 / iOS(Vapor) 5.25 / HarmonyOS(VDOM) 4.61 / HarmonyOS(Vapor) 5.25 | 此可选属性可用于禁用 \<teleport> 的功能,这意味着其插槽内容将不会移动到任何位置,而是在您在周围父组件中指定了 \<teleport> 的位置渲染。 |
1610
+
1611
+ **VDOM模式注意事项**
1612
+
1613
+ - Android平台暂不支持动态修改 `to` 属性。
1614
+ - 鸿蒙平台和iOS平台暂不支持 `to` 设置为 `body`。
1615
+ - App平台和web平台 teleport 首次挂载时会立即查找目标节点,如果目标节点当时还没渲染出来,就会出现 Failed to locate Teleport target 警告,解决方法是用 v-if 配合 onReady 延迟显示。
1616
+
1617
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/built-in/component/teleport/teleport-composition.uvue)
1618
+
1619
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/built-in/component/teleport/teleport-composition
1620
+
1621
+ > 组合式 API
1622
+
1623
+ ```vue
1624
+ <template>
1625
+
1626
+ <scroll-view style="flex: 1">
1627
+
1628
+ <view id="container" class="container">
1629
+ <text class="text">.container 区域</text>
1630
+ <view id="content1" class="content content-1">
1631
+ <text class="text">content1 区域</text>
1632
+ </view>
1633
+ <view id="content2" class="content content-2">
1634
+ <text class="text">content2 区域</text>
1635
+ </view>
1636
+ <teleport v-if="show" to="#content1" :disabled="disabled">
1637
+ <view class="send-content">
1638
+ <text class="send-content-text">内容在.container中,使用teleport在#content1元素中展示</text>
1639
+ </view>
1640
+ </teleport>
1641
+ </view>
1642
+
1643
+ </scroll-view>
1644
+
1645
+ </template>
1646
+
1647
+ <style>
1648
+ .container {
1649
+ background-color: #f5f5f5;
1650
+ border: 1px #ccc solid;
1651
+ margin: 5px;
1652
+ padding: 10px;
1653
+ }
1654
+
1655
+ .text {
1656
+ margin: 5px 0;
1657
+ }
1658
+
1659
+ .content {
1660
+ height: 120px;
1661
+ border: 1px #ccc solid;
1662
+ margin: 5px;
1663
+ padding: 10px;
1664
+ }
1665
+
1666
+ .send-content {
1667
+ padding: 5px;
1668
+ background-color: #ff5a5f;
1669
+ height: 50px;
1670
+ }
1671
+
1672
+ .send-content-text {
1673
+ color: #fff;
1674
+ font-size: 12px;
1675
+ }
1676
+ </style>
1677
+ ```
1678
+
1679
+ >选项式 API
1680
+
1681
+ ```vue
1682
+ <template>
1683
+
1684
+ <scroll-view style="flex: 1">
1685
+
1686
+ <view id="container" class="container">
1687
+ <text class="text">.container 区域</text>
1688
+ <view id="content1" class="content content-1">
1689
+ <text class="text">content1 区域</text>
1690
+ </view>
1691
+ <view id="content2" class="content content-2">
1692
+ <text class="text">content2 区域</text>
1693
+ </view>
1694
+ <teleport v-if="show" to="#content1" :disabled="disabled">
1695
+ <view class="send-content">
1696
+ <text class="send-content-text">内容在.container中,使用teleport在#content1元素中展示</text>
1697
+ </view>
1698
+ </teleport>
1699
+ </view>
1700
+
1701
+ </scroll-view>
1702
+
1703
+ </template>
1704
+
1705
+ <style>
1706
+ .container {
1707
+ background-color: #f5f5f5;
1708
+ border: 1px #ccc solid;
1709
+ margin: 5px;
1710
+ padding: 10px;
1711
+ }
1712
+ .text {
1713
+ margin: 5px 0;
1714
+ }
1715
+
1716
+ .content {
1717
+ height: 120px;
1718
+ border: 1px #ccc solid;
1719
+ margin: 5px;
1720
+ padding: 10px;
1721
+ }
1722
+
1723
+ .send-content {
1724
+ padding: 5px;
1725
+ background-color: #ff5a5f;
1726
+ height: 50px;
1727
+ }
1728
+
1729
+ .send-content-text {
1730
+ color: #fff;
1731
+ font-size: 12px;
1732
+ }
1733
+ </style>
1734
+
1735
+ ```
1736
+
1737
+ ##### 参见
1738
+ - [Reference](https://v3.vuejs.org/api/built-in-components.html#teleport)
1739
+
1740
+ ## 特殊元素 @special-elements
1741
+
1742
+ ### \<template> @template
1743
+
1744
+ > 组件类型:string
1745
+
1746
+ 当我们想要使用内置指令而不在 DOM 中渲染元素时,\<template> 标签可以作为占位符使用。
1747
+
1748
+ ##### 兼容性
1749
+ | Web | 微信小程序 | Android | iOS | HarmonyOS |
1750
+ | :- | :- | :- | :- | :- |
1751
+ | 4.0 | √ | 3.9 | 4.11 | 4.61 |
1752
+
1753
+ `<template>` 有2个用途:
1754
+ 1. 作为单文件组件规范的模板根节点。在 `<template>` 下面放置页面模板真正的组件内容。
1755
+ 此时lang属性生效。但vue指令不生效。
1756
+
1757
+ 2. 在根 `<template>` 下面,继续放置`<template>`虚节点,可以让多个组件遵守相同的vue指令。
1758
+ 比如下面的示例中,通过`<template v-if="isShow">`包裹了text和button,让2个组件共同遵守同一个`v-if`指令,且不增加层级。
1759
+ 如果把这个子`<template>`改成`<view>`,会增加一层节点,层级太多会影响性能。
1760
+ ```vue
1761
+ <template>
1762
+ <view>
1763
+ <template v-if="isShow">
1764
+ <text>abc</text>
1765
+ <button>按钮</button>
1766
+ </template>
1767
+ <view></view>
1768
+ </view>
1769
+ </template>
1770
+ ```
1771
+
1772
+ 此时lang属性不生效。
1773
+
1774
+ ::: warning 注意
1775
+ 对非根的 `<template>` 的特殊处理,只有在它与以下任一指令一起使用时才会被触发:
1776
+
1777
+ - `v-if`、`v-else-if` 或 `v-else`
1778
+ - `v-for`
1779
+ - `v-slot`
1780
+
1781
+ 正常情况下,应该搭配如上vue指令使用。但异常情况下,如果这些指令都不存在,那么容错策略如下:\
1782
+ 在 `Web` 端将被渲染成一个[原生的 `<template>` 元素](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/template);\
1783
+ 在 `App` 端将被渲染成 `view`。此时会多个层级。
1784
+
1785
+ ##### 属性
1786
+ | 名称 | 类型 | 兼容性 |
1787
+ | :- | :- | :-: |
1788
+ | lang | string | Web 4.0 / 微信小程序 √ / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 |
1789
+ | 合法值 | 兼容性 | 描述 |
1790
+ | :- | :-: | :- |
1791
+ | html | Web 4.0 / 微信小程序 4.11 / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 | html |
1792
+ | pug | Web x / 微信小程序 x / Android x / iOS x / HarmonyOS x(部分支持,见上) | pug |
1793
+
1794
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/built-in/special-elements/template/template-composition.uvue)
1795
+
1796
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/built-in/special-elements/template/template-composition
1797
+
1798
+ > 组合式 API
1799
+
1800
+ ```vue
1801
+ <template>
1802
+ <view class="page">
1803
+ <template v-if="dataInfo.isShow">
1804
+ <text id="title">{{ title }}</text>
1805
+ </template>
1806
+ <template v-else>
1807
+ <text>隐藏标题时显示</text>
1808
+ </template>
1809
+
1810
+ <text class="mt-10 btn" id="show-botton" @click="handleShow">{{ dataInfo.isShow ? '点击隐藏' : '点击显示' }}</text>
1811
+ <template v-for="(item, index) in list" :key="index">
1812
+ <text :class="'item'">{{ index + 1 }}.{{ item.name }}</text>
1813
+ </template>
1814
+ <button @click="goMapStyle">跳转绑定 Map 类型 style 页面</button>
1815
+ </view>
1816
+ </template>
1817
+
1818
+ <style>
1819
+ .btn{
1820
+ border: 1px solid #eee;
1821
+ border-radius: 4px;
1822
+ text-align: center;
1823
+ padding-top: 8px;
1824
+ padding-bottom: 8px;
1825
+ }
1826
+ .item {
1827
+ margin: 15px;
1828
+ padding: 4px 8px;
1829
+ border: #eee solid 1px;
1830
+ }
1831
+ </style>
1832
+ ```
1833
+
1834
+ >选项式 API
1835
+
1836
+ ```vue
1837
+ <template>
1838
+ <view class="page">
1839
+ <template v-if="dataInfo.isShow">
1840
+ <text id="title">{{ title }}</text>
1841
+ </template>
1842
+ <template v-else>
1843
+ <text>隐藏标题时显示</text>
1844
+ </template>
1845
+ <text class="mt-10 btn" id="show-botton" @click="handleShow">{{ dataInfo.isShow ? '点击隐藏' : '点击显示' }}</text>
1846
+ <template v-for="(item, index) in list" :key="index">
1847
+ <text :class="'item'">{{ index + 1 }}.{{ item.name }}</text>
1848
+ </template>
1849
+ <button @click="goMapStyle">跳转绑定 Map 类型 style 页面</button>
1850
+ </view>
1851
+ </template>
1852
+
1853
+ <style>
1854
+ .btn{
1855
+ border: 1px solid #eee;
1856
+ border-radius: 4px;
1857
+ text-align: center;
1858
+ padding-top: 8px;
1859
+ padding-bottom: 8px;
1860
+ }
1861
+ .item {
1862
+ margin: 15px;
1863
+ padding: 4px 8px;
1864
+ border: #eee solid 1px;
1865
+ }
1866
+ </style>
1867
+
1868
+ ```
1869
+
1870
+ ##### 参见
1871
+ - [Reference](https://cn.vuejs.org/api/built-in-special-elements.html#template)
1872
+
1873
+ ### \<slot> @slot
1874
+
1875
+ > 组件类型:string
1876
+
1877
+ \<slot> 元素作为组件模板之中的内容分发插槽。\<slot> 元素自身将被替换。
1878
+
1879
+ ##### 兼容性
1880
+ | Web | 微信小程序 | Android | iOS | HarmonyOS |
1881
+ | :- | :- | :- | :- | :- |
1882
+ | 4.0 | 4.11 | 3.9 | 4.11 | 4.61 |
1883
+
1884
+ ##### 属性
1885
+ | 名称 | 类型 | 兼容性 | 描述 |
1886
+ | :- | :- | :-: | :- |
1887
+ | name | string | Web 4.0 / 微信小程序 √ / Android 3.9 / iOS 4.11 / HarmonyOS 4.61 | 用于命名插槽。 |
1888
+
1889
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/built-in/special-elements/slots/slots-composition.uvue)
1890
+
1891
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/built-in/special-elements/slots/slots-composition
1892
+
1893
+ > 组合式 API
1894
+
1895
+ ```vue
1896
+ <template>
1897
+ <view class="content">
1898
+ <child>
1899
+ <template v-slot:header="slotProps">
1900
+ <view class="header">{{ slotProps.msg }}</view>
1901
+ </template>
1902
+ <template v-slot:default="{ msg }">
1903
+ <view class="main">{{ msg }}</view>
1904
+ </template>
1905
+ <template #footer="{ msg: text }">
1906
+ <view class="footer">{{ text }}</view>
1907
+ </template>
1908
+ </child>
1909
+ </view>
1910
+ </template>
1911
+
1912
+ ```
1913
+
1914
+ >选项式 API
1915
+
1916
+ ```vue
1917
+ <template>
1918
+ <view class="content">
1919
+ <child>
1920
+ <template v-slot:header="slotProps">
1921
+ <view class="header">{{ slotProps.msg }}</view>
1922
+ </template>
1923
+ <template v-slot:default="{ msg }">
1924
+ <view class="main">{{ msg }}</view>
1925
+ </template>
1926
+ <template #footer="{ msg: text }">
1927
+ <view class="footer">{{ text }}</view>
1928
+ </template>
1929
+ </child>
1930
+ </view>
1931
+ </template>
1932
+
1933
+ ```
1934
+
1935
+ ##### 参见
1936
+ - [Reference](https://cn.vuejs.org/api/built-in-special-elements.html#slot)
1937
+
1938
+ ### \<component> @component
1939
+
1940
+ > 组件类型:string
1941
+
1942
+ 渲染一个“元组件”为动态组件。依 is 的值,来决定哪个组件被渲染。
1943
+
1944
+ ##### 兼容性
1945
+ | Web | 微信小程序 | Android | iOS | HarmonyOS |
1946
+ | :- | :- | :- | :- | :- |
1947
+ | 4.0 | <a style="color:unset;" href="https://vote.dcloud.net.cn/#/?name=uni-app%20x">x</a> | 3.99 | 4.11 | 4.61 |
1948
+
1949
+ ##### 属性
1950
+ | 名称 | 类型 | 兼容性 |
1951
+ | :- | :- | :-: |
1952
+ | is | Any | Web 4.0 / 微信小程序 x / Android 3.99 / iOS 4.11 / HarmonyOS 4.61(部分支持,见上) |
1953
+ | inline-template | boolean | Web 4.0 / 微信小程序 x / Android 3.99 / iOS 4.11 / HarmonyOS 4.61(部分支持,见上) |
1954
+
1955
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/built-in/special-elements/component/component-composition.uvue)
1956
+
1957
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/built-in/special-elements/component/component-composition
1958
+
1959
+ > 组合式 API
1960
+
1961
+ ```vue
1962
+ <template>
1963
+ <view class="container">
1964
+ <component :is="currentComponentInstance" />
1965
+ <component :is="myInput" :value="inputValue" id="my-input" />
1966
+ <button @click="changeCurrentComponent">change current component</button>
1967
+ </view>
1968
+ </template>
1969
+
1970
+
1971
+
1972
+ <style>
1973
+ .item {
1974
+ display: flex;
1975
+ flex-direction: row;
1976
+ margin: 15px;
1977
+ border: #eee solid 1px;
1978
+ }
1979
+ </style>
1980
+ ```
1981
+
1982
+ >选项式 API
1983
+
1984
+ ```vue
1985
+ <template>
1986
+ <view class="container">
1987
+ <component :is="currentComponentStr" />
1988
+ <component :is="currentComponentInstance" />
1989
+ <component :is="myInput" :value="inputValue" id="my-input" />
1990
+ <button @click="changeCurrentComponent">change current component</button>
1991
+ </view>
1992
+ </template>
1993
+
1994
+
1995
+
1996
+ <style>
1997
+ .item {
1998
+ display: flex;
1999
+ flex-direction: row;
2000
+ margin: 15px;
2001
+ border: #eee solid 1px;
2002
+ }
2003
+ </style>
2004
+ ```
2005
+
2006
+ ##### 参见
2007
+ - [Reference](https://cn.vuejs.org/api/built-in-special-elements.html#component)
2008
+
2009
+ ## 特殊 Attributes @special-attributes
2010
+
2011
+ | | Web | 微信小程序 | Android | iOS | HarmonyOS |
2012
+ | :- | :- | :- | :- | :- | :- |
2013
+ | key | 4.0 | √ | 3.9 | 4.11 | 4.61 |
2014
+ | ref | 4.0 | √ | 3.9 | 4.11 | 4.61 |
2015
+ | is | 4.0 | √ | 3.99 | 4.11 | 4.61 |
2016
+
2017
+ ### key
2018
+
2019
+ `key` 这个特殊的 attribute 主要作为 Vue 的虚拟 DOM 算法提示,在比较新旧节点列表时用于识别 vnode。
2020
+
2021
+ - 预期:`number | string | symbol`
2022
+
2023
+ - 详细信息
2024
+
2025
+ 在没有 key 的情况下,Vue 将使用一种最小化元素移动的算法,并尽可能地就地更新/复用相同类型的元素。如果传了 key,则将根据 key 的变化顺序来重新排列元素,并且将始终移除/销毁 key 已经不存在的元素。
2026
+
2027
+ 同一个父元素下的子元素必须具有唯一的 key。重复的 key 将会导致渲染异常。
2028
+
2029
+ 最常见的用例是与 `v-for` 结合:
2030
+
2031
+ ```vue
2032
+ <view>
2033
+ <text v-for="item in items" :key="item.id">...</text>
2034
+ </view>
2035
+ ```
2036
+
2037
+ 也可以用于强制替换一个元素/组件而不是复用它。当你想这么做时它可能会很有用:
2038
+
2039
+ - 在适当的时候触发组件的生命周期钩子
2040
+ - 触发过渡
2041
+
2042
+ 举例来说:
2043
+
2044
+ ```vue
2045
+ <transition>
2046
+ <text :key="text">{{ text }}</text>
2047
+ </transition>
2048
+ ```
2049
+
2050
+ 当 `text` 变化时,`<text>` 总是会被替换而不是更新,因此 transition 将会被触发。
2051
+
2052
+ ### ref
2053
+
2054
+ 用于注册模板引用。
2055
+
2056
+ - 预期:`string | Function`
2057
+
2058
+ - 详细信息
2059
+
2060
+ `ref` 用于注册元素或子组件的引用。
2061
+
2062
+ 使用选项式 API,引用将被注册在组件的 `this.$refs` 对象里:
2063
+
2064
+ ```vue
2065
+
2066
+ <template>
2067
+ <view>
2068
+ <input ref="input" />
2069
+ <text v-for="item in 3" ref="textItems" :key="item">{{
2070
+ item
2071
+ }}</text>
2072
+ <Foo ref="foo" />
2073
+ </view>
2074
+ </template>
2075
+ ```
2076
+ `this.$refs` 也是非响应式的,因此你不应该尝试在模板中使用它来进行数据绑定。
2077
+
2078
+ 使用组合式 API,引用将存储在与名字匹配的 ref 里:
2079
+ ```vue
2080
+
2081
+ <template>
2082
+ <view>
2083
+ <input ref="input" />
2084
+ <text v-for="item in 3" ref="textItems" :key="item">{{
2085
+ item
2086
+ }}</text>
2087
+ <Foo ref="foo" />
2088
+ </view>
2089
+ </template>
2090
+ ```
2091
+
2092
+ ```vue
2093
+
2094
+ <template>
2095
+ <view>
2096
+ <text>title: {{title}}</text>
2097
+ </view>
2098
+ </template>
2099
+
2100
+ ```
2101
+
2102
+ #### 获取内置组件与自定义组件的区别
2103
+ - 使用 `ref` 获取内置组件实例时会获取到对应的 `Element`,例如上述代码示例中,`input` 组件获取到的是 `UniInputElement`, `text` 组件获取到的是 `UniTextElement`,可以调用 `Element` 的方法和属性。
2104
+ - 使用 `ref` 获取自定义组件实例时会获取到对应的 vue 组件实例,例如上述代码示例中,`Foo` 组件获取到的是 `ComponentPublicInstance`,可以获取自定义组件的属性或调用方法,[详情](./component.md#page-call-component-method)。
2105
+ - 小程序平台如果期望使用`ref`获取到`UniElement`需要在此`UniElement`上设置id,此外小程序平台的`UniElement`使用是受限的,详情参考:[UniElement](../mp/README.md#unielement)
2106
+
2107
+ ### is
2108
+
2109
+ 用于绑定动态组件。
2110
+
2111
+ - 预期:`string | Component`
2112
+
2113
+ 示例 [详情](https://gitcode.com/dcloud/hello-uvue/blob/alpha/pages/built-in/special-attributes/key/key-composition.uvue)
2114
+
2115
+ ::: preview https://hellouvue.dcloud.net.cn/#/pages/built-in/special-attributes/key/key-composition
2116
+
2117
+ ```vue
2118
+ <template>
2119
+ <view style="flex: 1; padding: 20px;">
2120
+ <button id="btn" @click="switchItem">切换详情</button>
2121
+
2122
+ <text>页面当前 currentId: </text>
2123
+ <text id="current-id">{{ currentId }}</text>
2124
+
2125
+
2126
+ <view v-if="currentId != ''" style="margin-top: 20px;">
2127
+ <Child :key="currentId" :id="currentId" />
2128
+ </view>
2129
+ </view>
2130
+ </template>
2131
+
2132
+
2133
+ ```