From 7854afe9ec19539ae0e56302a3fdbb7aa9a4dbbc Mon Sep 17 00:00:00 2001
From: DCloud_LXH <283700113@qq.com>
Date: Sat, 30 Nov 2024 11:57:04 +0800
Subject: [PATCH] chore: uts com json
---
docs/.vuepress/utils/utsComJson.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/.vuepress/utils/utsComJson.json b/docs/.vuepress/utils/utsComJson.json
index ce16f5c5..c0966a31 100644
--- a/docs/.vuepress/utils/utsComJson.json
+++ b/docs/.vuepress/utils/utsComJson.json
@@ -1 +1 @@
-{"view":{"name":"## view","description":"> 组件类型:UniViewElement \n\n 基本视图容器","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| hover-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"none\" | | 指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果 |\n| hover-stop-propagation | boolean | false | | 指定是否阻止本节点的祖先节点出现点击态(祖先节点:指根节点到该节点路径上的所有节点都是这个节点的祖先节点) |\n| hover-start-time | number | 50 | | 按住后多久出现点击态,单位毫秒 |\n| hover-stay-time | number | 400 | | 手指松开后点击态保留时间,单位毫秒 |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/view/view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/view/view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/view/view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n hover_class: false,\r\n stop_propagation: false,\r\n start_time: 50,\r\n stay_time: 400,\r\n start_time_enum: [{ \"value\": 50, \"name\": \"50毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[],\r\n stay_time_enum: [{ \"value\": 400, \"name\": \"400毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[]\r\n }\r\n },\r\n methods: {\r\n change_hover_class_boolean(checked : boolean) {\r\n this.hover_class = checked\r\n },\r\n change_stop_propagation_boolean(checked : boolean) {\r\n this.stop_propagation = checked\r\n },\r\n radio_change_start_time_enum(time : number) {\r\n this.start_time = time\r\n },\r\n radio_change_stay_time_enum(time : number) {\r\n this.stay_time = time\r\n },\r\n },\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"scroll-view":{"name":"## scroll-view","description":"> 组件类型:UniScrollViewElement \n\n 可滚动视图容器","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | 渲染模式,可取值 nested |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested | | 嵌套模式。用于处理父子 scroll-view 间的嵌套滚动,子节点只能是 nested-scroll-header nested-scroll-body 组件或自定义 refresher |\n| direction | string | \"vertical\" | | 滚动方向,可取值 none、all、horizontal、vertical,默认值vertical |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 禁止滚动 |\n@| all | | 横向竖向都可滚动 app端不支持 |\n@| horizontal | | 横向滚动 |\n@| vertical | | 竖向滚动 |\n| associative-container | string | \"\" | | 关联的滚动容器 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested-scroll-view | | 嵌套滚动 |\n| enable-back-to-top | boolean | false | | iOS点击顶部状态栏滚动条返回顶部,只支持竖向 |\n| bounces | boolean | true | | 控制是否回弹效果 优先级高于rebound |\n| upper-threshold | number | 50 | | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 |\n| lower-threshold | number | 50 | | 距底部/右边多远时(单位px),触发 scrolltolower 事件 |\n| scroll-top | number | 0 | | 设置竖向滚动条位置 |\n| scroll-left | number | 0 | | 设置横向滚动条位置 |\n| scroll-into-view | string([string.IDString](/uts/data-type.md#ide-string)) | - | | 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素起始位置 |\n| scroll-with-animation | boolean | false | | 是否在设置滚动条位置时使用滚动动画,设置false没有滚动动画 |\n| refresher-enabled | boolean | false | | 开启下拉刷新,暂时不支持scroll-x = true横向刷新 |\n| refresher-threshold | number | 45 | | 设置下拉刷新阈值 |\n| refresher-max-drag-distance | number | - | | 设置下拉最大拖拽距离(单位px),默认是下拉刷新控件高度的2.5倍 |\n| refresher-default-style | string | \"black\" | | 设置下拉刷新默认样式,支持设置 black \\| white \\| none, none 表示不使用默认样式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| black | | 深颜色雪花样式 |\n@| white | | 浅白色雪花样式 |\n@| none | | 不使用默认样式 |\n| refresher-background | string([string.ColorString](/uts/data-type.md#ide-string)) | \"transparent\" | | 设置下拉刷新区域背景颜色,默认透明 |\n| refresher-triggered | boolean | false | | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\n| show-scrollbar | boolean | true | | 控制是否出现滚动条 |\n| custom-nested-scroll | boolean | false | | 子元素是否开启嵌套滚动 将滚动事件与父元素协商处理 |\n| nested-scroll-child | string([string.IDString](/uts/data-type.md#ide-string)) | \"\" | | 嵌套滚动子元素的id属性,不支持ref,scroll-view惯性滚动时会让对应id元素视图进行滚动,子元素滚动时会触发scroll-view的nestedprescroll事件,嵌套子元素需要设置custom-nested-scroll = true |\n| @refresherpulling | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新控件被下拉 |\n| @refresherrefresh | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被触发 |\n| @refresherrestore | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被复位 |\n| @refresherabort | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被中止 |\n| @scrolltoupper | (event: [UniScrollToUpperEvent](#uniscrolltoupperevent)) => void | - | | 滚动到顶部/左边,会触发 scrolltoupper 事件 |\n| @scrolltolower | (event: [UniScrollToLowerEvent](#uniscrolltolowerevent)) => void | - | | 滚动到底部/右边,会触发 scrolltolower 事件 |\n| @scroll | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @scrollend | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动结束时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @startnestedscroll | (event: [UniStartNestedScrollEvent](#unistartnestedscrollevent)) => Boolean | - | | 子元素开始滚动时触发, return true表示与子元素开启滚动协商 默认return false! event = {node} |\n| @nestedprescroll | (event: [UniNestedPreScrollEvent](#uninestedprescrollevent)) => void | - | | 子元素滚动时触发,可执行event.consumed(x,y)告知子元素deltaX、deltaY各消耗多少。子元素将执行差值后的deltaX、deltaY滚动距离。不执行consumed(x,y)则表示父元素不消耗deltaX、deltaY。event = {deltaX, deltaY} |\n| @stopnestedscroll | (event: [UniStopNestedScrollEvent](#unistopnestedscrollevent)) => void | - | | 子元素滚动结束或意外终止时触发 |\n| enable-passive | boolean | - | | - |\n| fast-deceleration | boolean | - | | - |\n| @dragstart | eventhandle | - | | - |\n| @dragging | eventhandle | - | | - |\n| @dragend | eventhandle | - | | - |\n| ~~rebound~~ | boolean | true | | 控制是否回弹效果。已废弃,请改用bounces |\n| ~~scroll-y~~ | boolean | true | | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-x~~ | boolean | false | | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |","event":"\n### 事件\n#### UniRefresherEvent\n\n```mermaid\ngraph LR\n \nUniRefresherEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRefresherEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dy | number | 是 | - | - | - |\n\n\n#### UniScrollToUpperEvent\n\n```mermaid\ngraph LR\n \nUniScrollToUpperEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToUpperEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 top 或 left |\n\n\n#### UniScrollToLowerEvent\n\n```mermaid\ngraph LR\n \nUniScrollToLowerEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToLowerEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 bottom 或 right |\n\n\n#### UniScrollEvent\n\n```mermaid\ngraph LR\n \nUniScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number | 是 | - | - | 竖向滚动的距离 |\n@| scrollLeft | number | 是 | - | - | 横向滚动的距离 |\n@| scrollHeight | number | 是 | - | - | 滚动区域的高度 |\n@| scrollWidth | number | 是 | - | - | 滚动区域的宽度 |\n@| deltaY | number | 是 | - | - | 当次滚动事件竖向滚动量 |\n@| deltaX | number | 是 | - | - | 当次滚动事件横向滚动量 |\n\n\n#### UniStartNestedScrollEvent\n\n```mermaid\ngraph LR\n \nUniStartNestedScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniStartNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| node | [UniElement](/dom/unielement.md) | 是 | - | - | 开始滚动子节点对象 |\n| isTouch | boolean | 是 | - | | 是否由触摸行为发生的Event |\n\n\n#### UniNestedPreScrollEvent\n\n```mermaid\ngraph LR\n \nUniNestedPreScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniNestedPreScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| deltaX | number | 是 | - | - | x轴滚动距离 |\n| deltaY | number | 是 | - | - | y轴滚动距离 |\n| isTouch | boolean | 是 | - | | 是否由触摸行为发生的Event |\n\n\n##### UniNestedPreScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| consumed | (consumedX: number, consumedY: number) => void | 是 | - | - | 通知到子节点x,y轴滚动距离的消耗 |\n\n#### UniStopNestedScrollEvent\n\n```mermaid\ngraph LR\n \nUniStopNestedScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniStopNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| isTouch | boolean | 是 | - | - | 是否由触摸行为发生的Event |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/scroll-view/scroll-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/scroll-view/scroll-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/scroll-view/scroll-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Vertical Scroll\r\n 纵向滚动\r\n \r\n \r\n \r\n A\r\n B\r\n C\r\n \r\n \r\n \r\n 点击这里返回顶部\r\n \r\n\r\n \r\n Horizontal Scroll\r\n 横向滚动\r\n \r\n \r\n \r\n A\r\n B\r\n C\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n type ScrollEventTest = {\r\n type : string;\r\n target : UniElement | null;\r\n currentTarget : UniElement | null;\r\n direction ?: string\r\n }\r\n export default {\r\n data() {\r\n return {\r\n scrollTop: 0,\r\n oldScrollTop: 0,\r\n scrollLeft: 120,\r\n showScrollbar: true,\r\n // 自动化测试\r\n isScrollTest: '',\r\n isScrolltolowerTest: '',\r\n isScrolltoupperTest: '',\r\n scrollDetailTest: null as UniScrollEventDetail | null,\r\n scrollEndDetailTest: null as UniScrollEventDetail | null,\r\n }\r\n },\r\n methods: {\r\n upper: function (e : UniScrollToUpperEvent) {\r\n console.log('滚动到顶部/左边', e)\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget,\r\n direction: e.detail.direction,\r\n } as ScrollEventTest, 'scrolltoupper')\r\n },\r\n lower: function (e : UniScrollToLowerEvent) {\r\n console.log('滚动到底部/右边', e)\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget,\r\n direction: e.detail.direction,\r\n } as ScrollEventTest, 'scrolltolower')\r\n },\r\n scroll: function (e : UniScrollEvent) {\r\n this.scrollDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as ScrollEventTest, 'scroll')\r\n this.oldScrollTop = e.detail.scrollTop\r\n },\r\n end: function (e : UniScrollEvent) {\r\n console.log('滚动结束时触发', e)\r\n this.scrollEndDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as ScrollEventTest, 'scrollend')\r\n },\r\n goTop: function () {\r\n // 解决view层不同步的问题\r\n this.scrollTop = this.oldScrollTop\r\n this.$nextTick(function () {\r\n this.scrollTop = 0\r\n })\r\n uni.showToast({\r\n icon: 'none',\r\n title: '纵向滚动 scrollTop 值已被修改为 0',\r\n })\r\n },\r\n // 自动化测试专用(由于事件event参数对象中存在循环引用,在ios端JSON.stringify报错,自动化测试无法page.data获取)\r\n checkEventTest(e : ScrollEventTest, eventName : String) {\r\n const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;\r\n const result = isPass ? `${eventName}:Success` : `${eventName}:Fail`;\r\n switch (eventName) {\r\n case 'scroll':\r\n this.isScrollTest = result\r\n break;\r\n case 'scrolltolower':\r\n this.isScrolltolowerTest = result + `-${e.direction}`\r\n break;\r\n case 'scrolltoupper':\r\n this.isScrolltoupperTest = result + `-${e.direction}`\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n // 自动化测试专用\r\n setVerticalScrollBy(y : number) {\r\n const element = uni.getElementById(\"verticalScrollView\")\r\n if (element != null) {\r\n element.scrollBy(0, y)\r\n }\r\n }\r\n },\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.scroll-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/scroll-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=scroll-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=scroll-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=scroll-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=scroll-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=scroll-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=scroll-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"swiper-item":{"name":"## swiper-item","description":"> 组件类型:UniSwiperItemElement \n\n swiper的唯一合法子组件。每个swiper-item代表一个滑块。宽高自动设置为100%","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | x | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| item-id | string | - | | 该 swiper-item 的标识符 |\n| skip-hidden-item-layout | boolean | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.swiper.swiper-item)\n- [参见uni-app相关文档](https://uniapp.dcloud.net.cn/component/swiper.html#swiper-item)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/swiper-item.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=swiper-item&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=swiper-item&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=swiper-item&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=swiper-item&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=swiper-item)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=swiper-item&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"swiper":{"name":"## swiper","description":"> 组件类型:UniSwiperElement \n\n 滑块视图容器","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| indicator-dots | boolean | false | | 是否显示面板指示点 |\n| indicator-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"rgba(0, 0, 0, .3)\" | | 指示点颜色 |\n| indicator-active-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#000000\" | | 当前选中的指示点颜色 |\n| active-class | string | - | | swiper-item 可见时的 class |\n| changing-class | boolean | - | | acceleration 设置为 {{true}} 时且处于滑动过程中,中间若干屏处于可见时的class |\n| acceleration | boolean | - | | 当开启时,会根据滑动速度,连续滑动多屏 |\n| disable-programmatic-animation | boolean | - | | 是否禁用代码变动触发 swiper 切换时使用动画。 |\n| disable-touch | boolean | false | | 是否禁止用户 touch 操作 |\n| touchable | boolean | - | | 是否监听用户的触摸事件 |\n| easing-function | string | - | | 指定 swiper 切换缓动动画类型,有效值:default、linear、easeInCubic、easeOutCubic、easeInOutCubic |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| default | | |\n@| linear | | |\n@| easeInCubic | | |\n@| easeOutCubic | | |\n@| easeInOutCubic | | |\n| autoplay | boolean | false | | 是否自动切换 |\n| current | number | 0 | | 当前所在滑块的 index |\n| current-item-id | string | - | | 当前所在滑块的 item-id ,不能与 current 被同时指定 |\n| interval | number | 3000 | | 自动切换时间间隔 |\n| duration | number | - | | 滑动动画时长 |\n| circular | boolean | false | | 是否采用衔接滑动 |\n| vertical | boolean | false | | 滑动方向是否为纵向 |\n| rebound | boolean | true | | 控制是否回弹效果 |\n| previous-margin | string | - | | 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值 |\n| next-margin | string | - | | 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值 |\n| display-multiple-items | number | - | | 同时显示的滑块数量 |\n| skip-hidden-item-layout | boolean | - | | 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息 |\n| @change | (event: [UniSwiperChangeEvent](#uniswiperchangeevent)) => void | - | | current 改变时会触发 change 事件,event.detail = {current: current, source: source} |\n| @transition | (event: [UniSwiperTransitionEvent](#uniswipertransitionevent)) => void | - | | swiper-item 的位置发生改变时会触发 transition 事件,event.detail = {dx: dx, dy: dy} |\n| @animationfinish | (event: [UniSwiperAnimationFinishEvent](#uniswiperanimationfinishevent)) => void | - | | 动画结束时会触发 animationfinish 事件,event.detail = {current: current, source: source} |","event":"\n### 事件\n#### UniSwiperChangeEvent\n\n```mermaid\ngraph LR\n \nUniSwiperChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniSwiperChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniSwiperChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| current | number | 是 | - | - | 发生change事件的滑块下标 |\n@| currentItemId | string | 否 | - | | 切换结束的 swiper-item 的 item-id 属性值 |\n@| source | string | 是 | - | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n\n#### UniSwiperTransitionEvent\n\n```mermaid\ngraph LR\n \nUniSwiperTransitionEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniSwiperTransitionEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniSwiperTransitionEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dx | number | 是 | - | - | 横向偏移量,单位是逻辑像素px |\n@| dy | number | 是 | - | - | 纵向偏移量,单位是逻辑像素px |\n\n\n#### UniSwiperAnimationFinishEvent\n\n```mermaid\ngraph LR\n \nUniSwiperAnimationFinishEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniSwiperAnimationFinishEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniSwiperAnimationFinishEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| current | number | 是 | - | - | 发生动画结束事件的滑块下标 |\n@| currentItemId | string | 否 | - | | 动画结束的 swiper-item 的 item-id 属性值 |\n@| source | string | 是 | - | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/swiper/swiper.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/swiper/swiper\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/swiper/swiper\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n A\r\n \r\n \r\n B\r\n \r\n \r\n C\r\n \r\n \r\n \r\n \r\n \r\n 是否显示面板指示点\r\n \r\n \r\n \r\n 是否自动切换\r\n \r\n \r\n \r\n 是否循环\r\n \r\n \r\n \r\n 是否显示rebound效果\r\n \r\n \r\n 间隔时间(毫秒)\r\n \r\n \r\n \r\n \r\n 定制指示器颜色\r\n \r\n \r\n \r\n 纵向\r\n \r\n \r\n \r\n 指定current为最后一个元素\r\n \r\n \r\n \r\n 指定current-item-id为最后一个元素\r\n \r\n \r\n \r\n 禁止用户 touch 操作\r\n \r\n \r\n \r\n swiperTransition 是否打印\r\n \r\n \r\n \r\n swiperAnimationfinish 是否打印\r\n \r\n \r\n \r\n swiperChange 是否打印\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n type SwiperEventTest = {\r\n type : string;\r\n target : UniElement | null;\r\n currentTarget : UniElement | null;\r\n }\r\n export default {\r\n data() {\r\n return {\r\n background: ['color1', 'color2', 'color3'],\r\n dotsSelect: false,\r\n reboundSelect: false,\r\n autoplaySelect: false,\r\n circularSelect: false,\r\n indicatorColorSelect: false,\r\n verticalSelect: false,\r\n currentSelect: false,\r\n currentItemIdSelect: false,\r\n intervalSelect: 2000,\r\n indicatorColor: \"\",\r\n indicatorColorActive: \"\",\r\n currentVal: 0,\r\n currentItemIdVal: \"\",\r\n disableTouchSelect: false,\r\n swiperTransitionSelect: false,\r\n swiperAnimationfinishSelect: false,\r\n swiperChangeSelect: false,\r\n currentValChange: 0,\r\n // 自动化测试\r\n changeDetailTest: null as UniSwiperChangeEventDetail | null,\r\n transitionDetailTest: null as UniSwiperTransitionEventDetail | null,\r\n animationfinishDetailTest: null as UniSwiperAnimationFinishEventDetail | null,\r\n isChangeTest: '',\r\n isTransitionTest: '',\r\n isAnimationfinishTest: '',\n swipeX: 0,\n swipeY: 0\r\n }\r\n },\n onReady() {\n // 获取模拟滑动手势的起始点\n let ele = uni.getElementById(\"swiper-view\")\n let eleRect = ele?.getBoundingClientRect()\r\n if(eleRect != null) {\r\n this.swipeX = eleRect.width - 10\r\n this.swipeY += eleRect.y + uni.getSystemInfoSync().safeArea.top + 44 + 35\r\n }\n },\r\n methods: {\n swipertouchStart(e: UniTouchEvent) {\n console.log(\"swiper touchstart\")\n },\n viewtouchStart(e: UniTouchEvent) {\n console.log(\"view touchstart:\")\n },\r\n swiperChange: function (e : UniSwiperChangeEvent) {\r\n this.changeDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as SwiperEventTest, 'change')\r\n this.currentValChange = e.detail.current\r\n console.log(this.currentValChange)\r\n if (this.swiperChangeSelect) {\r\n console.log(\"swiperChange\")\r\n console.log(e)\r\n }\r\n },\r\n swiperTransition: function (e : UniSwiperTransitionEvent) {\r\n this.transitionDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as SwiperEventTest, 'transition')\r\n if (this.swiperTransitionSelect) {\r\n console.log(\"swiperTransition\")\r\n console.log(e)\r\n }\r\n },\r\n swiperAnimationfinish: function (e : UniSwiperAnimationFinishEvent) {\r\n this.animationfinishDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as SwiperEventTest, 'animationfinish')\r\n if (this.swiperAnimationfinishSelect) {\r\n console.log(\"swiperAnimationfinish\")\r\n console.log(e)\r\n }\r\n },\r\n // 自动化测试专用(由于事件event参数对象中存在循环引用,在ios端JSON.stringify报错,自动化测试无法page.data获取)\r\n checkEventTest(e : SwiperEventTest, eventName : String) {\r\n const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;\r\n const result = isPass ? `${eventName}:Success` : `${eventName}:Fail`;\r\n switch (eventName) {\r\n case 'change':\r\n this.isChangeTest = result\r\n break;\r\n case 'transition':\r\n this.isTransitionTest = result\r\n break;\r\n case 'animationfinish':\r\n this.isAnimationfinishTest = result\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n dotsChange: function (e : UniSwitchChangeEvent) {\r\n this.dotsSelect = e.detail.value\r\n },\r\n swiperTransitionChange: function (e : UniSwitchChangeEvent) {\r\n this.swiperTransitionSelect = e.detail.value\r\n },\r\n swiperChangeChange: function (e : UniSwitchChangeEvent) {\r\n this.swiperChangeSelect = e.detail.value\r\n },\r\n swiperAnimationfinishChange: function (e : UniSwitchChangeEvent) {\r\n this.swiperAnimationfinishSelect = e.detail.value\r\n },\r\n autoplayChange: function (e : UniSwitchChangeEvent) {\r\n this.autoplaySelect = e.detail.value\r\n },\r\n verticalChange: function (e : UniSwitchChangeEvent) {\r\n this.verticalSelect = e.detail.value\r\n },\r\n disableTouchChange: function (e : UniSwitchChangeEvent) {\r\n this.disableTouchSelect = e.detail.value\r\n },\r\n currentItemIdChange: function (e : UniSwitchChangeEvent) {\r\n this.currentItemIdSelect = e.detail.value\r\n if (this.currentItemIdSelect) {\r\n this.currentItemIdVal = 'C'\r\n } else {\r\n this.currentItemIdVal = 'A'\r\n }\r\n },\r\n currentChange: function (e : UniSwitchChangeEvent) {\r\n this.currentSelect = e.detail.value\r\n if (this.currentSelect) {\r\n this.currentVal = 2\r\n } else {\r\n this.currentVal = 0\r\n }\r\n\r\n },\r\n circularChange: function (e : UniSwitchChangeEvent) {\r\n this.circularSelect = e.detail.value\r\n console.log(this.circularSelect)\r\n },\r\n reboundSelectChange: function (e : UniSwitchChangeEvent) {\r\n this.reboundSelect = e.detail.value\r\n console.log(this.reboundSelect)\r\n },\r\n sliderChange(e : UniSliderChangeEvent) {\r\n this.intervalSelect = e.detail.value\r\n },\r\n indicatorColorChange(e : UniSwitchChangeEvent) {\r\n this.indicatorColorSelect = e.detail.value\r\n if (this.indicatorColorSelect) {\r\n // 选择了定制指示器颜色\r\n this.indicatorColor = \"#ff00ff\"\r\n this.indicatorColorActive = \"#0000ff\"\r\n } else {\r\n // 没有选择颜色\r\n this.indicatorColor = \"\"\r\n this.indicatorColorActive = \"\"\r\n }\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [swiper-item](swiper-item.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.swiper.swiper)\n- [参见uni-app相关文档](https://uniapp.dcloud.net.cn/component/swiper.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=swiper&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=swiper&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=swiper&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=swiper&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=swiper)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=swiper&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"match-media":{"name":"## match-media","description":"media query 匹配检测节点","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| width | number | - | | 页面宽度(px 为单位) |\n| min-width | number | - | | 页面最小宽度(px 为单位) |\n| max-width | number | - | | 页面最大宽度(px 为单位) |\n| height | number | - | | 页面高度(px 为单位) |\n| min-height | number | - | | 页面最小高度(px 为单位) |\n| max-height | number | - | | 页面最大高度(px 为单位) |\n| orientation | string | - | | 屏幕方向(landscape 或 portrait) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| vertical | - | |\n@| horizontal | - | |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.match-media)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/match-media.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/match-media.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=match-media&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=match-media&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=match-media&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=match-media&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=match-media)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=match-media&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"movable-area":{"name":"## movable-area","description":"movable-view 的可移动区域","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| scale-area | boolean | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.movable.movable-area)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/movable-area.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/movable-area.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=movable-area&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=movable-area&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=movable-area&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=movable-area&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=movable-area)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=movable-area&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"movable-view":{"name":"## movable-view","description":"可移动的视图容器,在页面中可以拖拽滑动","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| direction | string | - | | movable-view的移动方向,属性值有all、vertical、horizontal、none |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| all | - | |\n@| vertical | - | |\n@| horizontal | - | |\n@| none | - | |\n| inertia | boolean | - | | movable-view 是否带有惯性。 |\n| out-of-bounds | boolean | - | | 超过可移动区域后,movable-view 是否还可以移动。 |\n| x | string \\\\| number | - | | 定义 x 轴方向的偏移,如果 x 的值不在可移动范围内,会自动移动到可移动范围;改变 x 的值会触发动画。 |\n| y | string \\\\| number | - | | 定义 y 轴方向的偏移,如果 y 的值不在可移动范围内,会自动移动到可移动范围;改变 y 的值会触发动画。 |\n| damping | number | - | | 阻尼系数,用于控制 x 或 y 改变时的动画和过界回弹的动画,值越大移动越快。 |\n| friction | number | - | | 摩擦系数,用于控制惯性滑动的动画,值越大摩擦力越大,滑动越快停止;必须大于0,否则会被设置成默认值 2。 |\n| disabled | boolean | - | | 是否禁用。 |\n| scale | boolean | - | | 是否支持双指缩放,默认缩放手势生效区域是在 movable-view 内。 |\n| scale-min | number | - | | 定义缩放倍数最小值,默认为 0.5。 |\n| scale-max | number | - | | 定义缩放倍数最大值,默认为 10。 |\n| scale-value | number | - | | 定义缩放倍数,取值范围为 0.5 - 10 |\n| animation | boolean | - | | 是否使用动画,默认为 true。 |\n| @change | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 拖动过程中触发的事件,event.detail = {x: x, y: y, source: source}。其中source表示产生移动的原因,值可为touch(拖动)、touch-out-of-bounds(超出移动范围)、out-of-bounds(超出移动范围后的回弹)、friction(惯性)和空字符串(setData)。 |\n| @scale | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 缩放过程中触发的事件,event.detail = {x: x, y: y, scale: scale}。 |\n| htouchmove | eventhandle | - | | - |\n| vtouchmove | eventhandle | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/movable-view/movable-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/movable-view/movable-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n 示例 1\r\n \\nmovable-view 区域小于 movable-area\r\n \r\n \r\n text\r\n \r\n \r\n 点击这里移动至 (30px, 30px)\r\n \r\n \r\n 示例 2\r\n \\nmovable-view区域大于movable-area\r\n \r\n \r\n text\r\n \r\n \r\n 示例 3\r\n \\n只可以横向移动\r\n \r\n \r\n text\r\n \r\n \r\n 示例 4\r\n \\n只可以纵向移动\r\n \r\n \r\n text\r\n \r\n \r\n 示例 5\r\n \\n可超出边界\r\n \r\n \r\n text\r\n \r\n \r\n 示例 6\r\n \\n带有惯性\r\n \r\n \r\n text\r\n \r\n \r\n 示例 7\r\n \\n可放缩\r\n \r\n \r\n text\r\n \r\n \r\n 点击这里放大3倍\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n x: 0,\r\n y: 0,\r\n scale: 2,\r\n old: {\r\n x: 0,\r\n y: 0,\r\n scale: 2\r\n }\r\n }\r\n },\r\n methods: {\r\n tap: function (e) {\r\n // 解决view层不同步的问题\r\n this.x = this.old.x\r\n this.y = this.old.y\r\n this.$nextTick(function () {\r\n this.x = 30\r\n this.y = 30\r\n })\r\n },\r\n tap2() {\r\n // 解决view层不同步的问题\r\n this.scale = this.old.scale\r\n this.scale = this.old.scale\r\n this.$nextTick(function () {\r\n this.scale = 3\r\n })\r\n },\r\n onChange: function (e) {\r\n this.old.x = e.detail.x\r\n this.old.y = e.detail.y\r\n },\r\n onScale: function (e) {\r\n this.old.scale = e.detail.scale\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.movable.movable-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/movable-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/movable-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=movable-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=movable-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=movable-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=movable-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=movable-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=movable-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"cover-view":{"name":"## cover-view","description":"覆盖在原生组件之上的文本视图,可覆盖的原生组件包括map、video、canvas、camera,只支持嵌套cover-view、cover-image","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| scroll-top | number/string | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/cover-view/cover-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/cover-view/cover-view\n\n>Template\n```vue\n\n \n \n \n 注意:需要正确配置地图服务商的Key才能正常显示地图组件\n \n \n \n 简单的cover-view\n \n \n \n\n\n\n\n\n\n```\n\n>Script\n```uts\n\n export default {\n data() {\n return {\n showMap: false,\n latitude: 39.909,\n longitude: 116.39742\n };\n },\n onLoad() {\n this.showMap = true\n }\n }\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.cover.cover-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/cover-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=cover-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=cover-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=cover-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=cover-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=cover-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=cover-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"cover-image":{"name":"## cover-image","description":"覆盖在原生组件之上的图片视图,可覆盖的原生组件同cover-view,支持嵌套在cover-view里。","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| v-for | Any | - | | - |\n| v-if | Any | - | | - |\n| v-show | Any | - | | - |\n| src | string([string.ImageURIString](/uts/data-type.md#ide-string)) | - | | 图标路径,支持临时路径、网络地址(1.6.0起支持)。暂不支持base64格式。 |\n| referrer-policy | string | - | | *(string)*
格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| origin | | |\n@| no-referrer | | |\n| @load | eventhandle | - | | - |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.cover.cover-image)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/cover-image.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/cover-image.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=cover-image&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=cover-image&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=cover-image&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=cover-image&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=cover-image)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=cover-image&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"list-item":{"name":"## list-item","description":"> 组件类型:UniListItemElement \n\n list-view组件的唯一合法子组件。每个item是一行","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.02 | x | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | number | 0 | | 对应list-item的类型 list-view 将对同类型条目进行复用,所以合理的类型拆分,可以很好地提升 list-view 性能 |","event":"","example":"","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.list-view.list-item)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=list-item&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=list-item&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=list-item&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=list-item&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=list-item&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=list-item)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=list-item&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"sticky-header":{"name":"## sticky-header","description":"> 组件类型:UniStickyHeaderElement \n\n 吸顶布局容器
注意:暂时仅支持作为list-view、sticky-section的子节点, sticky-header不支持css样式!当一个容器视图设置多个sticky-header时,后一个sticky-header会停靠在前一个sticky-header的末尾处。","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.02 | x | 3.93 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| padding | array\\ | [0,0,0,0\\] | | 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |\n| offset-top | number | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/sticky-header/sticky-header.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/sticky-header/sticky-header\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/sticky-header/sticky-header\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n {{i}}\r\n \r\n \r\n \r\n \r\n 向上滑动页面,体验sticky-header吸顶效果。\r\n \r\n \r\n \r\n \r\n \r\n {{name}}\r\n \r\n \r\n \r\n \r\n\r\n \r\n {{item}}\r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n sift_item: [\"排序\", \"筛选\"],\r\n list_item: [] as Array,\r\n refresher_enabled_boolean: true,\r\n refresher_triggered_boolean: false,\r\n scroll_top_input: 0\r\n }\r\n },\r\n onLoad() {\r\n let lists : Array = []\r\n for (let i = 0; i < 40; i++) {\r\n lists.push(\"item---\" + i)\r\n }\r\n this.list_item = lists\r\n },\r\n methods: {\r\n list_view_refresherrefresh() {\r\n console.log(\"下拉刷新被触发 \")\r\n this.refresher_triggered_boolean = true\r\n setTimeout(() => {\r\n this.refresher_triggered_boolean = false\r\n }, 1500)\r\n },\r\n confirm_scroll_top_input(value : number) {\r\n this.scroll_top_input = value\r\n },\r\n clickTH(index : number) {\r\n console.log(\"点击表头:\" + index);\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.sticky.sticky-header)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/sticky-header.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=sticky-header&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=sticky-header&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=sticky-header&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=sticky-header&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=sticky-header)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=sticky-header&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"sticky-section":{"name":"## sticky-section","description":"> 组件类型:UniStickySectionElement \n\n 吸顶布局容器
注意:暂时仅支持作为list-view的子节点, sticky-section不支持css样式!","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.02 | x | 3.98 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| push-pinned-header | boolean | true | | sticky-section元素重叠时是否继续上推 |\n| padding | array\\ | [0,0,0,0\\] | | 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/sticky-section/sticky-section.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/sticky-section/sticky-section\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/sticky-section/sticky-section\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{list.text}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export type sectionData = {\r\n name : string,\r\n list : sectionListItem[]\r\n }\r\n export type sectionListItem = {\r\n text : string\r\n }\r\n export default {\r\n data() {\r\n return {\r\n data: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'],\r\n sectionPadding: [0, 10, 0, 10] as Array,\r\n scrollIntoView: \"\",\r\n scrolling: false,\r\n sectionArray: [] as sectionData[],\r\n appendId: 0\r\n }\r\n },\r\n onLoad() {\r\n this.data.forEach(key => {\r\n const list = [] as sectionListItem[]\r\n for (let i = 1; i < 11; i++) {\r\n const item = { text: key + \"--item--content----\" + i } as sectionListItem\r\n list.push(item)\r\n }\r\n const data = { name: key, list: list } as sectionData\r\n this.sectionArray.push(data)\r\n }\r\n )\r\n },\r\n methods: {\r\n toTop() {\r\n this.scrollIntoView = \"\"\r\n uni.getElementById(\"list-view\")!.scrollTop = 0\r\n },\r\n //用于自动化测试\r\n listViewScrollByY(y : number) {\r\n const listview = this.$refs[\"list-view\"] as UniElement\r\n // listview.scrollBy(0, y)\r\n listview.scrollTop = y\r\n },\r\n gotoStickyHeader(id : string) {\r\n // #ifdef APP\r\n this.scrollIntoView = id\r\n // #endif\r\n // #ifdef WEB\r\n console.log(\"web端不支持该功能\")\r\n // #endif\r\n },\r\n onScroll() {\r\n this.scrolling = true\r\n },\r\n onScrollEnd() {\r\n this.scrolling = false\r\n //滚动后重置scrollIntoView = \"\"\r\n if (this.scrollIntoView != \"\") {\r\n this.scrollIntoView = \"\"\r\n }\r\n },\r\n appendSectionItem(index : number) {\r\n const data = this.sectionArray[index]\r\n this.appendId++\r\n const list = [\r\n { text: data.name + \"--item--content----new1--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new2--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new3--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new4--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new5--\" + this.appendId } as sectionListItem\r\n ] as sectionListItem[]\r\n data.list.unshift(...list)\r\n },\r\n deleteSection() {\r\n this.sectionArray.shift()\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.sticky.sticky-section)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/sticky-section.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=sticky-section&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=sticky-section&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=sticky-section&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=sticky-section&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=sticky-section)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=sticky-section&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"list-view":{"name":"## list-view","description":"> 组件类型:UniListViewElement \n\n 列表组件","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.02 | x | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| direction | string | \"vertical\" | | 滚动方向,可取值 none、horizontal、vertical,默认值vertical。注:iOS 平台仅支持vertical |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 禁止滚动 |\n@| horizontal | | 横向滚动 |\n@| vertical | | 竖向滚动 |\n| associative-container | string | \"\" | | 关联的滚动容器 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested-scroll-view | | 嵌套滚动 |\n| bounces | boolean | true | | 控制是否回弹效果 优先级高于rebound |\n| upper-threshold | number | 50 | | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 |\n| lower-threshold | number | 50 | | 距底部/右边多远时(单位px),触发 scrolltolower 事件 |\n| scroll-top | number | 0 | | 设置竖向滚动条位置 |\n| scroll-left | number | 0 | | 设置横向滚动条位置 |\n| show-scrollbar | boolean | true | | 控制是否出现滚动条 |\n| scroll-into-view | string([string.IDString](/uts/data-type.md#ide-string)) | - | | 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素起始位置 |\n| scroll-with-animation | boolean | false | | 是否在设置滚动条位置时使用滚动动画,设置false没有滚动动画 |\n| refresher-enabled | boolean | false | | 开启下拉刷新,暂时不支持scroll-x = true横向刷新 |\n| refresher-threshold | number | 45 | | 设置下拉刷新阈值, 仅 refresher-default-style = 'none' 自定义样式下生效 |\n| refresher-max-drag-distance | number | - | | 设置下拉最大拖拽距离(单位px),默认是下拉刷新控件高度的2.5倍 |\n| refresher-default-style | string | \"black\" | | 设置下拉刷新默认样式,支持设置 black \\| white \\| none, none 表示不使用默认样式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| black | | 深颜色雪花样式 |\n@| white | | 浅白色雪花样式 |\n@| none | | 不使用默认样式 |\n| refresher-background | string([string.ColorString](/uts/data-type.md#ide-string)) | \"transparent\" | | 设置下拉刷新区域背景颜色,默认透明 |\n| refresher-triggered | boolean | false | | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\n| enable-back-to-top | boolean | false | | iOS点击顶部状态栏滚动条返回顶部,只支持竖向 |\n| custom-nested-scroll | boolean | false | | 子元素是否开启嵌套滚动 将滚动事件与父元素协商处理 |\n| @refresherpulling | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新控件被下拉 |\n| @refresherrefresh | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被触发 |\n| @refresherrestore | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被复位 |\n| @refresherabort | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被中止 |\n| @scrolltoupper | (event: [UniScrollToUpperEvent](#uniscrolltoupperevent)) => void | - | | 滚动到顶部/左边,会触发 scrolltoupper 事件 |\n| @scrolltolower | (event: [UniScrollToLowerEvent](#uniscrolltolowerevent)) => void | - | | 滚动到底部/右边,会触发 scrolltolower 事件 |\n| @scroll | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @scrollend | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动结束时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| padding | Array | - | | - |\n| ~~rebound~~ | boolean | true | | 控制是否回弹效果。已废弃,请改用bounces |\n| ~~scroll-y~~ | boolean | true | | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-x~~ | boolean | false | | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |","event":"\n### 事件\n#### UniRefresherEvent\n\n```mermaid\ngraph LR\n \nUniRefresherEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRefresherEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dy | number | 是 | - | - | - |\n\n\n#### UniScrollToUpperEvent\n\n```mermaid\ngraph LR\n \nUniScrollToUpperEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToUpperEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 top 或 left |\n\n\n#### UniScrollToLowerEvent\n\n```mermaid\ngraph LR\n \nUniScrollToLowerEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToLowerEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 bottom 或 right |\n\n\n#### UniScrollEvent\n\n```mermaid\ngraph LR\n \nUniScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number | 是 | - | - | 竖向滚动的距离 |\n@| scrollLeft | number | 是 | - | - | 横向滚动的距离 |\n@| scrollHeight | number | 是 | - | - | 滚动区域的高度 |\n@| scrollWidth | number | 是 | - | - | 滚动区域的宽度 |\n@| deltaY | number | 是 | - | - | 当次滚动事件竖向滚动量 |\n@| deltaX | number | 是 | - | - | 当次滚动事件横向滚动量 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/list-view/list-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/list-view/list-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/list-view/list-view\n\n>Template\n```vue\n\n\n\n \n \n \n {{key}}\n \n \n \n {{text[state]}}\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n```\n\n>Script\n```uts\n\n type ScrollEventTest = {\n type : string;\n target : UniElement | null;\n currentTarget : UniElement | null;\n direction ?: string\n }\n import { ItemType } from '@/components/enum-data/enum-data-types'\n export default {\n data() {\n return {\n refresher_triggered_boolean: false,\n refresher_enabled_boolean: false,\n scroll_with_animation_boolean: false,\n show_scrollbar_boolean: false,\n bounces_boolean: true,\n scroll_y_boolean: true,\n scroll_x_boolean: false,\n scroll_direction: \"vertical\",\n upper_threshold_input: 50,\n lower_threshold_input: 50,\n scroll_top_input: 0,\n scroll_left_input: 0,\n refresher_background_input: \"#FFF\",\n scrollData: [] as Array,\n size_enum: [{ \"value\": 0, \"name\": \"item---0\" }, { \"value\": 3, \"name\": \"item---3\" }] as ItemType[],\n scrollIntoView: \"\",\n refresherrefresh: false,\n refresher_default_style_input: \"black\",\n text: ['继续下拉执行刷新', '释放立即刷新', '刷新中', \"\"],\n state: 3,\n reset: true,\n // 自动化测试\n isScrollTest: '',\n isScrolltolowerTest: '',\n isScrolltoupperTest: '',\n scrollDetailTest: null as UniScrollEventDetail | null,\n scrollEndDetailTest: null as UniScrollEventDetail | null,\n }\n },\n onLoad() {\n let lists : Array = []\n for (let i = 0; i < 10; i++) {\n lists.push(\"item---\" + i)\n }\n this.scrollData = lists\n },\n methods: {\n list_view_click() { console.log(\"组件被点击时触发\") },\n list_view_touchstart() { console.log(\"手指触摸动作开始\") },\n list_view_touchmove() { console.log(\"手指触摸后移动\") },\n list_view_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\n list_view_touchend() { console.log(\"手指触摸动作结束\") },\n list_view_tap() { console.log(\"手指触摸后马上离开\") },\n list_view_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\n list_view_refresherpulling(e : RefresherEvent) {\n console.log(\"下拉刷新控件被下拉\")\n if (this.reset) {\n if (e.detail.dy > 45) {\n this.state = 1\n } else {\n this.state = 0\n }\n }\n },\n list_view_refresherrefresh() {\n console.log(\"下拉刷新被触发 \")\n this.refresherrefresh = true\n this.refresher_triggered_boolean = true\n this.state = 2\n this.reset = false;\n setTimeout(() => {\n this.refresher_triggered_boolean = false\n }, 1500)\n },\n list_view_refresherrestore() {\n this.refresherrefresh = false\n this.state = 3\n this.reset = true\n console.log(\"下拉刷新被复位\")\n },\n list_view_refresherabort() { console.log(\"下拉刷新被中止\") },\n list_view_scrolltoupper(e : UniScrollToUpperEvent) {\n console.log(\"滚动到顶部/左边,会触发 scrolltoupper 事件 direction=\" + e.detail.direction)\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget,\n direction: e.detail.direction,\n } as ScrollEventTest, 'scrolltoupper')\n },\n list_view_scrolltolower(e : UniScrollToLowerEvent) {\n console.log(\"滚动到底部/右边,会触发 scrolltolower 事件 direction=\" + e.detail.direction)\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget,\n direction: e.detail.direction,\n } as ScrollEventTest, 'scrolltolower')\n },\n list_view_scroll(e : UniScrollEvent) {\n console.log(\"滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY}\")\n this.scrollDetailTest = e.detail\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget\n } as ScrollEventTest, 'scroll')\n },\n list_view_scrollend(e : UniScrollEvent) {\n console.log(\"滚动结束时触发\", e.detail)\n this.scrollEndDetailTest = e.detail\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget\n } as ScrollEventTest, 'scrollend')\n },\n list_item_click() { console.log(\"list-item组件被点击时触发\") },\n list_item_touchstart() { console.log(\"手指触摸list-item组件动作开始\") },\n list_item_touchmove() { console.log(\"手指触摸list-item组件后移动\") },\n list_item_touchcancel() { console.log(\"手指触摸list-item组件动作被打断,如来电提醒,弹窗\") },\n list_item_touchend() { console.log(\"手指触摸list-item组件动作结束\") },\n list_item_tap() { console.log(\"手指触摸list-item组件后马上离开\") },\n list_item_longpress() { console.log(\"list-item组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\n change_refresher_triggered_boolean(checked : boolean) { this.refresher_triggered_boolean = checked },\n change_refresher_enabled_boolean(checked : boolean) { this.refresher_enabled_boolean = checked },\n change_scroll_with_animation_boolean(checked : boolean) { this.scroll_with_animation_boolean = checked },\n change_show_scrollbar_boolean(checked : boolean) { this.show_scrollbar_boolean = checked },\n change_bounces_boolean(checked : boolean) { this.bounces_boolean = checked },\n change_scroll_y_boolean(checked : boolean) {\n this.scroll_y_boolean = checked\n this.change_scroll_direction()\n },\n change_scroll_x_boolean(checked : boolean) {\n this.scroll_x_boolean = checked\n this.change_scroll_direction()\n },\n change_scroll_direction() {\n if (this.scroll_y_boolean && this.scroll_x_boolean || this.scroll_y_boolean) {\n this.scroll_direction = \"vertical\"\n } else if (!this.scroll_y_boolean && !this.scroll_x_boolean) {\n this.scroll_direction = \"none\"\n } else if (!this.scroll_y_boolean && this.scroll_x_boolean) {\n this.scroll_direction = \"horizontal\"\n }\n },\n confirm_upper_threshold_input(value : number) { this.upper_threshold_input = value },\n confirm_lower_threshold_input(value : number) { this.lower_threshold_input = value },\n confirm_scroll_top_input(value : number) { this.scroll_top_input = value },\n confirm_scroll_left_input(value : number) { this.scroll_left_input = value },\n confirm_refresher_background_input(value : string) { this.refresher_background_input = value },\n item_change_size_enum(index : number) { this.scrollIntoView = \"item---\" + index },\n // 自动化测试专用(由于事件event参数对象中存在循环引用,在ios端JSON.stringify报错,自动化测试无法page.data获取)\n checkEventTest(e : ScrollEventTest, eventName : String) {\n const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;\n const result = isPass ? `${eventName}:Success` : `${eventName}:Fail`;\n switch (eventName) {\n case 'scroll':\n this.isScrollTest = result\n break;\n case 'scrolltolower':\n this.isScrolltolowerTest = result + `-${e.direction}`\n break;\n case 'scrolltoupper':\n this.isScrolltoupperTest = result + `-${e.direction}`\n break;\n default:\n break;\n }\n },\n //自动化测试例专用\n check_scroll_height() : Boolean {\n var listElement = this.$refs[\"listview\"] as UniElement\n console.log(\"check_scroll_height--\" + listElement.scrollHeight)\n if (listElement.scrollHeight > 2000) {\n return true\n }\n return false\n },\n //自动化测试例专用\n check_scroll_width() : Boolean {\n var listElement = this.$refs[\"listview\"] as UniElement\n console.log(\"check_scroll_width\" + listElement.scrollWidth)\n if (listElement.scrollWidth > 2000) {\n return true\n }\n return false\n },\n change_refresher_style_boolean(checked : boolean) {\n if (checked) {\n this.refresher_default_style_input = \"none\"\n } else {\n this.refresher_default_style_input = \"black\"\n }\n }\n }\n }\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [list-item](list-item.md) | |\n| [sticky-header](sticky-header.md) | |\n| [sticky-section](sticky-section.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.list-view.list-view)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/list-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=list-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=list-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=list-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=list-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=list-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=list-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"grid-item":{"name":"## grid-item","description":"> 组件类型:UniGridItemElement \n\n grid-view组件的唯一合法子组件。每个item","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | 4.37 | 4.37 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | number | 0 | | 对应grid-item的类型 grid-view 将对同类型条目进行复用,所以合理的类型拆分,可以很好地提升 grid-view 性能 |","event":"","example":"","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.grid-view.grid-item)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=grid-item&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=grid-item&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=grid-item&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=grid-item&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=grid-item&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=grid-item)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=grid-item&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"grid-view":{"name":"## grid-view","description":"> 组件类型:UniGridViewElement \n\n 表格组件","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | 4.37 | 4.37 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | *(string)*
布局方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| aligned | | |\n@| masonry | | |\n| cross-axis-count | number | - | | - |\n| max-cross-axis-extent | number | - | | - |\n| main-axis-gap | number | - | | - |\n| cross-axis-gap | number | - | | - |\n| padding | Array | - | | - |\n| associative-container | string | \"\" | | 关联的滚动容器 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested-scroll-view | | 嵌套滚动 |\n| bounces | boolean | true | | 控制是否回弹效果 |\n| upper-threshold | number | 50 | | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 |\n| lower-threshold | number | 50 | | 距底部/右边多远时(单位px),触发 scrolltolower 事件 |\n| scroll-top | number | 0 | | 设置竖向滚动条位置 |\n| show-scrollbar | boolean | true | | 控制是否出现滚动条 |\n| scroll-into-view | string([string.IDString](/uts/data-type.md#ide-string)) | - | | 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素起始位置 |\n| scroll-with-animation | boolean | false | | 是否在设置滚动条位置时使用滚动动画,设置false没有滚动动画 |\n| refresher-enabled | boolean | false | | 开启下拉刷新,暂时不支持scroll-x = true横向刷新 |\n| refresher-threshold | number | 45 | | 设置下拉刷新阈值, 仅 refresher-default-style = 'none' 自定义样式下生效 |\n| refresher-max-drag-distance | number | - | | 设置下拉最大拖拽距离(单位px),默认是下拉刷新控件高度的2.5倍 |\n| refresher-default-style | string | \"black\" | | 设置下拉刷新默认样式,支持设置 black \\| white \\| none, none 表示不使用默认样式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| black | | 深颜色雪花样式 |\n@| white | | 浅白色雪花样式 |\n@| none | | 不使用默认样式 |\n| refresher-background | string([string.ColorString](/uts/data-type.md#ide-string)) | \"transparent\" | | 设置下拉刷新区域背景颜色,默认透明 |\n| refresher-triggered | boolean | false | | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\n| enable-back-to-top | boolean | false | | iOS点击顶部状态栏滚动条返回顶部,只支持竖向 |\n| custom-nested-scroll | boolean | false | | 子元素是否开启嵌套滚动 将滚动事件与父元素协商处理 |\n| @refresherpulling | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新控件被下拉 |\n| @refresherrefresh | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被触发 |\n| @refresherrestore | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被复位 |\n| @refresherabort | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被中止 |\n| @scrolltoupper | (event: [UniScrollToUpperEvent](#uniscrolltoupperevent)) => void | - | | 滚动到顶部/左边,会触发 scrolltoupper 事件 |\n| @scroll | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @scrollend | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动结束时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |","event":"\n### 事件\n#### UniRefresherEvent\n\n```mermaid\ngraph LR\n \nUniRefresherEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRefresherEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dy | number | 是 | - | - | - |\n\n\n#### UniScrollToUpperEvent\n\n```mermaid\ngraph LR\n \nUniScrollToUpperEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToUpperEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 top 或 left |\n\n\n#### UniScrollEvent\n\n```mermaid\ngraph LR\n \nUniScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number | 是 | - | - | 竖向滚动的距离 |\n@| scrollLeft | number | 是 | - | - | 横向滚动的距离 |\n@| scrollHeight | number | 是 | - | - | 滚动区域的高度 |\n@| scrollWidth | number | 是 | - | - | 滚动区域的宽度 |\n@| deltaY | number | 是 | - | - | 当次滚动事件竖向滚动量 |\n@| deltaX | number | 是 | - | - | 当次滚动事件横向滚动量 |\n\n","example":"","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [grid-item](grid-item.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.grid-view)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/grid-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=grid-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=grid-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=grid-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=grid-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=grid-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=grid-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"nested-scroll-header":{"name":"## nested-scroll-header","description":"> 组件类型:UniNestedScrollHeaderElement \n\n scroll-view 嵌套模式场景中属于外层 scroll-view 的节点,仅支持作为 \\ 嵌套模式的直接子节点。不支持复数子节点,渲染时会取其第一个子节点来渲染","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | 4.11 | 4.11 |\n","attribute":"","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/nested-scroll-header/nested-scroll-header.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/nested-scroll-header/nested-scroll-header\n```uvue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{key}}\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.nested-scroll.nested-scroll-header)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/nested-scroll-header.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=nested-scroll-header&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=nested-scroll-header&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=nested-scroll-header&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=nested-scroll-header&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=nested-scroll-header)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=nested-scroll-header&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"nested-scroll-body":{"name":"## nested-scroll-body","description":"> 组件类型:UniNestedScrollHeaderElement \n\n scroll-view 嵌套模式场景中属于嵌套内层 scroll-view 的父节点,仅支持作为 \\ 嵌套模式的直接子节点。不支持复数子节点,渲染时会取其第一个子节点来渲染","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | 4.11 | 4.11 |\n","attribute":"","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/nested-scroll-body/nested-scroll-body.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/nested-scroll-body/nested-scroll-body\n```uvue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n nested-scroll-body\r\n \r\n \r\n \r\n \r\n \r\n {{key}}\r\n \r\n \r\n \r\n \r\n 不会渲染,因为 nested-scroll-body 只会渲染第一个子节点\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.nested-scroll.nested-scroll-body)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/nested-scroll-body.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=nested-scroll-body&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=nested-scroll-body&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=nested-scroll-body&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=nested-scroll-body&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=nested-scroll-body)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=nested-scroll-body&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"page-container":{"name":"## page-container","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| show | boolean | - | | - |\n| duration | number | - | | - |\n| z-index | number | - | | - |\n| overlay | boolean | - | | - |\n| position | string | - | | - |\n| round | boolean | - | | - |\n| close-on-slide-down | boolean | - | | - |\n| overlay-style | string | - | | - |\n| custom-style | string | - | | - |\n| @:beforeenter | eventhandle | - | | - |\n| @:enter | eventhandle | - | | - |\n| @:afterenter | eventhandle | - | | - |\n| @:beforeleave | eventhandle | - | | - |\n| @:leave | eventhandle | - | | - |\n| @:afterleave | eventhandle | - | | - |\n| @:clickoverlay | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.page-container)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html)"},"root-portal":{"name":"## root-portal","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| enable | boolean | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.root-portal)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/root-portal.html)"},"icon":{"name":"## icon","description":"图标","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | icon的类型,有效值:success, success_no_circle, info, warn, waiting, cancel, download, search, clear |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| success | - | |\n@| success_no_circle | - | |\n@| warn | - | |\n@| waiting | - | |\n@| cancel | - | |\n@| download | - | |\n@| search | - | |\n@| clear | - | |\n| size | number | - | | icon的大小,单位px |\n| color | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | icon的颜色,同css的color |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.icon)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/icon.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/icon.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=icon&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=icon&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=icon&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=icon&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=icon)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=icon&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"text":{"name":"## text","description":"> 组件类型:[UniTextElement](/dom/unitextelement.md) \n\n 文本","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| selectable | boolean | false | | 文本是否可选 |\n| space | string | - | | 显示连续空格 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| ensp | | 中文字符空格一半大小 |\n@| emsp | | 中文字符空格大小 |\n@| nbsp | | 根据字体设置的空格大小 |\n| decode | boolean | false | | 是否解码 (app平台如需解析字符实体,需要配置为 true) |\n| user-select | boolean | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/text/text.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/text/text\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/text/text\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{ text }}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'text',\r\n texts: [\r\n 'HBuilderX,轻巧、极速,极客编辑器',\r\n 'uni-app x,终极跨平台方案',\r\n 'uniCloud,js serverless云服务',\r\n 'uts,大一统语言',\r\n 'uniMPSdk,让你的App具备小程序能力',\r\n 'uni-admin,开源、现成的全端管理后台',\r\n 'uni-id,开源、全端的账户中心',\r\n 'uni-pay,开源、云端一体、全平台的支付',\r\n 'uni-ai,聚合ai能力',\r\n 'uni-cms,开源、云端一体、全平台的内容管理平台',\r\n 'uni-im,开源、云端一体、全平台的im即时消息',\r\n 'uni统计,开源、完善、全平台的统计报表',\r\n '......'\r\n ] as string[],\r\n text: '',\r\n canAdd: true,\r\n canRemove: false,\r\n extraLine: [] as string[]\r\n }\r\n },\r\n methods: {\r\n add: function () {\r\n this.extraLine.push(this.texts[this.extraLine.length % 12]);\r\n this.text = this.extraLine.join('\\n');\r\n this.canAdd = this.extraLine.length < 12;\r\n this.canRemove = this.extraLine.length > 0;\r\n },\r\n remove: function () {\r\n if (this.extraLine.length > 0) {\r\n this.extraLine.pop();\r\n this.text = this.extraLine.join('\\n');\r\n this.canAdd = this.extraLine.length < 12;\r\n this.canRemove = this.extraLine.length > 0;\r\n }\r\n },\r\n textProps: function () {\r\n uni.navigateTo({\r\n url: '/pages/component/text/text-props'\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [text](text.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.text)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/text.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/text.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=text&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=text&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=text&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=text&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=text)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=text&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"rich-text":{"name":"## rich-text","description":"> 组件类型:UniRichTextElement \n\n 富文本。可渲染文字样式、图片、超链接。支持部分HTML标签","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| nodes | array \\\\| string | - | | 节点列表 \\| HTML String |\n| selectable | boolean | false | | 文本是否可选 |\n| @itemclick | (event: [UniRichTextItemClickEvent](#unirichtextitemclickevent)) => void | - | | 拦截点击事件(只支持 a、img标签),返回img标签的src属性或a标签的href属性。event.detail={ src \\| href } |\n| space | string | - | | *(string)*
显示连续空格 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| ensp | | |\n@| emsp | | |\n@| nbsp | | |\n| user-select | boolean | - | | - |","event":"\n### 事件\n#### UniRichTextItemClickEvent\n\n```mermaid\ngraph LR\n \nUniRichTextItemClickEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRichTextItemClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRichTextItemClickEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | string | 否 | - | - | \\图片链接 |\n@| href | string | 否 | - | - | \\超链接 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/rich-text/rich-text.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/rich-text/rich-text\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/rich-text/rich-text\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n selectable\r\n \r\n \r\n \r\n \r\n \r\n rich-text-parent\r\n {{richTextStr}}\r\n \r\n \n \n \n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n text: \"hello uni-app x!
uni-app x,终极跨平台方案\",\r\n richTextHeight: 0,\r\n richTextElement: null as UniElement | null,\r\n // 自动化测试\r\n autoTest: false,\r\n testNodes: '',\r\n isItemClickTrigger: false,\r\n richTextStr: false\r\n }\r\n },\r\n onReady() {\r\n this.richTextElement = uni.getElementById('richtext') as UniElement\r\n setTimeout(() => {\r\n this.updateRichTextHeight()\r\n }, 2500)\r\n },\r\n methods: {\r\n changeText() {\r\n if (this.text === \"hello uni-app x!
uni-app x,终极跨平台方案\") {\r\n this.text = \"hello uni-app x!
uni-app x,终极跨平台方案
\"\r\n } else {\r\n this.text = \"hello uni-app x!
uni-app x,终极跨平台方案\"\r\n }\r\n setTimeout(() => {\r\n this.updateRichTextHeight()\r\n }, 200)\r\n },\r\n updateRichTextHeight() {\r\n if (this.richTextElement != null) {\r\n const elRect = this.richTextElement!.getBoundingClientRect()\r\n this.richTextHeight = elRect.height\r\n console.log('richTextHeight:', this.richTextHeight)\r\n }\r\n },\r\n // 自动化测试\r\n itemClickForTest(_ : RichTextItemClickEvent) {\r\n this.isItemClickTrigger = true;\r\n },\r\n getBoundingClientRectForTest() : DOMRect {\r\n return uni.getElementById('test-rich-text')?.getBoundingClientRect()!;\r\n },\r\n getWindowInfoForTest() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n richTextParentClick() {\r\n this.richTextStr = true;\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.rich-text)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/rich-text.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=rich-text&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=rich-text&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=rich-text&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=rich-text&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=rich-text)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=rich-text&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"progress":{"name":"## progress","description":"> 组件类型:UniProgressElement \n\n 进度条","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| duration | number | 30 | | 进度增加1%所需毫秒数 |\n| percent | number | 0 | | 百分比0~100 |\n| show-info | boolean | false | | 在进度条右侧显示百分比 |\n| border-radius | number | 0 | | 圆角大小 |\n| font-size | number | 16 | | 右侧百分比字体大小 |\n| stroke-width | number | 6 | | 进度条线的宽度,单位px |\n| activeColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#09BB07\" | | 已选择的进度条的颜色 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#EBEBEB\" | | 未选择的进度条的颜色 |\n| active | boolean | false | | 进度条从左往右的动画 |\n| active-mode | string | \"backwards\" | | backwards: 动画从头播;forwards:动画从上次结束点接着播 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| backwards | | 动画从头播 |\n@| forwards | | 动画从上次结束点接着播 |\n| @activeend | (event: [UniProgressActiveendEvent](#uniprogressactiveendevent)) => void | - | | 动画完成事件 |\n| color | string | - | | - |","event":"\n### 事件\n#### UniProgressActiveendEvent\n\n```mermaid\ngraph LR\n \nUniProgressActiveendEvent -- Extends --> UniCustomEvent<UniProgressActiveendEventDetail>\n style UniCustomEvent<UniProgressActiveendEventDetail> color:#42b983\n click UniCustomEvent<UniProgressActiveendEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniProgressActiveendEventDetail\n\n\n###### UniProgressActiveendEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| curPercent | number | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/progress/progress.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/progress/progress\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/progress/progress\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { state, setEventCallbackNum } from '@/store/index.uts'\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n title: 'progress',\r\n pgList: [0, 0, 0, 0] as number[],\r\n curPercent: 0,\r\n showInfo: true,\r\n borderRadius: 0,\r\n fontSize: 16,\r\n strokeWidth: 3,\r\n backgroundColor: '#EBEBEB',\r\n\r\n // 组件属性 autotest\r\n active_boolean: false,\r\n show_info_boolean: false,\r\n duration_input: 30,\r\n percent_input: 0,\r\n stroke_width_input: 6,\r\n activeColor_input: \"#09BB07\",\r\n backgroundColor_input: \"#EBEBEB\",\r\n active_mode_enum: [{ \"value\": 0, \"name\": \"backwards\" }, { \"value\": 1, \"name\": \"forwards\" }] as ItemType[],\r\n active_mode_enum_current: 0\r\n }\r\n },\r\n methods: {\r\n // 自动化测试\r\n getEventCallbackNum() : number {\r\n return state.eventCallbackNum\r\n },\r\n // 自动化测试\r\n setEventCallbackNum(num : number) {\r\n setEventCallbackNum(num)\r\n },\r\n\r\n setProgress() {\r\n this.pgList = [20, 40, 60, 80] as number[]\r\n },\r\n clearProgress() {\r\n this.pgList = [0, 0, 0, 0] as number[]\r\n },\r\n activeend(e : UniProgressActiveendEvent) {\r\n // 自动化测试\r\n if ((e.target?.tagName ?? '').includes('PROGRESS')) {\r\n this.setEventCallbackNum(state.eventCallbackNum + 1)\r\n }\r\n if (e.type === 'activeend') {\r\n this.setEventCallbackNum(state.eventCallbackNum + 2)\r\n }\r\n this.curPercent = e.detail.curPercent\r\n },\r\n progress_touchstart() { console.log(\"手指触摸动作开始\") },\r\n progress_touchmove() { console.log(\"手指触摸后移动\") },\r\n progress_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n progress_touchend() { console.log(\"手指触摸动作结束\") },\r\n progress_tap() { console.log(\"手指触摸后马上离开\") },\r\n change_active_boolean(checked : boolean) { this.active_boolean = checked },\r\n change_show_info_boolean(checked : boolean) { this.show_info_boolean = checked },\r\n confirm_duration_input(value : number) { this.duration_input = value },\r\n confirm_percent_input(value : number) { this.percent_input = value },\r\n confirm_stroke_width_input(value : number) { this.stroke_width_input = value },\r\n confirm_activeColor_input(value : string) { this.activeColor_input = value },\r\n confirm_backgroundColor_input(value : string) { this.backgroundColor_input = value },\r\n radio_change_active_mode_enum(checked : number) { this.active_mode_enum_current = checked }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.progress)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/progress.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/progress.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=progress&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=progress&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=progress&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=progress&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=progress)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=progress&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"native-view":{"name":"## native-view","description":"> 组件类型:[UniNativeViewElement](/dom/uninativeviewelement.md) \n\n 自定义原生View组件","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | 4.31 | 4.31 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| @init | (event: [UniNativeViewInitEvent](#uninativeviewinitevent)) => void | - | | native-view初始化时回调,event.detail = { element: 'native-view元素实例对象'} |","event":"\n### 事件\n#### UniNativeViewInitEvent\nnative-view 组件 init事件event\n```mermaid\ngraph LR\n \nUniNativeViewInitEvent -- Extends --> UniCustomEvent<UniNativeViewInitEventDetail>\n style UniCustomEvent<UniNativeViewInitEventDetail> color:#42b983\n click UniCustomEvent<UniNativeViewInitEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniNativeViewInitEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniNativeViewInitEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| element | [UniNativeViewElement](/dom/uninativeviewelement.md) | 是 | - | - | - |\n| type | string | 是 | - | - | - |\n\n\n##### UniNativeViewInitEventDetail\n\n\n###### UniNativeViewInitEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| element | [UniNativeViewElement](/dom/uninativeviewelement.md) | 是 | - | - | - |\n\n","example":"### 示例\n#### native-view\n展示使用 native-view 封装的原生view的UTS插件-标准模式组件\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/native-view/native-view.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/native-view/native-view\n```uvue\n\r\n \n 说明:如果本地无 uts 插件编译环境请提交打包自定义基座查看效果\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::\n#### native-button\n通过 native-view 绑定原生 button 实现的UTS插件-标准模式组件\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//uni_modules/native-button/components/native-button/native-button.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n```uvue\n\r\n\t\r\n\r\n\r\n\n```","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.native-view)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=native-view&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=native-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=native-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=native-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=native-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=native-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=native-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"button":{"name":"## button","description":"> 组件类型:UniButtonElement \n\n 按钮","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | √ | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | false | | 是否禁用 |\n| hover-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"button-hover\" | | 指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果 |\n| hover-stop-propagation | boolean | - | | 指定是否阻止本节点的祖先节点出现点击态 |\n| hover-start-time | number | 20 | | 按住后多久出现点击态,单位毫秒 |\n| hover-stay-time | number | 70 | | 手指松开后点击态保留时间,单位毫秒 |\n| size | string | \"default\" | | 按钮的大小 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| default | | 默认大小 |\n@| mini | | 小尺寸 |\n| type | string | \"default\" | | 按钮的样式类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| default | | 白色 |\n@| primary | | 蓝色 |\n@| warn | | 红色 |\n| plain | boolean | false | | 按钮是否镂空,背景色透明 |\n| loading | boolean | - | | 名称前是否带 loading 图标 |\n| form-type | string | - | | 用于 form 组件,点击分别会触发 form 组件的 submit/reset 事件 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| submit | | 提交表单 |\n@| reset | | 重置表单 |\n| open-type | string | - | | 开放能力 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| agreePrivacyAuthorization | | 用户同意隐私协议按钮。用户点击一次此按钮后,所有已声明过的隐私接口可以正常调用。 |\n@| feedback | | 打开“意见反馈”页面,用户可提交反馈内容并上传日志 |\n@| share | | 触发用户转发 |\n@| getUserInfo | | 获取用户信息,可以从@getuserinfo回调中获取到用户信息 |\n@| contact | | 打开客服会话,如果用户在会话中点击消息卡片后返回应用,可以从 @contact 回调中获得具体信息 |\n@| getPhoneNumber | | 获取用户手机号,可以从@getphonenumber回调中获取到用户信息 |\n@| launchApp | | 打开APP,可以通过app-parameter属性设定向APP传的参数 |\n@| openSetting | | 打开授权设置页 |\n@| chooseAvatar | | 获取用户头像,可以从@chooseavatar回调中获取到头像信息 |\n@| getAuthorize | | 支持小程序授权 |\n@| lifestyle | | 关注生活号 |\n@| contactShare | | 分享到通讯录好友 |\n@| openGroupProfile | | 呼起QQ群资料卡页面,可以通过group-id属性设定需要打开的群资料卡的群号,同时manifest.json中必须配置groupIdList |\n@| openGuildProfile | | 呼起频道页面,可以通过guild-id属性设定需要打开的频道ID |\n@| openPublicProfile | | 打开公众号资料卡,可以通过public-id属性设定需要打开的公众号资料卡的号码,同时manifest.json中必须配置publicIdList |\n@| shareMessageToFriend | | 在自定义开放数据域组件中,向指定好友发起分享据 |\n@| addFriend | | 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功用户授权 |\n@| addColorSign | | 添加彩签,点击后添加状态有用户提示,无回调 |\n@| addGroupApp | | 添加群应用(只有管理员或群主有权操作),添加后给button绑定@addgroupapp事件接收回调数据 |\n@| addToFavorites | | 收藏当前页面,点击按钮后会触发Page.onAddToFavorites方法 |\n@| chooseAddress | | 选择用户收货地址,可以从@chooseaddress回调中获取到用户选择的地址信息 |\n@| chooseInvoiceTitle | | 选择用户发票抬头,可以从@chooseinvoicetitle回调中获取到用户选择发票抬头信息 |\n@| login | | 登录,可以从@login回调中确认是否登录成功 |\n@| subscribe | | 订阅类模板消息,需要用户授权才可发送 |\n@| favorite | | 触发用户收藏 |\n@| watchLater | | 触发用户稍后再看 |\n@| openProfile | | 触发打开用户主页 |\n@| liveActivity | | |\n@| getRealtimePhoneNumber | | |\n| lang | string | - | | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| en | | |\n@| zh_CN | | |\n@| zh_TW | | |\n| session-from | string | - | | 会话来源 |\n| send-message-title | string | - | | 会话内消息卡片标题 |\n| send-message-path | string | - | | 会话内消息卡片点击跳转应用路径 |\n| send-message-img | string | - | | 会话内消息卡片图片 |\n| show-message-card | boolean | - | | 显示会话内消息卡片 |\n| app-parameter | string | - | | 打开 APP 时,向 APP 传递的参数 |\n| group-id | string | - | | 打开群资料卡时,传递的群号 |\n| guild-id | string | - | | 打开频道页面时,传递的频道号 |\n| public-id | string | - | | 打开公众号资料卡时,传递的号码 |\n| @getuserinfo | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与uni.getUserInfo返回的一致 |\n| @contact | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 客服消息回调 |\n| @getphonenumber | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 获取用户手机号回调 |\n| @error | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当使用开放能力时,发生错误的回调 |\n| @opensetting | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 在打开授权设置页后回调 |\n| @launchapp | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 打开 APP 成功的回调 |\n| @chooseavatar | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 获取用户头像回调 |\n| @chooseaddress | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 调起用户编辑并选择收货地址的回调 |\n| @chooseinvoicetitle | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 用户选择发票抬头的回调 |\n| @addgroupapp | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 添加群应用的回调 |\n| @subscribe | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 订阅消息授权回调 |\n| @login | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 登录回调 |\n| phone-number-no-quota-toast | boolean | - | | - |\n| createliveactivity | eventhandle | - | | - |\n| @getrealtimephonenumber | eventhandle | - | | - |\n| @agreeprivacyauthorization | eventhandle | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/button/button.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/button/button\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/button/button\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \n \n \n \n \r\n \r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n plain_boolean: false,\r\n disabled_boolean: false,\r\n default_style: false,\r\n size_enum: [{ \"value\": 0, \"name\": \"default\" }, { \"value\": 1, \"name\": \"mini\" }] as ItemType[],\r\n size_enum_current: 0,\r\n type_enum: [{ \"value\": 0, \"name\": \"default\" }, { \"value\": 1, \"name\": \"primary\" }, { \"value\": 2, \"name\": \"warn\" }] as ItemType[],\r\n type_enum_current: 0,\r\n count: 0,\r\n text: ''\r\n }\r\n },\r\n onReady() {\r\n this.text = 'uni-app-x'\r\n },\r\n methods: {\r\n button_click() {\r\n console.log(\"组件被点击时触发\")\r\n this.count++\r\n },\r\n button_touchstart() { console.log(\"手指触摸动作开始\") },\r\n button_touchmove() { console.log(\"手指触摸后移动\") },\r\n button_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n button_touchend() { console.log(\"手指触摸动作结束\") },\r\n button_tap() { console.log(\"手指触摸后马上离开\") },\r\n button_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n change_plain_boolean(checked : boolean) { this.plain_boolean = checked },\r\n change_disabled_boolean(checked : boolean) { this.disabled_boolean = checked },\r\n change_default_style(checked : boolean) { this.default_style = checked },\r\n radio_change_size_enum(checked : number) { this.size_enum_current = checked },\r\n radio_change_type_enum(checked : number) { this.type_enum_current = checked },\r\n confirm_text_input(value : string) { this.text = value },\r\n navigateToChild() {\r\n uni.navigateTo({\r\n url: 'buttonstatus',\r\n })\r\n },\n openPrivacyDialog() {\n uni.openDialogPage({\n url: '/pages/component/button/privacy',\n })\n },\r\n //用于自动化测试\r\n checkUniButtonElement() : boolean {\r\n const button = uni.getElementById(\"testButton\")\r\n if (button != null && button instanceof UniButtonElement) {\r\n return true\r\n }\r\n return false\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.button)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/button.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=button&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=button&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=button&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=button&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=button)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=button&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"checkbox":{"name":"## checkbox","description":"> 组件类型:UniCheckboxElement \n\n 多选项。在1组check-group中可选择多个","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | false | | 是否禁用 |\n| value | string | - | | checkbox 标识,选中时触发 checkbox-group 的 change 事件,并携带 checkbox 的 value |\n| checked | boolean | false | | 当前是否选中,可用来设置默认选中 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | checkbox默认的背景颜色 |\n| borderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#d1d1d1\" | | checkbox默认的边框颜色 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | checkbox选中时的背景颜色 |\n| activeBorderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#d1d1d1\" | | checkbox选中时的边框颜色 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | checkbox的图标颜色,优先级大于color属性 |\n| ~~iconColor~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | checkbox的图标颜色,优先级大于color属性 (使用foreColor替代) |\n| ~~color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | checkbox的颜色 (使用foreColor替代) |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/checkbox/checkbox.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/checkbox/checkbox\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/checkbox/checkbox\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n uni-app-x\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n 默认样式 \r\n \r\n \r\n \r\n 选中\r\n \r\n {{ text }}\r\n 禁用\r\n \r\n {{ wrapText }}\r\n \r\n \r\n \r\n \r\n 不同颜色和尺寸的checkbox \r\n \r\n \r\n \r\n 选中\r\n \r\n 未选中\r\n \r\n \r\n \r\n\r\n \r\n \r\n 推荐展示样式 \r\n \r\n \r\n \r\n \r\n \r\n {{ item.name }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n type ItemType = {\r\n value : string\r\n name : string\r\n checked : boolean\r\n }\r\n export default {\r\n data() {\r\n return {\r\n items: [\r\n {\r\n value: 'CHN',\r\n name: '中国',\r\n checked: true,\r\n },\r\n {\r\n value: 'USA',\r\n name: '美国',\r\n checked: false,\r\n },\r\n {\r\n value: 'BRA',\r\n name: '巴西',\r\n checked: false,\r\n },\r\n {\r\n value: 'JPN',\r\n name: '日本',\r\n checked: false,\r\n },\r\n {\r\n value: 'ENG',\r\n name: '英国',\r\n checked: false,\r\n },\r\n {\r\n value: 'FRA',\r\n name: '法国',\r\n checked: false,\r\n },\r\n ] as ItemType[],\r\n testEvent: false,\r\n text: '未选中',\r\n wrapText: 'uni-app x,终极跨平台方案\\nuts,大一统语言',\r\n value: [] as string[],\r\n disabled: true,\r\n checked: true,\r\n color: '#007aff',\r\n iconColor: '#211cfe',\r\n foreColor: '#ff0000',\r\n // 组件属性 autotest\r\n checked_boolean: false,\r\n disabled_boolean: false,\r\n color_input: \"#007aff\",\r\n backgroundColor_input: \"#ffffff\",\r\n borderColor_input: \"#d1d1d1\",\r\n activeBackgroundColor_input: \"#ffffff\",\r\n activeBorderColor_input: \"#d1d1d1\",\r\n iconColor_input: \"#007aff\",\r\n foreColor_input: '#ff0000'\r\n }\r\n },\r\n methods: {\r\n\r\n checkboxChange: function (e : UniCheckboxGroupChangeEvent) {\r\n // 自动化测试\r\n if ((e.target?.tagName ?? '') == 'CHECKBOX-GROUP' && e.type === 'change') {\r\n this.testEvent = true\r\n }\r\n\r\n const selectedNames : string[] = []\r\n this.items.forEach((item) => {\r\n if (e.detail.value.includes(item.value)) {\r\n selectedNames.push(item.name)\r\n }\r\n })\r\n uni.showToast({\r\n icon: 'none',\r\n title: '当前选中:' + selectedNames.join(','),\r\n })\r\n },\r\n testChange: function (e : UniCheckboxGroupChangeEvent) {\r\n this.value = e.detail.value\r\n },\r\n checkbox_click() { console.log(\"组件被点击时触发\") },\r\n checkbox_touchstart() { console.log(\"手指触摸动作开始\") },\r\n checkbox_touchmove() { console.log(\"手指触摸后移动\") },\r\n checkbox_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n checkbox_touchend() { console.log(\"手指触摸动作结束\") },\r\n checkbox_tap() { console.log(\"手指触摸后马上离开\") },\r\n checkbox_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n change_checked_boolean(checked : boolean) { this.checked_boolean = checked },\r\n change_disabled_boolean(checked : boolean) { this.disabled_boolean = checked },\r\n confirm_color_input(value : string) { this.color_input = value },\r\n confirm_backgroundColor_input(value : string) { this.backgroundColor_input = value },\r\n confirm_borderColor_input(value : string) { this.borderColor_input = value },\r\n confirm_activeBackgroundColor_input(value : string) { this.activeBackgroundColor_input = value },\r\n confirm_activeBorderColor_input(value : string) { this.activeBorderColor_input = value },\r\n confirm_iconColor_input(value : string) { this.iconColor_input = value },\r\n confirm_foreColor_input(value : string) { this.foreColor_input = value }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.checkbox.checkbox)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/checkbox.html#checkbox)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/checkbox.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=checkbox&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=checkbox&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=checkbox&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=checkbox&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=checkbox)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=checkbox&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"checkbox-group":{"name":"## checkbox-group","description":"> 组件类型:UniCheckboxGroupElement \n\n 多选框组","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| @change | (event: [UniCheckboxGroupChangeEvent](#unicheckboxgroupchangeevent)) => void | - | | checkbox-group中选中项发生改变是触发 change 事件,detail = {value:\\[选中的checkbox的value的数组] |","event":"\n### 事件\n#### UniCheckboxGroupChangeEvent\n\n```mermaid\ngraph LR\n \nUniCheckboxGroupChangeEvent -- Extends --> UniCustomEvent<UniCheckboxGroupChangeEventDetail>\n style UniCustomEvent<UniCheckboxGroupChangeEventDetail> color:#42b983\n click UniCustomEvent<UniCheckboxGroupChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniCheckboxGroupChangeEventDetail\n\n\n###### UniCheckboxGroupChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | Array\\ | 是 | - | - | - |\n\n","example":"","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [checkbox](checkbox.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.checkbox.checkbox-group)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/checkbox.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/checkbox-group.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=checkbox-group&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=checkbox-group&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=checkbox-group&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=checkbox-group&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=checkbox-group)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=checkbox-group&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"form":{"name":"## form","description":"> 组件类型:UniFormElement \n\n 表单","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.97 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | - | | 是否禁用 |\n| report-submit | boolean | - | | 是否返回 formId 用于发送模板消息 |\n| @submit | (event: [UniFormSubmitEvent](#uniformsubmitevent)) => void | - | | 携带 form 中的数据触发 submit 事件,event.detail = {value : {'name': 'value'}} |\n| @reset | (event: [UniFormResetEvent](#uniformresetevent)) => void | - | | 表单重置时会触发 reset 事件 |\n| report-submit-timeout | number | - | | - |","event":"\n### 事件\n#### UniFormSubmitEvent\n\n```mermaid\ngraph LR\n \nUniFormSubmitEvent -- Extends --> UniCustomEvent<UniFormSubmitEventDetail>\n style UniCustomEvent<UniFormSubmitEventDetail> color:#42b983\n click UniCustomEvent<UniFormSubmitEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniFormSubmitEventDetail\n\n\n###### UniFormSubmitEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | UTSJSONObject | 是 | - | - | - |\n\n\n#### UniFormResetEvent\n\n```mermaid\ngraph LR\n \nUniFormResetEvent -- Extends --> UniCustomEvent<UniFormResetEventDetail>\n style UniCustomEvent<UniFormResetEventDetail> color:#42b983\n click UniCustomEvent<UniFormResetEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/form/form.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/form/form\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/form/form\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n 提交的表单数据\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n nickname: '',\r\n gender: '0',\r\n age: 18,\r\n loves: ['0'],\r\n switch: true,\r\n comment: '',\r\n formData: {} as UTSJSONObject,\r\n // 仅测试\r\n testVerifySubmit: false,\r\n testVerifyReset: false,\r\n }\r\n },\r\n computed: {\r\n formDataText() : string {\r\n return JSON.stringify(this.formData)\r\n }\r\n },\r\n methods: {\r\n onFormSubmit: function (e : UniFormSubmitEvent) {\r\n this.formData = e.detail.value\r\n\r\n // 仅测试\r\n this.testVerifySubmit = (e.type == 'submit' && (e.target?.tagName ?? '') == \"FORM\")\r\n },\r\n onFormReset: function (e : UniFormResetEvent) {\r\n this.formData = {}\r\n\r\n // 仅测试\r\n this.testVerifyReset = (e.type == 'reset' && (e.target?.tagName ?? '') == \"FORM\")\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.form)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/form.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/form.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=form&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=form&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=form&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=form&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=form)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=form&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"input":{"name":"## input","description":"> 组件类型:[UniInputElement](/dom/uniinputelement.md) \n\n 输入框","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| disabled | boolean | false | | 是否禁用 |\n| value | string | \"\" | | 输入框的初始内容 |\n| type | text \\| number \\| idcard \\| digit \\| tel \\| safe-password \\| nickname | \"text\" | | input的类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| text | | 文本输入键盘 |\n@| number | | 数字输入键盘 |\n@| idcard | | 身份证输入键盘 |\n@| digit | | 带小数点数字输入键盘 |\n@| tel | | 电话输入键盘 |\n@| safe-password | | 密码安全输入键盘 |\n@| nickname | | 昵称输入键盘 |\n| password | boolean | false | | 是否是密码类型 |\n| placeholder | string | \"\" | | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | | 指定 placeholder 的样式,目前仅支持color,font-size和font-weight |\n| placeholder-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"\" | | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | \"不限制长度\" | | 最大输入长度,0和正数为合法值,非法值的时候不限制最大长度 |\n| cursor-spacing | number | 0 | | 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 |\n| cursor-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"\" | | 指定光标颜色 |\n| auto-focus | boolean | false | | 自动获取焦点,与`focus`属性对比,此属性只会首次生效。 |\n| focus | boolean | false | | 获取焦点 |\n| confirm-type | send \\| search \\| next \\| go \\| done | \"done\" | | 设置键盘右下角按钮的文字,仅在 type为text 时生效。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| send | | 发送 |\n@| search | | 搜索 |\n@| next | | 下一个 |\n@| go | | 前往 |\n@| done | | 完成 |\n| always-embed | boolean | - | | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) |\n| confirm-hold | boolean | false | | 点击键盘右下角按钮时是否保持键盘不收起 |\n| cursor | number | 0 | | 指定focus时的光标位置 |\n| selection-start | number | -1 | | 光标起始位置,自动聚集时有效,需与selection-end搭配使用 |\n| selection-end | number | -1 | | 光标结束位置,自动聚集时有效,需与selection-satrt搭配使用 |\n| adjust-position | boolean | true | | 键盘弹起时,是否自动上推页面 |\n| text-content-type | string | - | | 文本区域的语义,根据类型自动填充 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| oneTimeCode | | 一次性验证码 |\n| hold-keyboard | boolean | false | | focus时,点击页面的时候不收起键盘 |\n| safe-password-cert-path | string | - | | 安全键盘加密公钥的路径,只支持包内路径 |\n| safe-password-length | number | - | | 安全键盘输入密码长度 |\n| safe-password-time-stamp | number | - | | 安全键盘加密时间戳 |\n| safe-password-nonce | string | - | | 安全键盘加密盐值 |\n| safe-password-salt | string | - | | 安全键盘计算 hash 盐值,若指定custom-hash 则无效 |\n| safe-password-custom-hash | string | - | | 安全键盘计算 hash 的算法表达式 |\n| random-number | boolean | - | | 当 type 为 number, digit, idcard 数字键盘是否随机排列 |\n| controlled | boolean | - | | 是否为受控组件。为 true 时,value 内容会完全受 setData 控制 |\n| always-system | boolean | - | | 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效 |\n| inputmode | none \\| text \\| decimal \\| numeric \\| tel \\| search \\| email \\| url | \"text\" | | 是一个枚举属性,它提供了用户在编辑元素或其内容时可能输入的数据类型的提示。在符合条件的高版本webview里,uni-app的 web 和 app-vue 平台中可使用本属性。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 无虚拟键盘。在应用程序或者站点需要实现自己的键盘输入控件时很有用。 |\n@| text | | 使用用户本地区域设置的标准文本输入键盘。 |\n@| decimal | | 小数输入键盘,包含数字和分隔符(通常是“ . ”或者“ , ”),设备可能也可能不显示减号键。 |\n@| numeric | | 数字输入键盘,所需要的就是 0 到 9 的数字,设备可能也可能不显示减号键。 |\n@| tel | | 电话输入键盘,包含 0 到 9 的数字、星号(*)和井号(#)键。表单输入里面的电话输入通常应该使用 \\ 。 |\n@| search | | 为搜索输入优化的虚拟键盘,比如,返回键可能被重新标记为“搜索”,也可能还有其他的优化。 |\n@| email | | 为邮件地址输入优化的虚拟键盘,通常包含\"@\"符号和其他优化。表单里面的邮件地址输入应该使用 \\ 。 |\n@| url | | 为网址输入优化的虚拟键盘,比如,“/”键会更加明显、历史记录访问等。表单里面的网址输入通常应该使用 \\ 。 |\n| @input | (event: [UniInputEvent](#uniinputevent)) => void | - | | 当键盘输入时,触发input事件,event.detail = {value, cursor},处理函数可以直接 return 一个字符串,将替换输入框的内容。 |\n| @focus | (event: [UniInputFocusEvent](#uniinputfocusevent)) => void | - | | 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 |\n| @blur | (event: [UniInputBlurEvent](#uniinputblurevent)) => void | - | | 输入框失去焦点时触发,event.detail = {value: value} |\n| @keyboardheightchange | (event: [UniInputKeyboardHeightChangeEvent](#uniinputkeyboardheightchangeevent)) => void | - | | 键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration} |\n| @confirm | (event: [UniInputConfirmEvent](#uniinputconfirmevent)) => void | - | | 点击完成按钮时触发,event.detail = {value: value} |\n| @nicknamereview | eventhandle | - | | - |","event":"\n### 事件\n#### UniInputEvent\n\n```mermaid\ngraph LR\n \nUniInputEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 光标的位置 |\n@| keyCode | number | 是 | - | - | 输入字符的Unicode值 |\n\n\n#### UniInputFocusEvent\n\n```mermaid\ngraph LR\n \nUniInputFocusEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputFocusEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | | 键盘高度 |\n@| value | string | 是 | - | - | 输入框内容 |\n\n\n#### UniInputBlurEvent\n\n```mermaid\ngraph LR\n \nUniInputBlurEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputBlurEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 选择区域的起始位置 |\n\n\n#### UniInputKeyboardHeightChangeEvent\n\n```mermaid\ngraph LR\n \nUniInputKeyboardHeightChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputKeyboardHeightChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | - | 键盘高度 |\n@| duration | number | 是 | - | - | 持续时间 |\n\n\n#### UniInputConfirmEvent\n\n```mermaid\ngraph LR\n \nUniInputConfirmEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputConfirmEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/input/input.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/input/input\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/input/input\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 设置输入框的初始内容\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n type取值(不同输入法表现可能不一致)\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 密码输入框\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 无value设置的密码输入框\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 占位符样式\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置禁用输入框\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置最大输入长度\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置光标与键盘的距离\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 自动获取焦点\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n confirm-type取值(不同输入法表现可能不一致)\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 点击键盘右下角按钮时保持键盘不收起\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置输入框聚焦时光标的位置(点这里)\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置输入框聚焦时光标的起始位置和结束位置(点这里)\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置光标颜色为红色\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 键盘弹起时,自动上推页面\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置hold-keyboard\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n input事件\r\n {{\r\n inputEventDetail\r\n }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n focus事件和blur事件\r\n {{\r\n focusAndBlurEventDetail\r\n }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n confirm事件\r\n {{\r\n confirmEventDetail\r\n }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n keyboardheightchange事件\r\n {{ keyboardHeightChangeEventDetail }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 带清除按钮的输入框\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 可查看密码的输入框\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 同时存在 v-model 和 value\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置adjust-position\r\n \r\n \r\n \r\n \r\n \r\n \n\n \n \n 输入内容的同步更新UI\n \n {{syncDisplayValue}}\n \n \n \n \n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'input',\r\n showClearIcon: false,\r\n inputClearValue: '',\r\n showPassword: true,\r\n cursor: -1,\r\n cursor_color: \"#3393E2\",\r\n selectionStart: -1,\r\n selectionEnd: -1,\r\n inputEventDetail: '',\r\n focusAndBlurEventDetail: '',\r\n confirmEventDetail: '',\r\n keyboardHeightChangeEventDetail: '',\r\n focus: true,\r\n inputPassword: true,\r\n inputTypeTel: \"tel\",\r\n inputPlaceHolderStyle: \"color:red\",\r\n inputPlaceHolderClass: \"uni-input-placeholder-class\" as string.ClassString,\r\n inputMaxLengthValue: \"\",\r\n onMaxLengthInputValue: \"\",\r\n inputMaxLengthFocus: false,\r\n inputPasswordValue: \"cipher\",\r\n inputFocusKeyBoardChangeValue: true,\r\n holdKeyboard: false,\r\n keyboardHeight: 0,\r\n focusedForKeyboardHeightChangeTest: false,\r\n demoValue: '123',\r\n adjustPosition: false,\n syncDisplayValue: ''\r\n }\r\n },\r\n methods: {\r\n inputFocusKeyBoardChange(e : UniInputKeyboardHeightChangeEvent) {\r\n this.inputFocusKeyBoardChangeValue = e.detail.height > 50\r\n },\r\n onMaxLengthInput(event : UniInputEvent) {\r\n this.onMaxLengthInputValue = event.detail.value\r\n },\r\n setCursor: function (cursor : number) {\r\n (this.$refs['input'] as UniInputElement).focus();\r\n this.cursor = cursor;\r\n },\r\n onCursorBlurChange() {\r\n this.cursor = 0\r\n },\r\n setSelection: function (selectionStart : number, selectionEnd : number) {\r\n (this.$refs['input2'] as UniInputElement).focus();\r\n this.selectionStart = selectionStart;\r\n this.selectionEnd = selectionEnd;\r\n },\r\n onSelectionBlurChange() {\r\n this.selectionEnd = 0;\r\n },\r\n clearInput: function (event : UniInputEvent) {\r\n this.inputClearValue = event.detail.value\r\n if (event.detail.value.length > 0) {\r\n this.showClearIcon = true\r\n } else {\r\n this.showClearIcon = false\r\n }\r\n },\r\n clearIcon: function () {\r\n this.inputClearValue = ''\r\n this.showClearIcon = false\r\n },\r\n changePassword: function () {\r\n this.showPassword = !this.showPassword\r\n },\r\n onInput: function (event : UniInputEvent) {\r\n console.log(\"键盘输入\", JSON.stringify(event.detail));\r\n this.inputEventDetail = JSON.stringify(event.detail)\r\n },\r\n onFocus: function (event : UniInputFocusEvent) {\r\n console.log(\"输入框聚焦\", JSON.stringify(event.detail));\r\n this.focusAndBlurEventDetail = JSON.stringify(event.detail);\r\n },\r\n onBlur: function (event : UniInputBlurEvent) {\r\n console.log(\"输入框失去焦点\", JSON.stringify(event.detail));\r\n this.focusAndBlurEventDetail = JSON.stringify(event.detail);\r\n },\r\n onConfirm: function (event : UniInputConfirmEvent) {\r\n console.log(\"点击完成按钮\", JSON.stringify(event.detail));\r\n this.confirmEventDetail = JSON.stringify(event.detail);\r\n },\r\n onKeyborardHeightChange: function (event : UniInputKeyboardHeightChangeEvent) {\r\n console.log(\"键盘高度发生变化\", JSON.stringify(event.detail));\r\n this.keyboardHeightChangeEventDetail = JSON.stringify(event.detail);\r\n this.keyboardHeight = event.detail.height;\r\n },\r\n test_check_input_value() : number {\r\n return this.onMaxLengthInputValue.length\r\n },\r\n changeCursorColor(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n if (checked) {\r\n this.cursor_color = \"red\"\r\n } else {\r\n this.cursor_color = \"#3393E2\"\r\n }\r\n const input = uni.getElementById(\"uni-input-cursor-color\")\r\n input?.focus()\r\n },\r\n changeHoldKeyboard(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.holdKeyboard = checked\r\n },\r\n changeAdjustPosition(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.adjustPosition = checked\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.input)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/input.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=input&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=input&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=input&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=input&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=input)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=input&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"editor":{"name":"## editor","description":"富文本编辑器,可以对图片、文字进行编辑。","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| read-only | boolean | - | | 设置编辑器为只读。 |\n| placeholder | string | - | | 提示信息。 |\n| show-img-size | boolean | - | | 点击图片时显示图片大小控件。 |\n| show-img-toolbar | boolean | - | | 点击图片时显示工具栏控件。 |\n| show-img-resize | string | - | | 点击图片时显示修改尺寸控件。 |\n| @ready | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器初始化完成时触发 |\n| @focus | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器聚焦时触发,event.detail = {html, text, delta} |\n| @blur | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器失去焦点时触发,detail = {html, text, delta} |\n| @input | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器内容改变时触发,detail = {html, text, delta} |\n| @statuschange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式 |\n| enable-formats | Array.<string> | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/editor/editor.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/editor/editor\n\n>Template\n```vue\n\n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n\n\n \n \n\n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n\n\n\n\n\n```\n\n>Script\n```uts\n\n type Context = {\n id ?: string;\n pageId ?: number;\n }\n\n export default {\n data() {\n return {\n readOnly: false,\n formats: {},\n editorCtx: {} as Context,\n // 自动化测试\n autoTest: false,\n undoTest: false,\n redoTest: false,\n removeFormatTest: false,\n insertImageTest: false,\n blurTest: false\n }\n },\n onLoad() {\n uni.loadFontFace({\n family: 'Pacifico',\n source: 'url(\"/static/font/Pacifico-Regular.ttf\")',\n success() {\n console.log('success load font')\n },\n fail() {\n console.log('fail load font load')\n }\n })\n },\n methods: {\n readOnlyChange() {\n this.readOnly = !this.readOnly\n },\n onEditorReady() {\n uni.createSelectorQuery().select('#editor').context((res) => {\n this.editorCtx = res.context\n }).exec()\n },\n // 自动化测试专用\n setContents(options) {\n this.editorCtx.setContents({\n delta: {\n ops: options\n },\n success: (res) => {\n console.log('setContents-success', res)\n },\n fail: (err) => {\n console.log(err)\n }\n })\n },\n blur() {\n this.editorCtx.blur({\n success: (res) => {\n console.log('编辑器失焦:', res)\n this.blurTest = true\n },\n fail: (err) => {\n console.log(err)\n }\n })\n },\n getCon() {\n this.editorCtx.getContents({\n success: (res) => {\n console.log('文本详情:', res)\n },\n fail: (err) => {\n console.log(err)\n }\n })\n },\n undo() {\n this.editorCtx.undo({\n success: (res) => {\n this.undoTest = true\n },\n fail: (err) => {\n this.undoTest = false\n }\n })\n },\n redo() {\n this.editorCtx.redo({\n success: (res) => {\n this.redoTest = true\n },\n fail: (err) => {\n this.redoTest = false\n }\n })\n },\n format(e) {\n let { name, value } = e.target.dataset\n if (!name) return\n // console.log('format', name, value)\n this.editorCtx.format(name, value)\n },\n onStatusChange(e) {\n const formats = e.detail\n this.formats = formats\n },\n insertDivider() {\n this.editorCtx.insertDivider({\n success: function () {\n console.log('insert divider success')\n }\n })\n },\n clear() {\n this.editorCtx.clear({\n success: function (res) {\n console.log(\"clear success\")\n }\n })\n },\n clearShowModal() {\n uni.showModal({\n title: '清空编辑器',\n content: '确定清空编辑器全部内容?',\n success: res => {\n if (res.confirm) {\n this.clear()\n }\n }\n })\n },\n removeFormat() {\n this.editorCtx.removeFormat({\n success: (res) => {\n console.log('removeFormat-success', res)\n this.removeFormatTest = true\n },\n fail: (err) => {\n this.removeFormatTest = false\n }\n })\n },\n insertDate() {\n const date = new Date()\n const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`\n this.editorCtx.insertText({\n text: formatDate\n })\n },\n insertImage(image) {\n this.editorCtx.insertImage({\n src: image,\n alt: '图像',\n success: () => {\n console.log('insert image success')\n this.insertImageTest = true\n }\n })\n },\n chooseInsertImage() {\n uni.chooseImage({\n count: 1,\n success: (res) => {\n this.insertImage(res.tempFilePaths[0])\n }\n })\n }\n }\n }\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.editor)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/editor.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/editor.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=editor&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=editor&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=editor&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=editor&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=editor)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=editor&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"label":{"name":"## label","description":"用来改进表单组件的可用性,使用for属性找到对应的id,或者将控件放在该标签下,当点击时,就会触发对应的控件","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | - | | 是否禁用 |\n| for | string | - | | 绑定控件的 id |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/label/label.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/label/label\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n 表单组件在label内\r\n \r\n \r\n \r\n \r\n\r\n \r\n label用for标识表单组件\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n label内有多个时选中第一个\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'label',\r\n checkboxItems: [{\r\n name: 'USA',\r\n value: '美国'\r\n },\r\n {\r\n name: 'CHN',\r\n value: '中国',\r\n checked: 'true'\r\n }\r\n ],\r\n radioItems: [{\r\n name: 'USA',\r\n value: '美国'\r\n },\r\n {\r\n name: 'CHN',\r\n value: '中国',\r\n checked: 'true'\r\n }\r\n ],\r\n hidden: false,\r\n checkboxValue: [] as string[],\r\n radioValue: ''\r\n }\r\n },\r\n methods: {\r\n checkboxChange: function (e : UniCheckboxGroupChangeEvent) {\r\n console.log(e.detail.value)\r\n this.checkboxValue = e.detail.value\r\n },\r\n radioChange: function (e : UniRadioGroupChangeEvent) {\r\n console.log(e.detail.value)\r\n this.radioValue = e.detail.value\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.label)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/label.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/label.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=label&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=label&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=label&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=label&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=label)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=label&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"picker":{"name":"## picker","description":"从底部弹起的滚动选择器,现支持五种选择器,通过mode来区分,分别是普通选择器,多列选择器,时间选择器,日期选择器,省市区选择器,默认是普通选择器。","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | - | | 是否禁用 |\n| mode | string | - | | 选择器类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| selector | | 普通选择器 |\n@| multiSelector | | 多列选择器 |\n@| time | | 时间选择器 |\n@| date | | 日期选择器 |\n@| region | | 省市选择器 |\n| range | array | - | | mode为 selector 或 multiSelector 时,range 有效 |\n| range-key | string | - | | 当 range 是一个 Object Array 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容 |\n| value | string | - | | mode为select或multiSelector时:value 的值表示选择了 range 中的第几个(下标从 0 开始);mode为time时:表示选中的时间,格式为\"hh:mm\";mode为date时:表示选中的日期,格式为\"YYYY-MM-DD\";mode为region时:
\t\t表示选中的省市区,默认选中每一列的第一个值。 |\n| start | string | - | | mode为time:表示有效时间范围的开始,字符串格式为\"hh:mm\";mode为date:表示有效日期范围的开始,字符串格式为\"YYYY-MM-DD\" |\n| end | string | - | | mode为time:表示有效时间范围的结束,字符串格式为\"hh:mm\";mode为date:表示有效日期范围的结束,字符串格式为\"YYYY-MM-DD\" |\n| fields | string | - | | 有效值 year,month,day,表示选择器的粒度 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| year | | 选择器粒度为年 |\n@| month | | 选择器粒度为月份 |\n@| day | | 选择器粒度为天 |\n| custom-item | string | - | | 可为每一列的顶部添加一个自定义的项 |\n| @change | (event: [UniEvent](/component/common.md#unievent)) => void | - | | value 改变时触发 change 事件,event.detail = {value: value} |\n| @columnchange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 某一列的值改变时触发 columnchange 事件,event.detail = {column: column, value: value},column 的值表示改变了第几列(下标从0开始),value 的值表示变更值的下标 |\n| @cancel | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 取消选择时触发 |\n| header-text | string | - | | - |\n| level | string | - | | mode=\"region\" 时有效,选择器层级 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| province | | |\n@| city | | |\n@| region | | |\n@| sub-district | | |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/picker/picker.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/picker/picker\n\n>Template\n```vue\n\r\n \r\n \r\n 普通选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n {{array[index].name}}\r\n \r\n \r\n \r\n \r\n\r\n 多列选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n \r\n {{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}}\r\n \r\n \r\n \r\n \r\n \r\n\r\n 时间选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n {{time}}\r\n \r\n \r\n \r\n \r\n \r\n 注:选择 09:01 ~ 21:01 之间的时间, 不在区间内不能选中\r\n \r\n\r\n 日期选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n {{date}}\r\n \r\n \r\n \r\n \r\n \r\n 注:选择当前时间 ±10 年之间的时间, 不在区间内不能选中\r\n \r\n \r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n function getDate(type ?: string) : string {\r\n const date = new Date();\r\n\r\n let year : string | number = date.getFullYear();\r\n let month : string | number = date.getMonth() + 1;\r\n let day : string | number = date.getDate();\r\n\r\n if (type === 'start') {\r\n year = year - 10;\r\n } else if (type === 'end') {\r\n year = year + 10;\r\n }\r\n month = month > 9 ? month : '0' + month;;\r\n day = day > 9 ? day : '0' + day;\r\n\r\n return `${year}-${month}-${day}`;\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'picker',\r\n array: [{ name: '中国' }, { name: '美国' }, { name: '巴西' }, { name: '日本' }],\r\n index: 0,\r\n multiArray: [\r\n ['亚洲', '欧洲'],\r\n ['中国', '日本'],\r\n ['北京', '上海', '广州']\r\n ],\r\n multiIndex: [0, 0, 0],\r\n date: getDate(),\r\n startDate: getDate('start'),\r\n endDate: getDate('end'),\r\n time: '12:01'\r\n }\r\n },\r\n methods: {\r\n bindPickerChange: function (e) {\r\n console.log('picker发送选择改变,携带值为:' + e.detail.value)\r\n this.index = e.detail.value\r\n },\r\n bindMultiPickerColumnChange: function (e) {\r\n console.log('修改的列为:' + e.detail.column + ',值为:' + e.detail.value)\r\n this.multiIndex[e.detail.column] = e.detail.value\r\n switch (e.detail.column) {\r\n case 0: //拖动第1列\r\n switch (this.multiIndex[0]) {\r\n case 0:\r\n this.multiArray[1] = ['中国', '日本']\r\n this.multiArray[2] = ['北京', '上海', '广州']\r\n break\r\n case 1:\r\n this.multiArray[1] = ['英国', '法国']\r\n this.multiArray[2] = ['伦敦', '曼彻斯特']\r\n break\r\n }\r\n this.multiIndex.splice(1, 1, 0)\r\n this.multiIndex.splice(2, 1, 0)\r\n break\r\n case 1: //拖动第2列\r\n switch (this.multiIndex[0]) { //判断第一列是什么\r\n case 0:\r\n switch (this.multiIndex[1]) {\r\n case 0:\r\n this.multiArray[2] = ['北京', '上海', '广州']\r\n break\r\n case 1:\r\n this.multiArray[2] = ['东京', '北海道']\r\n break\r\n }\r\n break\r\n case 1:\r\n switch (this.multiIndex[1]) {\r\n case 0:\r\n this.multiArray[2] = ['伦敦', '曼彻斯特']\r\n break\r\n case 1:\r\n this.multiArray[2] = ['巴黎', '马赛']\r\n break\r\n }\r\n break\r\n }\r\n this.multiIndex.splice(2, 1, 0)\r\n break\r\n }\r\n this.$forceUpdate()\r\n },\r\n bindDateChange: function (e) {\r\n this.date = e.detail.value\r\n },\r\n bindTimeChange: function (e) {\r\n this.time = e.detail.value\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.picker)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/picker.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=picker&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=picker&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=picker&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=picker&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=picker)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=picker&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"picker-view-column":{"name":"## picker-view-column","description":"仅可放置于 picker-view 中,其子节点未继承 picker-view 的选中框的高度,需要自己设置高度并居中","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.picker-view.picker-view-column)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/picker-view.html#picker-view-column)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=picker-view-column&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=picker-view-column&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=picker-view-column&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=picker-view-column&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=picker-view-column)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=picker-view-column&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"picker-view":{"name":"## picker-view","description":"> 组件类型:UniPickerViewElement \n\n 嵌入页面的滚动选择器","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| value | array\\ | - | | picker-view-column 选择的第几项 |\n| indicator-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置选择器中间选中框的样式 |\n| indicator-class | string([string.ClassString](/uts/data-type.md#ide-string)) | - | | 设置选择器中间选中框的类名 |\n| mask-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置蒙层的样式 |\n| mask-top-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置蒙层上半部分的样式 |\n| mask-bottom-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置蒙层下半部分的样式 |\n| mask-class | string([string.ClassString](/uts/data-type.md#ide-string)) | - | | 设置蒙层的类名 |\n| @change | (event: [UniPickerViewChangeEvent](#unipickerviewchangeevent)) => void | - | | 当滚动选择,value 改变时触发 change 事件,event.detail = {value: value};value为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0
\t\t开始) |\n| @pickstart | eventhandle | - | | - |\n| @pickend | eventhandle | - | | - |","event":"\n### 事件\n#### UniPickerViewChangeEvent\n\n```mermaid\ngraph LR\n \nUniPickerViewChangeEvent -- Extends --> UniCustomEvent<UniPickerViewChangeEventDetail>\n style UniCustomEvent<UniPickerViewChangeEventDetail> color:#42b983\n click UniCustomEvent<UniPickerViewChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniPickerViewChangeEventDetail\n\n\n###### UniPickerViewChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | Array\\ | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/picker-view/picker-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/picker-view/picker-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/picker-view/picker-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n 日期:{{year}}年{{month}}月{{day}}日\r\n \r\n \r\n \r\n \r\n {{item}}年\r\n \r\n \r\n {{item}}月\r\n \r\n \r\n \r\n {{item}}日\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { state, setEventCallbackNum } from '@/store/index.uts'\r\n export default {\r\n data() {\r\n // 20180112 HBuilderX内测开始 :)\r\n const _years : number[] = []\r\n const _year = 2018\r\n const _months : number[] = []\r\n const _month : number = 1\r\n const _days : number[] = []\r\n const _day = 12\r\n for (let i = 2000; i <= _year; i++) {\r\n _years.push(i)\r\n }\r\n for (let i = 1; i <= 12; i++) {\r\n _months.push(i)\r\n }\r\n for (let i = 1; i <= 31; i++) {\r\n _days.push(i)\r\n }\r\n return {\r\n title: 'picker-view',\r\n years: _years as number[],\r\n year: _year as number,\r\n months: _months as number[],\r\n month: _month as number,\r\n days: _days as number[],\r\n day: _day as number,\r\n value: [_year - 2000, _month - 1, _day - 1] as number[],\r\n result: [] as number[],\r\n indicatorStyle: 'height: 50px;',\r\n // 自动化测试\r\n indicatorClass: '',\r\n maskStyle: '',\r\n maskClass: '',\r\n maskTopStyle: '',\r\n maskBottomStyle: ''\r\n }\r\n },\r\n methods: {\r\n // 自动化测试\r\n getEventCallbackNum() : number {\r\n return state.eventCallbackNum\r\n },\r\n // 自动化测试\r\n setEventCallbackNum(num : number) {\r\n setEventCallbackNum(num)\r\n },\r\n bindChange(e : UniPickerViewChangeEvent) {\r\n // 自动化测试 触发事件元素、type 类型\r\n // console.log(e.target?.tagName, e.type);\r\n if ((e.target?.tagName ?? '').includes('PICKER-VIEW')) {\r\n this.setEventCallbackNum(state.eventCallbackNum + 1)\r\n }\r\n if (e.type === 'change') {\r\n this.setEventCallbackNum(state.eventCallbackNum + 2)\r\n }\r\n const val = e.detail.value\r\n this.result = val\r\n this.year = this.years[val[0]]\r\n this.month = this.months[val[1]]\r\n this.day = this.days[val[2]]\r\n },\r\n setValue() {\r\n this.value = [0, 1, 30] as number[]\r\n },\r\n setValue1() {\r\n this.value = [10, 10, 10] as number[]\r\n },\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [picker-view-column](picker-view-column.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.picker-view.picker-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/picker-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=picker-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=picker-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=picker-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=picker-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=picker-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=picker-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"radio":{"name":"## radio","description":"> 组件类型:UniRadioElement \n\n 单选项。在1组radio-group中只能选中1个","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | false | | 是否禁用 |\n| value | string | - | | \\ 标识。当该radio 选中时,radio-group的 change 事件会携带radio的value |\n| checked | boolean | false | | \\ 当前是否选中 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | radio默认的背景颜色 |\n| borderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#d1d1d1\" | | radio默认的边框颜色 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007AFF\" | | radio选中时的背景颜色,优先级大于color属性 |\n| activeBorderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"\" | | radio选中时的边框颜色 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | radio的图标颜色 |\n| ~~iconColor~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | radio的图标颜色 (使用foreColor替代) |\n| ~~color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007AFF\" | | radio的颜色 (使用foreColor替代) |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/radio/radio.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/radio/radio\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/radio/radio\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n uni-app-x\r\n \r\n \r\n\r\n \r\n \r\n \r\n 当前是否选中\" @change=\"change_checked_boolean\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n 默认样式 \r\n \r\n \r\n 选中\r\n \r\n {{\r\n text\r\n }}\r\n 禁用\r\n {{\r\n wrapText\r\n }}\r\n \r\n \r\n\r\n \r\n \r\n 不同颜色和尺寸的radio \r\n \r\n \r\n 选中\r\n \r\n 未选中\r\n \r\n \r\n\r\n \r\n \r\n 推荐展示样式 \r\n \r\n \r\n \r\n \r\n \r\n {{ item.name }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n type ItemType = {\r\n value : string\r\n name : string\r\n }\r\n export default {\r\n data() {\r\n return {\r\n items: [\r\n {\r\n value: 'CHN',\r\n name: '中国',\r\n },\r\n {\r\n value: 'USA',\r\n name: '美国',\r\n },\r\n\r\n {\r\n value: 'BRA',\r\n name: '巴西',\r\n },\r\n {\r\n value: 'JPN',\r\n name: '日本',\r\n },\r\n {\r\n value: 'ENG',\r\n name: '英国',\r\n },\r\n {\r\n value: 'FRA',\r\n name: '法国',\r\n },\r\n ] as ItemType[],\r\n current: 0,\r\n eventTest: false,\r\n\r\n value: '',\r\n text: '未选中',\r\n wrapText: 'uni-app x,终极跨平台方案\\nuts,大一统语言',\r\n disabled: true,\r\n checked: true,\r\n color: '#007aff',\r\n // 组件属性 autotest\r\n checked_boolean: false,\r\n disabled_boolean: false,\r\n color_input: \"#007AFF\",\r\n backgroundColor_input: \"#ffffff\",\r\n borderColor_input: \"#d1d1d1\",\r\n activeBackgroundColor_input: \"#007AFF\",\r\n activeBorderColor_input: \"\",\r\n iconColor_input: \"#ffffff\"\r\n }\r\n },\r\n\r\n methods: {\r\n radioChange(e : UniRadioGroupChangeEvent) {\r\n\r\n // 自动化测试\r\n console.log('test: radio event detail', e.target?.tagName, e.type)\r\n if ((e.target?.tagName ?? '') == 'RADIO-GROUP' && e.type == 'change') {\r\n this.eventTest = true\r\n }\r\n\r\n const selected = this.items.find((item) : boolean => {\r\n return item.value == e.detail.value\r\n })\r\n uni.showToast({\r\n icon: 'none',\r\n title: '当前选中:' + selected?.name,\r\n })\r\n },\r\n testChange(e : UniRadioGroupChangeEvent) {\r\n\r\n this.value = e.detail.value\r\n },\r\n radio_click() { console.log(\"组件被点击时触发\") },\r\n radio_touchstart() { console.log(\"手指触摸动作开始\") },\r\n radio_touchmove() { console.log(\"手指触摸后移动\") },\r\n radio_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n radio_touchend() { console.log(\"手指触摸动作结束\") },\r\n radio_tap() { console.log(\"手指触摸后马上离开\") },\r\n radio_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n change_checked_boolean(checked : boolean) { this.checked_boolean = checked },\r\n change_disabled_boolean(checked : boolean) { this.disabled_boolean = checked },\r\n confirm_color_input(value : string) { this.color_input = value },\r\n confirm_backgroundColor_input(value : string) { this.backgroundColor_input = value },\r\n confirm_borderColor_input(value : string) { this.borderColor_input = value },\r\n confirm_activeBackgroundColor_input(value : string) { this.activeBackgroundColor_input = value },\r\n confirm_activeBorderColor_input(value : string) { this.activeBorderColor_input = value },\r\n confirm_iconColor_input(value : string) { this.iconColor_input = value }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.radio.radio)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/radio.html#radio)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/radio.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=radio&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=radio&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=radio&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=radio&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=radio)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=radio&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"radio-group":{"name":"## radio-group","description":"> 组件类型:UniRadioGroupElement \n\n 单选框组","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| @change | (event: [UniRadioGroupChangeEvent](#uniradiogroupchangeevent)) => void | - | | radio-group 中的选中项发生变化时触发 change 事件,event.detail = {value: 选中项radio的value} |","event":"\n### 事件\n#### UniRadioGroupChangeEvent\n\n```mermaid\ngraph LR\n \nUniRadioGroupChangeEvent -- Extends --> UniCustomEvent<UniRadioGroupChangeEventDetail>\n style UniCustomEvent<UniRadioGroupChangeEventDetail> color:#42b983\n click UniCustomEvent<UniRadioGroupChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniRadioGroupChangeEventDetail\n\n\n###### UniRadioGroupChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | string | 是 | - | - | - |\n\n","example":"","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [radio](radio.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.radio.radio-group)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/radio.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/radio-group.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=radio-group&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=radio-group&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=radio-group&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=radio-group&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=radio-group)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=radio-group&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"slider":{"name":"## slider","description":"> 组件类型:UniSliderElement \n\n 滑动选择器","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| disabled | boolean | - | | 是否禁用 |\n| min | number | 0 | | slider 最小值 |\n| max | number | 100 | | slider 最大值 |\n| step | number | 1 | | slider 步长,取值必须大于 0,并且可被(max - min)整除 |\n| value | number | 0 | | radio当前取值 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | slider 滑块左侧已选择部分的线条颜色 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#e9e9e9\" | | radio背景条的颜色 |\n| block-size | number | 28 | | radio滑块的大小,取值范围为 12 - 28 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | slider 的滑块背景颜色 |\n| show-value | boolean | false | | 是否显示当前 value |\n| @change | (event: [UniSliderChangeEvent](#unisliderchangeevent)) => void | - | | 完成一次拖动后触发的事件,event.detail = {value: value} |\n| @changing | (event: [UniSliderChangeEvent](#unisliderchangeevent)) => void | - | | 拖动过程中触发的事件,event.detail = {value: value} |\n| color | color | - | | - |\n| selected-color | color | - | | - |\n| ~~block-color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | 滑块颜色 (使用foreColor替代) |\n| ~~activeColor~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | slider 滑块左侧已选择部分的线条颜色 |","event":"\n### 事件\n#### UniSliderChangeEvent\n\n```mermaid\ngraph LR\n \nUniSliderChangeEvent -- Extends --> UniCustomEvent<UniSliderChangeEventDetail>\n style UniCustomEvent<UniSliderChangeEventDetail> color:#42b983\n click UniCustomEvent<UniSliderChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniSliderChangeEventDetail\n\n\n###### UniSliderChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | number | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/slider/slider.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/slider/slider\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/slider/slider\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n uni-app-x\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 显示当前value\r\n \r\n \r\n \r\n\r\n 设置步进:step=10跳动\r\n \r\n \r\n 0\r\n 100\r\n \r\n \r\n \r\n\r\n 浮点步进:step=0.01跳动\r\n \r\n \r\n \r\n\r\n 设置最小/最大值\r\n \r\n \r\n \r\n\r\n 不同颜色和大小的滑块\r\n \r\n \r\n \r\n 暗黑模式\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n sliderValue: 50,\r\n sliderBlockSize: 20,\r\n sliderBackgroundColor: \"#000000\",\r\n sliderActiveColor: \"#FFCC33\",\r\n sliderBlockColor: \"#8A6DE9\",\r\n // 组件属性 autotest\r\n show_value_boolean: false,\r\n disabled_boolean: false,\r\n min_input: 0,\r\n max_input: 100,\r\n step_input: 1,\r\n value_input: 0,\r\n activeColor_input: \"#007aff\",\r\n backgroundColor_input: \"#e9e9e9\",\r\n block_size_input: 28,\r\n block_color_input: \"#ffffff\",\r\n valueColor: \"#888888\",\r\n };\r\n },\r\n methods: {\r\n sliderChange(e : UniSliderChangeEvent) {\r\n console.log(\"value 发生变化:\" + e.detail.value);\r\n },\r\n slider_click() {\r\n console.log(\"组件被点击时触发\");\r\n },\r\n slider_touchstart() {\r\n console.log(\"手指触摸动作开始\");\r\n },\r\n slider_touchmove() {\r\n console.log(\"手指触摸后移动\");\r\n },\r\n slider_touchcancel() {\r\n console.log(\"手指触摸动作被打断,如来电提醒,弹窗\");\r\n },\r\n slider_touchend() {\r\n console.log(\"手指触摸动作结束\");\r\n },\r\n slider_tap() {\r\n console.log(\"手指触摸后马上离开\");\r\n },\r\n slider_longpress() {\r\n console.log(\r\n \"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\"\r\n );\r\n },\r\n slider_change() {\r\n console.log(\"完成一次拖动后触发的事件,event.detail = {value: value}\");\r\n },\r\n slider_changing() {\r\n console.log(\"拖动过程中触发的事件,event.detail = {value: value}\");\r\n },\r\n change_show_value_boolean(checked : boolean) {\r\n this.show_value_boolean = checked;\r\n },\r\n change_disabled_boolean(checked : boolean) {\r\n this.disabled_boolean = checked;\r\n },\r\n confirm_min_input(value : number) {\r\n this.min_input = value;\r\n },\r\n confirm_max_input(value : number) {\r\n this.max_input = value;\r\n },\r\n confirm_step_input(value : number) {\r\n this.step_input = value;\r\n },\r\n confirm_value_input(value : number) {\r\n this.value_input = value;\r\n },\r\n confirm_activeColor_input(value : string) {\r\n this.activeColor_input = value;\r\n },\r\n confirm_backgroundColor_input(value : string) {\r\n this.backgroundColor_input = value;\r\n },\r\n confirm_block_size_input(value : number) {\r\n this.block_size_input = value;\r\n },\r\n confirm_block_color_input(value : string) {\r\n this.block_color_input = value;\r\n },\r\n confirm_value_color_input(value : string) {\r\n this.valueColor = value;\r\n },\r\n },\r\n };\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.slider)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/slider.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/slider.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=slider&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=slider&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=slider&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=slider&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=slider)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=slider&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"switch":{"name":"## switch","description":"> 组件类型:UniSwitchElement \n\n 开关选择器","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| checked | boolean | - | | 是否选中 |\n| type | string | - | | 样式,有效值:switch, checkbox |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| switch | | |\n@| checkbox | | |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的关闭状态背景颜色 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的开启状态背景颜色 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的滑块背景颜色 |\n| activeForeColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的开启状态下的滑块背景颜色 |\n| disabled | boolean | - | | 是否禁用 |\n| @change | (event: [UniSwitchChangeEvent](#uniswitchchangeevent)) => void | - | | checked 改变时触发 change 事件,event.detail={ value:checked} |\n| ~~color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的颜色,同 css 的 color (使用foreColor替代) |","event":"\n### 事件\n#### UniSwitchChangeEvent\n\n```mermaid\ngraph LR\n \nUniSwitchChangeEvent -- Extends --> UniCustomEvent<UniSwitchChangeEventDetail>\n style UniCustomEvent<UniSwitchChangeEventDetail> color:#42b983\n click UniCustomEvent<UniSwitchChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniSwitchChangeEventDetail\n\n\n###### UniSwitchChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | boolean | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/switch/switch.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/switch/switch\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/switch/switch\n\n>Template\n```vue\n\r\n \r\n \r\n 默认样式\r\n \r\n \r\n \r\n \r\n 暗黑样式\r\n \r\n \r\n \r\n \r\n 禁用样式\r\n \r\n \r\n \r\n \r\n 不同颜色和尺寸的switch\r\n \r\n \r\n \r\n \r\n 推荐展示样式\r\n \r\n \r\n \r\n 开启中\r\n \r\n \r\n \r\n 关闭\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'switch 开关',\r\n checked: true,\r\n color: '#FFCC33',\r\n clickCheckedValue: true,\r\n testVerifyEvent: false,\r\n }\r\n },\r\n methods: {\r\n switch1Change: function (e : UniSwitchChangeEvent) {\r\n this.clickCheckedValue = e.detail.value\r\n console.log('switch1 发生 change 事件,携带值为', e.detail.value)\r\n\r\n // 仅测试\r\n this.testVerifyEvent = (e.type == 'change' && (e.target?.tagName ?? '') == \"SWITCH\")\r\n },\r\n switch2Change: function (e : UniSwitchChangeEvent) {\r\n console.log('switch2 发生 change 事件,携带值为', e.detail.value)\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.switch)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/switch.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/switch.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=switch&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=switch&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=switch&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=switch&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=switch)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=switch&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"textarea":{"name":"## textarea","description":"> 组件类型:[UniTextareaElement](/dom/unitextareaelement.md) \n\n 多行输入框","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| value | string | \"\" | | 输入框的初始内容 |\n| placeholder | string | \"\" | | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | | 指定 placeholder 的样式,目前仅支持color,font-size和font-weight |\n| placeholder-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"\" | | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | \"不限制长度\" | | 最大输入长度,0和正数为合法值,非法值的时候不限制最大长度 |\n| auto-focus | boolean | false | | 自动获取焦点,与`focus`属性对比,此属性只会首次生效。 |\n| focus | boolean | false | | 获取焦点 |\n| confirm-type | return \\| send \\| search \\| next \\| go \\| done | \"return\" | | 设置键盘右下角按钮的文字 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| return | | 换行 |\n@| send | | 发送 |\n@| search | | 搜索 |\n@| next | | 下一个 |\n@| go | | 前往 |\n@| done | | 完成 |\n| cursor | number | 0 | | 指定focus时的光标位置 |\n| confirm-hold | boolean | false | | 点击键盘右下角按钮时是否保持键盘不收起 |\n| auto-height | boolean | false | | 是否自动增高,设置auto-height时,style.height不生效 |\n| fixed | boolean | - | | 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true |\n| cursor-spacing | number | 0 | | 指定光标与键盘的距离,单位 px 。取 textarea 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 |\n| cursor-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"\" | | 指定光标颜色 |\n| show-confirm-bar | boolean | - | | 是否显示键盘上方带有”完成“按钮那一栏 |\n| selection-start | number | -1 | | 光标起始位置,自动聚集时有效,需与selection-end搭配使用 |\n| selection-end | number | -1 | | 光标结束位置,自动聚集时有效,需与selection-satrt搭配使用 |\n| adjust-position | boolean | true | | 键盘弹起时,是否自动上推页面 |\n| inputmode | none \\| text \\| decimal \\| numeric \\| tel \\| search \\| email \\| url | \"text\" | | 是一个枚举属性,它提供了用户在编辑元素或其内容时可能输入的数据类型的提示。在符合条件的高版本webview里,uni-app的 web 和 app-vue 平台中可使用本属性。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 无虚拟键盘。在应用程序或者站点需要实现自己的键盘输入控件时很有用。 |\n@| text | | 使用用户本地区域设置的标准文本输入键盘。 |\n@| decimal | | 小数输入键盘,包含数字和分隔符(通常是“ . ”或者“ , ”),设备可能也可能不显示减号键。 |\n@| numeric | | 数字输入键盘,所需要的就是 0 到 9 的数字,设备可能也可能不显示减号键。 |\n@| tel | | 电话输入键盘,包含 0 到 9 的数字、星号(*)和井号(#)键。表单输入里面的电话输入通常应该使用 \\ 。 |\n@| search | | 为搜索输入优化的虚拟键盘,比如,返回键可能被重新标记为“搜索”,也可能还有其他的优化。 |\n@| email | | 为邮件地址输入优化的虚拟键盘,通常包含\"@\"符号和其他优化。表单里面的邮件地址输入应该使用 \\ 。 |\n@| url | | 为网址输入优化的虚拟键盘,比如,“/”键会更加明显、历史记录访问等。表单里面的网址输入通常应该使用 \\ 。 |\n| hold-keyboard | boolean | false | | focus时,点击页面的时候不收起键盘 |\n| @confirm | (event: [UniInputConfirmEvent](#uniinputconfirmevent)) => void | - | | 点击完成时, 触发 confirm 事件,event.detail = {value: value} |\n| @input | (event: [UniInputEvent](#uniinputevent)) => void | - | | 当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上 |\n| @linechange | (event: [UniTextareaLineChangeEvent](#unitextarealinechangeevent)) => void | - | | 输入框行数变化时调用,event.detail = {height: 0, heightRpx: 0, lineCount: 0} |\n| @blur | (event: [UniTextareaBlurEvent](#unitextareablurevent)) => void | - | | 输入框失去焦点时触发,event.detail = {value, cursor} |\n| @keyboardheightchange | (event: [UniInputKeyboardHeightChangeEvent](#uniinputkeyboardheightchangeevent)) => void | - | | 键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration} |\n| @focus | (event: [UniTextareaFocusEvent](#unitextareafocusevent)) => void | - | | 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度,在基础库 1.9.90 起支持 |\n| disabled | boolean | - | | - |\n| disable-default-padding | boolean | - | | - |\n| adjust-keyboard-to | boolean | - | | *(boolean)*
键盘对齐位置 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| cursor | | |\n@| bottom | | |","event":"\n### 事件\n#### UniInputConfirmEvent\n\n```mermaid\ngraph LR\n \nUniInputConfirmEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputConfirmEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n\n\n#### UniInputEvent\n\n```mermaid\ngraph LR\n \nUniInputEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 光标的位置 |\n@| keyCode | number | 是 | - | - | 输入字符的Unicode值 |\n\n\n#### UniTextareaLineChangeEvent\n\n```mermaid\ngraph LR\n \nUniTextareaLineChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniTextareaLineChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniTextareaLineChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| lineCount | number | 是 | - | - | 行数 |\n@| heightRpx | number | 是 | - | - | textarea的高度 |\n@| height | number | 是 | - | - | textarea的高度 |\n\n\n#### UniTextareaBlurEvent\n\n```mermaid\ngraph LR\n \nUniTextareaBlurEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniTextareaBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniTextareaBlurEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 选择区域的起始位置 |\n\n\n#### UniInputKeyboardHeightChangeEvent\n\n```mermaid\ngraph LR\n \nUniInputKeyboardHeightChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputKeyboardHeightChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | - | 键盘高度 |\n@| duration | number | 是 | - | - | 持续时间 |\n\n\n#### UniTextareaFocusEvent\n\n```mermaid\ngraph LR\n \nUniTextareaFocusEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniTextareaFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniTextareaFocusEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | | 键盘高度 |\n@| value | string | 是 | - | - | 输入框内容 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/textarea/textarea.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/textarea/textarea\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/textarea/textarea\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n maxlength 输入最大长度为10\r\n \r\n \r\n \r\n \r\n\r\n \r\n cursor-spacing、placeholder-class、placeholder-style例子\r\n \r\n \r\n \r\n \r\n \r\n 设置输入框聚焦时光标的起始位置和结束位置(点击生效)\r\n \r\n \r\n \r\n \r\n\r\n \r\n 设置hold-keyboard\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n 同时存在 v-model 和 value\r\n \r\n \r\n \r\n \r\n\r\n \r\n 设置adjust-position\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n adjust_position_boolean: false,\r\n show_confirm_bar_boolean: false,\r\n fixed_boolean: false,\r\n auto_height_boolean: false,\r\n confirm_hold_boolean: false,\r\n focus_boolean: true,\r\n auto_focus_boolean: false,\r\n default_value: \"1\\n2\\n3\\n4\\n5\\n6\",\r\n inputmode_enum: [{ \"value\": 1, \"name\": \"text\" }, { \"value\": 2, \"name\": \"decimal\" }, { \"value\": 3, \"name\": \"numeric\" }, { \"value\": 4, \"name\": \"tel\" }, { \"value\": 5, \"name\": \"search\" }, { \"value\": 6, \"name\": \"email\" }, { \"value\": 7, \"name\": \"url\" }, { \"value\": 0, \"name\": \"none\" }] as ItemType[],\r\n confirm_type_list: [{ \"value\": 0, \"name\": \"return\" }, { \"value\": 1, \"name\": \"done\" }, { \"value\": 2, \"name\": \"send\" }, { \"value\": 3, \"name\": \"search\" }, { \"value\": 4, \"name\": \"next\" }, { \"value\": 5, \"name\": \"go\" }] as ItemType[],\r\n cursor_color: \"#3393E2\",\r\n cursor: 0,\r\n inputmode_enum_current: 0,\r\n confirm_type_current: 0,\r\n placeholder_value: \"请输入\",\r\n defaultModel: '123',\r\n textareaMaxLengthValue: \"\",\r\n selectionStart: -1,\r\n selectionEnd: -1,\r\n hold_keyboard: false,\r\n adjust_position: false\r\n }\r\n },\r\n\r\n methods: {\r\n textarea_click() { console.log(\"组件被点击时触发\") },\r\n textarea_touchstart() { console.log(\"手指触摸动作开始\") },\r\n textarea_touchmove() { console.log(\"手指触摸后移动\") },\r\n textarea_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n textarea_touchend() { console.log(\"手指触摸动作结束\") },\r\n textarea_tap() { console.log(\"手指触摸后马上离开\") },\r\n textarea_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n textarea_confirm() { console.log(\"点击完成时, 触发 confirm 事件,event.detail = {value: value}\") },\r\n textarea_input() { console.log(\"当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上\") },\r\n textarea_linechange() { console.log(\"输入框行数变化时调用,event.detail = {height: 0, height: 0, lineCount: 0}\") },\r\n textarea_blur() { console.log(\"输入框失去焦点时触发,event.detail = {value, cursor}\") },\r\n textarea_keyboardheightchange() { console.log(\"键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration}\") },\r\n textarea_focus() { console.log(\"输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\") },\r\n change_adjust_position_boolean(checked : boolean) { this.adjust_position_boolean = checked },\r\n change_show_confirm_bar_boolean(checked : boolean) { this.show_confirm_bar_boolean = checked },\r\n change_fixed_boolean(checked : boolean) { this.fixed_boolean = checked },\r\n change_auto_height_boolean(checked : boolean) { this.auto_height_boolean = checked },\r\n change_confirm_hold_boolean(checked : boolean) { this.confirm_hold_boolean = checked },\r\n change_focus_boolean(checked : boolean) { this.focus_boolean = checked },\r\n change_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked },\r\n change_cursor_color_boolean(checked : boolean) { if (checked) { this.cursor_color = \"transparent\" } else { this.cursor_color = \"#3393E2\" } },\r\n radio_change_inputmode_enum(checked : number) { this.inputmode_enum_current = checked },\r\n radio_change_confirm_type(checked : number) { this.confirm_type_current = checked },\r\n setSelection: function (selectionStart : number, selectionEnd : number) {\r\n uni.getElementById(\"textarea-instance-2\")?.focus()\r\n this.selectionStart = selectionStart;\r\n this.selectionEnd = selectionEnd;\r\n },\r\n onSelectionBlurChange() {\r\n this.selectionEnd = 0;\r\n },\r\n changeHoldKeyboard(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.hold_keyboard = checked;\r\n },\r\n changeAdjustPosition(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.adjust_position = checked;\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.textarea)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/textarea.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/textarea.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=textarea&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=textarea&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=textarea&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=textarea&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=textarea)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=textarea&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"keyboard-accessory":{"name":"## keyboard-accessory","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.keyboard-accessory)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/keyboard-accessory.html)"},"navigator":{"name":"## navigator","description":"> 组件类型:UniNavigatorElement \n\n 页面链接","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| target | string | - | | 在哪个目标上发生跳转,默认当前应用 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| self | | |\n@| miniProgram | | |\n| url | string([string.PageURIString](/uts/data-type.md#ide-string)) | - | | 当前应用内的跳转链接 |\n| open-type | string | \"navigate\" | | 跳转方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| navigate | | 对应 uni.navigateTo 或 navigateToMiniProgram 的功能 |\n@| redirect | | 对应 uni.redirectTo 的功能 |\n@| switchTab | | 对应 uni.switchTab 的功能 |\n@| reLaunch | | 对应 uni.reLaunch 的功能 |\n@| navigateBack | | 对应 uni.navigateBack 的功能 |\n@| exit | | |\n| delta | number | - | | 当 open-type 为 navigateBack 时有效,表示回退的层数 |\n| app-id | string | - | | 当target=\"miniProgram\"时有效,要打开的小程序 appId |\n| path | string | - | | 当target=\"miniProgram\"时有效,打开的页面路径,如果为空则打开首页 |\n| extra-data | object | - | | 当target=\"miniProgram\"时有效,需要传递给目标应用的数据,目标应用可在 App.onLaunch(),App.onShow() 中获取到这份数据 |\n| version | string | - | | 当target=\"miniProgram\"时有效,要打开的小程序版本,有效值 develop(开发版),trial(体验版),release(正式版),仅在当前小程序为开发版或体验版时此参数有效;如果当前小程序是体验版或正式版,则打开的小程序必定是正式版 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| develop | | |\n@| trial | | |\n@| release | | |\n| animation-type | string | \"pop-in/out\" | | 当 open-type=\"navigateTo\" 或 open-type=\"navigateBack\" 时有效,窗口的显示/关闭的动画类型。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| auto | - | 自动选择动画效果 |\n@| none | - | 无动画效果 |\n@| slide-in-right | - | 从右侧横向滑动效果 |\n@| slide-in-left | - | 左侧横向滑动效果 |\n@| slide-in-top | - | 从上侧竖向滑动效果 |\n@| slide-in-bottom | - | 从下侧竖向滑动效果 |\n@| fade-in | - | 从透明到不透明逐渐显示效果 |\n@| zoom-out | - | 从小到大逐渐放大显示效果 |\n@| zoom-fade-out | - | 从小到大逐渐放大并且从透明到不透明逐渐显示效果 |\n@| pop-in | - | 从右侧平移入栈动画效果 |\n@| slide-out-right | - | 横向向右侧滑出屏幕动画 |\n@| slide-out-left | - | 横向向左侧滑出屏幕动画 |\n@| slide-out-top | - | 竖向向上侧滑出屏幕动画 |\n@| slide-out-bottom | - | 竖向向下侧滑出屏幕动画 |\n@| fade-out | - | 从不透明到透明逐渐隐藏动画 |\n@| zoom-in | - | 从大逐渐缩小关闭动画 |\n@| zoom-fade-in | - | 从大逐渐缩小并且从不透明到透明逐渐隐藏关闭动画 |\n@| pop-out | - | 从右侧平移出栈动画效果 |\n| animation-duration | number | 300 | | 当 open-type=\"navigateTo\" 或 open-type=\"navigateBack\" 时有效,窗口的显示/关闭动画的持续时间。 |\n| hover-class | string | - | | 指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果 |\n| hover-stop-propagation | boolean | - | | 指定是否阻止本节点的祖先节点出现点击态 |\n| hover-start-time | number | - | | 按住后多久出现点击态,单位毫秒 |\n| hover-stay-time | number | - | | 手指松开后点击态保留时间,单位毫秒 |\n| render-link | boolean | true | | 是否给 navigator 组件加一层 a 标签控制 ssr 渲染 |\n| short-link | string | - | | - |\n| bindsuccess | string | - | | - |\n| bindfail | string | - | | - |\n| bindcomplete | string | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/navigator/navigator.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/navigator/navigator\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/navigator/navigator\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 两端对齐样式测试\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'navigator'\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.navigation.navigator)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/navigator.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=navigator&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=navigator&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=navigator&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=navigator&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=navigator)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=navigator&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"image":{"name":"## image","description":"> 组件类型:[UniImageElement](/dom/uniimageelement.md) \n\n 图片","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| src | string([string.ImageURIString](/uts/data-type.md#ide-string)) | - | | 图片资源地址 |\n| mode | string | \"scaleToFill\" | | 图片裁剪、缩放的模式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| scaleToFill | | 不保持纵横比缩放图片,使图片的宽高完全拉伸至填满 image 元素 |\n@| aspectFit | | 保持纵横比缩放图片,使图片的长边能完全显示出来。也就是说,可以完整地将图片显示出来。 |\n@| aspectFill | | 保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说,图片通常只在水平或垂直方向是完整的,另一个方向将会发生截取 |\n@| widthFix | | 宽度不变,高度自动变化,保持原图宽高比不变 |\n@| heightFix | | 高度不变,宽度自动变化,保持原图宽高比不变 |\n@| top | | 不缩放图片,只显示图片的顶部区域 |\n@| bottom | | 不缩放图片,只显示图片的底部区域 |\n@| center | | 不缩放图片,只显示图片的中间区域 |\n@| left | | 不缩放图片,只显示图片的左边区域 |\n@| right | | 不缩放图片,只显示图片的右边区域 |\n@| top left | | 不缩放图片,只显示图片的左上边区域 |\n@| top right | | 不缩放图片,只显示图片的右上边区域 |\n@| bottom left | | 不缩放图片,只显示图片的左下边区域 |\n@| bottom right | | 不缩放图片,只显示图片的右下边区域 |\n| lazy-load | boolean | false | | 图片懒加载。只针对page与scroll-view下的image有效。 安卓默认懒加载不支持修改 |\n| fade-show | boolean | false | | 图片显示动画效果 |\n| webp | boolean | true | | 是否支持 webP 格式 |\n| show-menu-by-longpress | boolean | false | | 开启长按图片显示识别小程序码菜单 |\n| draggable | boolean | false | | 鼠标长按是否能拖动图片(仅H5平台) |\n| @error | (event: [UniImageErrorEvent](#uniimageerrorevent)) => void | - | | 图片加载错误时触发,event.detail = { errMsg } |\n| @load | (event: [UniImageLoadEvent](#uniimageloadevent)) => void | - | | 图片加载完成时触发,event.detail = { width: '图片宽度px', height: '图片高度px' } |","event":"\n### 事件\n#### UniImageErrorEvent\n\n```mermaid\ngraph LR\n \nUniImageErrorEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniImageErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniImageErrorEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| errMsg | string | 是 | - | - | 错误信息 |\n\n\n#### UniImageLoadEvent\n\n```mermaid\ngraph LR\n \nUniImageLoadEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniImageLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniImageLoadEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| width | number | 是 | - | - | 图片宽度 |\n@| height | number | 是 | - | - | 图片高度 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/image/image.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/image/image\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/image/image\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'image',\r\n imageSrc: \"/static/test-image/logo.png\" as string.ImageURIString,\r\n loadError: false,\r\n // 自动化测试\r\n autoTest: false,\r\n setCookieImage: \"\",\r\n verifyCookieImage: \"\",\r\n eventLoad: null as UTSJSONObject | null,\r\n eventError: null as UTSJSONObject | null\r\n }\r\n },\r\n methods: {\r\n error(event : ImageErrorEvent) {\r\n this.loadError = true\r\n console.log(event.type, event.detail);\r\n if (this.autoTest) {\r\n this.eventError = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n // \"errMsg\": event.detail.errMsg\r\n };\r\n }\r\n },\r\n load(event : ImageLoadEvent) {\r\n console.log(event.type, event.detail);\r\n if (this.autoTest) {\r\n this.eventLoad = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"width\": event.detail.width,\r\n \"height\": event.detail.height\r\n };\r\n }\r\n },\r\n imageFormat() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-format'\r\n });\r\n },\r\n imageMode() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-mode'\r\n });\r\n },\r\n imagePath() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-path'\r\n });\r\n },\r\n imageLarge() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-large'\r\n });\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.image)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/image.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=image&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=image&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=image&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=image&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=image)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=image&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"video":{"name":"## video","description":"> 组件类型:[UniVideoElement](/dom/univideoelement.md) \n\n 视频","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| loop | boolean | false | | 是否循环播放 |\n| src | string([string.VideoURIString](/uts/data-type.md#ide-string)) | - | | 视频资源地址 |\n| initial-time | number | 0 | | 指定视频初始播放位置 |\n| duration | number | - | | 指定视频长度 |\n| controls | boolean | true | | 是否显示默认播放控件(播放/暂停按钮、播放进度、时间) |\n| danmu-list | array | - | | 弹幕列表 |\n| danmu-btn | boolean | false | | 是否显示弹幕按钮,只在初始化时有效,不能动态变更 |\n| enable-danmu | boolean | false | | 是否展示弹幕,只在初始化时有效,不能动态变更 |\n| autoplay | boolean | false | | 是否自动播放 |\n| muted | boolean | false | | 是否静音播放 |\n| page-gesture | boolean | false | | 在非全屏模式下,是否开启亮度与音量调节手势 |\n| direction | number | - | | 设置全屏时视频的方向,不指定则根据宽高比自动判断。有效值为 0(正常竖向), 90(屏幕逆时针90度), -90(屏幕顺时针90度) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| 0 | | |\n@| 90 | | |\n@| -90 | | |\n| show-progress | boolean | true | | 若不设置,宽度大于240时才会显示 |\n| show-fullscreen-btn | boolean | true | | 是否显示全屏按钮 |\n| show-play-btn | boolean | true | | 是否显示视频底部控制栏的播放按钮 |\n| show-center-play-btn | boolean | true | | 是否显示视频中间的播放按钮 |\n| show-loading | boolean | true | | 是否显示loading控件 |\n| enable-progress-gesture | boolean | true | | 是否开启控制进度的手势 |\n| object-fit | string | \"contain\" | | 当视频大小与 video 容器大小不一致时,视频的表现形式。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| contain | | 包含 |\n@| fill | | 填充 |\n@| cover | | 覆盖 |\n| poster | string | - | | 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效 |\n| show-mute-btn | boolean | false | | 是否显示静音按钮 |\n| title | string | - | | 视频的标题,全屏时在顶部展示 |\n| play-btn-position | string | - | | 播放按钮的位置 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| bottom | | |\n@| center | | |\n| enable-play-gesture | boolean | false | | 是否开启播放手势,即双击切换播放、暂停 |\n| auto-pause-if-navigate | boolean | - | | 当跳转到其它页面时,是否自动暂停本页面的视频 |\n| auto-pause-if-open-native | boolean | - | | 当跳转到其它小程序宿主原生页面时,是否自动暂停本页面的视频 |\n| vslide-gesture | boolean | false | | 在非全屏模式下,是否开启亮度与音量调节手势(同 page-gesture) |\n| vslide-gesture-in-fullscreen | boolean | true | | 在全屏模式下,是否开启亮度与音量调节手势 |\n| ad-unit-id | string | - | | 视频前贴广告单元ID |\n| poster-for-crawler | string | - | | 用于给搜索等场景作为视频封面展示,建议使用无播放 icon 的视频封面图,只支持网络地址 |\n| codec | string | \"hardware\" | | 解码器选择 |\n| http-cache | boolean | false | | 是否对 http、https 视频源开启本地缓存 |\n| play-strategy | number | 0 | | 播放策略 |\n| is-live | boolean | - | | 是否为直播源 |\n| @loadedmetadata | (event: [UniVideoLoadedMetadataEvent](#univideoloadedmetadataevent)) => void | - | | 视频元数据加载完成时触发 |\n| @play | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当开始/继续播放时触发 |\n| @pause | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当暂停播放时触发 |\n| @ended | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当播放到视频末尾时触发 |\n| @timeupdate | (event: [UniVideoTimeUpdateEvent](#univideotimeupdateevent)) => void | - | | 播放进度变化时触发,event.detail = { currentTime, duration }。触发频率 250ms 一次 |\n| @fullscreenchange | (event: [UniVideoFullScreenChangeEvent](#univideofullscreenchangeevent)) => void | - | | 当视频进入和退出全屏时触发,event.detail = { fullScreen, direction },direction取为 vertical 或 horizontal |\n| @waiting | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 视频出现缓冲时触发 |\n| @error | (event: [UniVideoErrorEvent](#univideoerrorevent)) => void | - | | 播放出错时触发 |\n| @progress | (event: [UniVideoProgressEvent](#univideoprogressevent)) => void | - | | 加载进度变化时触发,只支持一段加载。event.detail = { buffered },百分比 |\n| @fullscreenclick | (event: [UniVideoFullScreenClickEvent](#univideofullscreenclickevent)) => void | - | | 视频全屏播放时点击屏幕触发。event.detail = { screenX, screenY, screenWidth, screenHeight } |\n| @controlstoggle | (event: [UniVideoControlsToggleEvent](#univideocontrolstoggleevent)) => void | - | | 切换 controls 显示隐藏时触发。event.detail = { show } |\n| show-bottom-progress | boolean | - | | - |\n| show-casting-button | boolean | - | | - |\n| picture-in-picture-mode | string/Array | - | | *(string/Array)*
设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: \\[\"push\", \"pop\"] |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| [] | | |\n@| push | | |\n@| pop | | |\n| picture-in-picture-show-progress | boolean | - | | - |\n| picture-in-picture-init-position= | string | - | | - |\n| enable-auto-rotation | boolean | - | | - |\n| show-screen-lock-button | boolean | - | | - |\n| show-snapshot-button | boolean | - | | - |\n| show-background-playback-button | boolean | - | | - |\n| background-poster | string | - | | - |\n| referrer-policy | string | - | | *(string)*
格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| origin | | |\n@| no-referrer | | |\n| is-drm | boolean | - | | - |\n| provision-url | string | - | | - |\n| certificate-url | string | - | | - |\n| license-url | string | - | | - |\n| preferred-peak-bit-rate | number | - | | - |\n| @enterpictureinpicture | eventhandler | - | | - |\n| @leavepictureinpicture | eventhandler | - | | - |\n| @seekcomplete | eventhandler | - | | - |\n| @castinguserselect | eventhandler | - | | - |\n| @castingstatechange | eventhandler | - | | - |\n| @castinginterrupt | eventhandler | - | | - |","event":"\n### 事件\n#### UniVideoTimeUpdateEvent\ntimeupdate 事件
播放进度变化时触发\n\n##### UniVideoTimeUpdateEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoTimeUpdateEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| currentTime | number | 是 | - | - | 当前进度 |\n@| duration | number | 是 | - | - | 总进度 |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniVideoTimeUpdateEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n\n#### UniVideoFullScreenChangeEvent\nfullscreenchange 事件
当视频进入和退出全屏是触发\n\n##### UniVideoFullScreenChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoFullScreenChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| fullScreen | boolean | 是 | - | - | 是否全屏 |\n@| direction | string | 是 | - | - | 横竖屏,取值 vertical 或 horizontal |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniVideoFullScreenChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n\n#### UniVideoErrorEvent\nerror 事件
视频播放出错时触发\n\n##### UniVideoErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **VideoError** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| errCode | number | 是 | - | - | 统一错误码
100001 网络错误
200001 内部错误
300001 SDK错误 |\n@@| 合法值 | 兼容性 | 描述 |\n@@| :- | :-: | :- |\n@@| 100001 | - | - |\n@@| 200001 | - | - |\n@@| 300001 | - | - |\n@| errSubject | string | 是 | - | - | 统一错误主题(模块)名称 |\n@| data | any | 否 | - | - | 错误信息中包含的数据 |\n@| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) | 否 | - | - | 源错误信息,可以包含多个错误,详见SourceError |\n@| errMsg | string | 是 | - | - | - |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniVideoErrorEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n\n#### UniVideoProgressEvent\nprogress 事件
加载进度变化时触发\n\n##### UniVideoProgressEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoProgressEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| buffered | number | 是 | - | - | 加载进度百分比 |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniVideoProgressEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n\n#### UniVideoFullScreenClickEvent\nfullscreenclick 事件
视频播放全屏播放时点击事件\n\n##### UniVideoFullScreenClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoFullScreenClickEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| screenX | number | 是 | - | - | 点击点相对于屏幕左侧边缘的 X 轴坐标 |\n@| screenY | number | 是 | - | - | 点击点相对于屏幕顶部边缘的 Y 轴坐标 |\n@| screenWidth | number | 是 | - | - | 屏幕总宽度 |\n@| screenHeight | number | 是 | - | - | 屏幕总高度 |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniVideoFullScreenClickEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n\n#### UniVideoControlsToggleEvent\ncontrolstoggle 事件
切换播放控件显示隐藏时触发\n\n##### UniVideoControlsToggleEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoControlsToggleEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| show | boolean | 是 | - | - | 是否显示 |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniVideoControlsToggleEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/video/video.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/video/video\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/video/video\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 子组件实现快进、快退、发送弹幕功能(全屏后显示)\r\n \r\n \r\n \r\n \r\n API示例\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 属性示例\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types';\r\n // #ifdef APP-ANDROID\r\n import ViewGroup from 'android.view.ViewGroup';\r\n // #endif\r\n export default {\r\n onReady() {\r\n this.videoContext = uni.createVideoContext('video');\r\n // this.videoContext = uni.createVideoContext('video', this);\r\n },\r\n data() {\r\n return {\r\n videoContext: null as VideoContext | null,\r\n // 属性\r\n src: \"https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4\",\r\n autoplay: false,\r\n loop: false,\r\n muted: false,\r\n initialTime: 0,\r\n duration: 0,\r\n controls: true,\r\n danmuList: [{\r\n text: '要显示的文本',\r\n color: '#FF0000',\r\n time: 3\r\n }, {\r\n text: '要显示的文本2',\r\n color: '#31ff23',\r\n time: 5\r\n }, {\r\n text: '要显示的文本3',\r\n color: '#f13ef8',\r\n time: 7\r\n }, {\r\n text: '要显示的文本4',\r\n color: '#4972f8',\r\n time: 9\r\n }, {\r\n text: '要显示的文本5',\r\n color: '#000000',\r\n time: 11\r\n }] as Array,\r\n danmuBtn: false,\r\n enableDanmu: true,\r\n pageGesture: false,\r\n direction: -1,\r\n directionItemTypes: [{ \"value\": 0, \"name\": \"0(正常竖向)\" }, { \"value\": 1, \"name\": \"90(屏幕逆时针90度)\" }, { \"value\": 2, \"name\": \"-90(屏幕顺时针90度)\" }] as ItemType[],\r\n directionItems: [0, 90, -90],\r\n showProgress: true,\r\n showFullscreenBtn: true,\r\n showPlayBtn: true,\r\n showCenterPlayBtn: true,\r\n showLoading: true,\r\n enableProgressGesture: true,\r\n objectFit: \"contain\",\r\n objectFitItemTypes: [{ \"value\": 0, \"name\": \"contain(包含)\" }, { \"value\": 1, \"name\": \"fill(填充)\" }, { \"value\": 2, \"name\": \"cover(覆盖)\" }] as ItemType[],\r\n objectFitItems: [\"contain\", \"fill\", \"cover\"],\r\n poster: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-android.png\",\r\n showMuteBtn: false,\r\n title: \"video-component\",\r\n enablePlayGesture: false,\r\n vslideGesture: false,\r\n vslideGestureInFullscreen: true,\r\n codec: \"hardware\",\r\n codecItemTypes: [{ \"value\": 0, \"name\": \"hardware(硬解码)\" }, { \"value\": 1, \"name\": \"software(软解码)\" }] as ItemType[],\r\n codecItems: [\"hardware\", \"software\"],\r\n httpCache: true,\r\n playStrategy: 0,\r\n playStrategyItemTypes: [{ \"value\": 0, \"name\": \"0(普通模式)\" }, { \"value\": 1, \"name\": \"1(平滑播放模式)\" }, { \"value\": 1, \"name\": \"2(M3U8优化模式)\" }] as ItemType[],\r\n playStrategyItems: [0, 1, 2],\r\n header: {\r\n 'User-Agent': 'User-Agent test',\r\n 'header': 'header test',\r\n 'cookie': 'cookie test'\r\n } as UTSJSONObject,\r\n // API\r\n pos: 0,\r\n requestFullScreenOptions: null as RequestFullScreenOptions | null,\r\n danmu: {\r\n text: '要显示的文本',\r\n color: '#FF0000'\r\n } as Danmu,\r\n rate: 1,\r\n rateItemTypes: [{ \"value\": 0, \"name\": \"0.5\" }, { \"value\": 1, \"name\": \"0.8\" }, { \"value\": 2, \"name\": \"1.0\" }, { \"value\": 3, \"name\": \"1.25\" }, { \"value\": 4, \"name\": \"1.5\" }] as ItemType[],\r\n rateItems: [0.5, 0.8, 1.0, 1.25, 1.5],\r\n subCompEnable: false,\r\n subCompShow: false,\r\n curPos: 0,\r\n endPos: 0,\r\n // 自动化测试\r\n autoTest: false,\r\n isPlaying: false,\r\n isPause: false,\r\n isError: false,\r\n eventPlay: null as UTSJSONObject | null,\r\n eventPause: null as UTSJSONObject | null,\r\n eventEnded: null as UTSJSONObject | null,\r\n eventTimeupdate: null as UTSJSONObject | null,\r\n eventFullscreenchange: null as UTSJSONObject | null,\r\n eventWaiting: null as UTSJSONObject | null,\r\n eventError: null as UTSJSONObject | null,\r\n eventProgress: null as UTSJSONObject | null,\r\n eventFullscreenclick: null as UTSJSONObject | null,\r\n eventControlstoggle: null as UTSJSONObject | null\r\n }\r\n },\r\n onLoad() {\r\n },\r\n methods: {\r\n // API\r\n play: function () {\r\n console.log(\"play\");\r\n this.videoContext?.play();\r\n },\r\n pause: function () {\r\n console.log(\"pause\");\r\n (uni.getElementById(\"video\") as UniVideoElement).pause(); //as写法测试。注意id不对时as会崩溃\r\n // this.videoContext?.pause();\r\n },\r\n seek: function (pos : number) {\r\n console.log(\"seek -> \" + pos);\r\n this.videoContext?.seek(pos);\r\n },\r\n onSeekInput: function (event : UniInputEvent) {\r\n this.pos = parseInt(event.detail.value);\r\n },\r\n requestFullScreen: function () {\r\n console.log(\"requestFullScreen -> \" + this.requestFullScreenOptions);\r\n this.videoContext?.requestFullScreen(this.requestFullScreenOptions);\r\n },\r\n exitFullScreen: function () {\r\n console.log(\"exitFullScreen\");\r\n this.videoContext?.exitFullScreen();\r\n },\r\n stop: function () {\r\n console.log(\"stop\");\r\n uni.getElementById(\"video\")?.stop(); //泛型写法测试\r\n // this.videoContext?.stop();\r\n },\r\n sendDanmu: function () {\r\n console.log(\"sendDanmu -> \" + this.danmu);\r\n this.videoContext?.sendDanmu(this.danmu);\r\n },\r\n onSendDanmuInput: function (event : UniInputEvent) {\r\n let json = JSON.parse(event.detail.value)\r\n if (json == null) return;\r\n this.danmu = json as Danmu;\r\n },\r\n playbackRate: function () {\r\n console.log(\"playbackRate -> \" + this.rate);\r\n this.videoContext?.playbackRate(this.rate);\r\n },\r\n onPlaybackRateChange: function (value : number) {\r\n this.rate = this.rateItems[value];\r\n },\r\n fastBackward: function () {\r\n let pos = this.curPos - 15;\r\n if (pos < 0) pos = 0;\r\n this.seek(pos);\r\n },\r\n fastForward: function () {\r\n let pos = this.curPos + 15;\r\n if (pos > this.endPos) pos = this.endPos;\r\n this.seek(pos);\r\n },\r\n onSendDanmuConfirm: function (event : UniInputConfirmEvent) {\r\n this.videoContext?.sendDanmu({\r\n text: event.detail.value,\r\n color: '#ff0000'\r\n } as Danmu);\r\n },\r\n onSendDanmuKeyboardHeightChange: function (event : UniInputKeyboardHeightChangeEvent) {\r\n const element = uni.getElementById('input-send-danmu') as UniElement;\r\n if (event.detail.height.toInt() == 0) {\r\n element.style.setProperty('bottom', '50px');\r\n } else {\r\n element.style.setProperty('bottom', event.detail.height + element.getBoundingClientRect().height);\r\n }\r\n },\r\n onSendDanmuBlur: function (_ : UniInputBlurEvent) {\r\n (uni.getElementById('input-send-danmu') as UniElement).style.setProperty('bottom', '50px');\r\n },\r\n // 属性\r\n onSrcComfirm: function (event : UniInputConfirmEvent) {\r\n let value = event.detail.value;\r\n if (value == '') return;\r\n this.src = value;\r\n console.log(\"src -> \" + this.src)\r\n },\r\n onAutoplayChange: function (value : boolean) {\r\n this.autoplay = value;\r\n console.log(\"autoplay -> \" + this.autoplay)\r\n },\r\n onLoopChange: function (value : boolean) {\r\n this.loop = value;\r\n console.log(\"loop -> \" + this.loop)\r\n },\r\n onMutedChange: function (value : boolean) {\r\n this.muted = value;\r\n console.log(\"muted -> \" + this.muted)\r\n },\r\n onInitialTimeComfirm: function (event : UniInputConfirmEvent) {\r\n let value = parseInt(event.detail.value)\r\n if (isNaN(value)) value = 0;\r\n this.initialTime = value;\r\n console.log(\"initialTime -> \" + this.initialTime)\r\n },\r\n onDurationComfirm: function (event : UniInputConfirmEvent) {\r\n let value = parseInt(event.detail.value)\r\n if (isNaN(value)) value = 0;\r\n this.duration = value;\r\n console.log(\"duration -> \" + this.duration)\r\n },\r\n onControlsChange: function (value : boolean) {\r\n this.controls = value;\r\n console.log(\"controls -> \" + this.controls)\r\n },\r\n onEnableDanmuChange: function (value : boolean) {\r\n this.enableDanmu = value;\r\n console.log(\"enableDanmu -> \" + this.enableDanmu)\r\n },\r\n onDanmuBtnChange: function (value : boolean) {\r\n this.danmuBtn = value;\r\n console.log(\"danmuBtn -> \" + this.danmuBtn)\r\n },\r\n onPageGestureChange: function (value : boolean) {\r\n this.pageGesture = value;\r\n console.log(\"pageGesture -> \" + this.pageGesture)\r\n },\r\n onRequestFullScreenDirectionChange: function (value : number) {\r\n let direction = this.directionItems[value];\r\n this.requestFullScreenOptions = {\r\n direction\r\n } as RequestFullScreenOptions;\r\n },\r\n onDirectionChange: function (value : number) {\r\n this.direction = this.directionItems[value];\r\n console.log(\"direction -> \" + this.direction)\r\n },\r\n onShowProgressChange: function (value : boolean) {\r\n this.showProgress = value;\r\n console.log(\"showProgress -> \" + this.showProgress)\r\n },\r\n onShowFullscreenBtnChange: function (value : boolean) {\r\n this.showFullscreenBtn = value;\r\n console.log(\"showFullscreenBtn -> \" + this.showFullscreenBtn)\r\n },\r\n onShowPlayBtnChange: function (value : boolean) {\r\n this.showPlayBtn = value;\r\n console.log(\"showPlayBtn -> \" + this.showPlayBtn)\r\n },\r\n onShowCenterPlayBtnChange: function (value : boolean) {\r\n this.showCenterPlayBtn = value;\r\n console.log(\"showCenterPlayBtn -> \" + this.showCenterPlayBtn)\r\n },\r\n onShowLoadingChange: function (value : boolean) {\r\n this.showLoading = value;\r\n console.log(\"showLoading -> \" + this.showLoading)\r\n },\r\n onEnableProgressGestureChange: function (value : boolean) {\r\n this.enableProgressGesture = value;\r\n console.log(\"enableProgressGesture -> \" + this.enableProgressGesture)\r\n },\r\n onObjectFitChange: function (value : number) {\r\n this.objectFit = this.objectFitItems[value];\r\n console.log(\"objectFit -> \" + this.objectFit)\r\n },\r\n onPosterComfirm: function (event : UniInputConfirmEvent) {\r\n let value = event.detail.value;\r\n if (value == '') return;\r\n this.poster = value;\r\n console.log(\"poster -> \" + this.poster)\r\n },\r\n onShowMuteBtnChange: function (value : boolean) {\r\n this.showMuteBtn = value;\r\n console.log(\"showMuteBtn -> \" + this.showMuteBtn)\r\n },\r\n onTitleComfirm: function (event : UniInputConfirmEvent) {\r\n let value = event.detail.value;\r\n if (value == '') return;\r\n this.title = value;\r\n console.log(\"title -> \" + this.title)\r\n },\r\n onEnablePlayGestureChange: function (value : boolean) {\r\n this.enablePlayGesture = value;\r\n console.log(\"enablePlayGesture -> \" + this.enablePlayGesture)\r\n },\r\n onVslideGestureChange: function (value : boolean) {\r\n this.vslideGesture = value;\r\n console.log(\"vslideGesture -> \" + this.vslideGesture)\r\n },\r\n onVslideGestureInFullscreenChange: function (value : boolean) {\r\n this.vslideGestureInFullscreen = value;\r\n console.log(\"vslideGestureInFullscreen -> \" + this.vslideGestureInFullscreen)\r\n },\r\n onCodecChange: function (value : number) {\r\n this.codec = this.codecItems[value];\r\n console.log(\"codec -> \" + this.codec)\r\n },\r\n onHttpCacheChange: function (value : boolean) {\r\n this.httpCache = value;\r\n console.log(\"httpCache -> \" + this.httpCache)\r\n },\r\n onPlayStrategyChange: function (value : number) {\r\n this.playStrategy = this.playStrategyItems[value];\r\n console.log(\"playStrategy -> \" + this.playStrategy)\r\n },\r\n onHeaderComfirm: function (event : UniInputConfirmEvent) {\r\n let json = JSON.parse(event.detail.value)\r\n if (json == null) return;\r\n this.header = json as UTSJSONObject;\r\n console.log(\"header -> \" + JSON.stringify(this.header))\r\n },\r\n onSubCompEnableChange: function (event : UniSwitchChangeEvent) {\r\n this.subCompEnable = event.detail.value;\r\n },\r\n // 事件\r\n onPlay: function (res : UniEvent) {\r\n console.log(res.type);\r\n this.isPlaying = true;\r\n this.isPause = false;\r\n if (this.autoTest) {\r\n this.eventPlay = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onPause: function (res : UniEvent) {\r\n console.log(res.type);\r\n this.isPlaying = false;\r\n this.isPause = true;\r\n if (this.autoTest) {\r\n this.eventPause = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onEnded: function (res : UniEvent) {\r\n console.log(res.type);\r\n if (this.autoTest) {\r\n this.eventEnded = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onTimeUpdate: function (res : UniVideoTimeUpdateEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n this.curPos = res.detail.currentTime;\r\n this.endPos = res.detail.duration;\r\n if (this.autoTest) {\r\n this.eventTimeupdate = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"currentTime\": Math.trunc(res.detail.currentTime),\r\n \"duration\": Math.trunc(res.detail.duration)\r\n };\r\n }\r\n },\r\n onFullScreenChange: function (res : UniVideoFullScreenChangeEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n this.subCompShow = res.detail.fullScreen;\r\n if (this.autoTest) {\r\n this.eventFullscreenchange = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"fullScreen\": res.detail.fullScreen,\r\n \"direction\": res.detail.direction\r\n };\r\n }\r\n },\r\n onWaiting: function (res : UniEvent) {\r\n console.log(res.type);\r\n if (this.autoTest) {\r\n this.eventWaiting = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onError: function (res : UniVideoErrorEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n this.isError = true;\r\n if (this.autoTest) {\r\n this.eventError = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"errCode\": res.detail.errCode\r\n };\r\n }\r\n },\r\n onProgress: function (res : UniVideoProgressEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n if (this.autoTest) {\r\n this.eventProgress = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"isBufferedValid\": res.detail.buffered >= 0\r\n };\r\n }\r\n },\r\n onFullScreenClick: function (res : UniVideoFullScreenClickEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n if (this.autoTest) {\r\n this.eventFullscreenclick = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"screenX\": Math.trunc(res.detail.screenX),\r\n \"screenY\": Math.trunc(res.detail.screenY),\r\n \"screenWidth\": Math.trunc(res.detail.screenWidth),\r\n \"screenHeight\": Math.trunc(res.detail.screenHeight)\r\n };\r\n }\r\n },\r\n onControlsToggle: function (res : UniVideoControlsToggleEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n if (this.autoTest) {\r\n this.eventControlstoggle = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"show\": res.detail.show\r\n };\r\n }\r\n },\r\n // 自动化测试\r\n downloadSource() {\r\n uni.downloadFile({\r\n url: 'https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4',\r\n success: (res) => {\r\n this.src = res.tempFilePath;\r\n },\r\n fail: (_) => {\r\n this.isError = true;\r\n }\r\n })\r\n },\r\n // #ifdef APP-ANDROID\r\n hasSubComponent() : boolean {\r\n const view = uni.getElementById('video')?.getAndroidView();\r\n return view == null ? false : view.getChildAt(0) instanceof ViewGroup;\r\n }\r\n // #endif\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.video)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/video.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/video.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=video&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=video&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=video&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=video&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=video)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=video&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"animation-view":{"name":"## animation-view","description":"Lottie 动画\n> 本 Component 是 uni ext component,需下载插件:[animation-view](https://ext.dcloud.net.cn/plugin?name=uni-animation-view)\n","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| path | string | \"\" | | 动画资源地址,目前只支持绝对路径 |\n| loop | boolean | false | | 动画是否循环播放 |\n| autoplay | boolean | false | | 动画是否自动播放 |\n| action | string | \"stop\" | | 动画操作,可取值 play、pause、stop |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| play | | 播放 |\n@| pause | | 暂停 |\n@| stop | | 停止 |\n| hidden | boolean | false | | 是否隐藏动画 |\n| @ended | (event: [UniEvent](/component/common.md#unievent)) => void | - | | - |","event":"","example":"","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.animation-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/animation-view.html)\n- [插件市场](https://ext.dcloud.net.cn/plugin?id=10674)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=animation-view&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=animation-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=animation-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=animation-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=animation-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=animation-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=animation-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"live-player":{"name":"## live-player","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| src | string([string.UniLivePlayerURIString](/uts/data-type.md#ide-string)) | - | | 音视频地址。目前仅支持 flv, rtmp 格式 |\n| mode | string | - | | live(直播),RTC(实时通话) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| RTC | | |\n@| live | | |\n| autoplay | boolean | - | | 自动播放 |\n| muted | boolean | - | | 是否静音 |\n| orientation | string | - | | 画面方向,可选值有 vertical,horizontal |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| vertical | | |\n@| horizontal | | |\n| object-fit | string | - | | 填充模式,可选值有 contain,fillCrop |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| contain | | |\n@| fillCrop | | |\n| background-mute | boolean | - | | 进入后台时是否静音 |\n| min-cache | string | - | | 最小缓冲区,单位s |\n| max-cache | string | - | | 最大缓冲区,单位s |\n| @statechange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 播放状态变化事件,detail = {code} |\n| @fullscreenchange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 全屏变化事件,detail = {direction, fullScreen} |\n| @netstatus | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 网络状态通知,detail = {info} |\n| sound-mode | string | - | | *(string)*
声音输出方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| speaker | | |\n@| ear | | |\n| auto-pause-if-navigate | boolean | - | | - |\n| auto-pause-if-open-native | boolean | - | | - |\n| picture-in-picture-mode | string/Array | - | | *(string/Array)*
设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: \\[\"push\", \"pop\"] |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| [] | | |\n@| push | | |\n@| pop | | |\n| picture-in-picture-init-position= | string | - | | - |\n| enable-auto-rotation | boolean | - | | - |\n| referrer-policy | string | - | | *(string)*
格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| origin | | |\n@| no-referrer | | |\n| enable-casting | boolean | - | | - |\n| @audiovolumenotify | eventhandler | - | | - |\n| @enterpictureinpicture | eventhandler | - | | - |\n| @leavepictureinpicture | eventhandler | - | | - |\n| @castinguserselect | eventhandler | - | | - |\n| @castingstatechange | eventhandler | - | | - |\n| @castinginterrupt | eventhandler | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.live.live-player)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/live-player.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html)"},"live-pusher":{"name":"## live-pusher","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| url | string | - | | 推流地址。目前仅支持 flv, rtmp 格式 |\n| mode | string | - | | SD(标清), HD(高清), FHD(超清), RTC(实时通话) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| RTC | | |\n@| SD | | |\n@| HD | | |\n@| FHD | | |\n@| QVGA | | |\n@| HVGA | | |\n| autopush | boolean | - | | 自动推流 |\n| muted | boolean | - | | 是否静音 |\n| enable-camera | boolean | - | | 开启摄像头 |\n| auto-focus | boolean | - | | 自动获取焦点 |\n| orientation | string | - | | 画面方向,可选值有 vertical,horizontal |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| vertical | | |\n@| horizontal | | |\n| beauty | number | - | | 美颜 |\n| aspect | number | - | | 美白 |\n| min-bitrate | string | - | | 最小码率 |\n| max-bitrate | string | - | | 最大码率 |\n| waiting-image | string | - | | 进入后台时推流的等待画面 |\n| waiting-image-md5 | string | - | | 等待画面资源的MD5值 |\n| background-mute | boolean | - | | 进入后台时是否静音 |\n| @statechange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 播放状态变化事件,detail = {code} |\n| @error | Any | - | | - |\n| @netstatus | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 网络状态通知,detail = {info} |\n| enableVideoCustomRender | boolean | - | | - |\n| whiteness | number | - | | - |\n| audio-quality | string | - | | - |\n| waiting-image-hash | string | - | | - |\n| zoom | boolean | - | | - |\n| device-position | string | - | | - |\n| mirror | boolean | - | | - |\n| remote-mirror | boolean | - | | - |\n| local-mirror | string | - | | *(string)*
控制本地预览画面是否镜像 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| auto | | |\n@| enable | | |\n@| disable | | |\n| audio-reverb-type | number | - | | *(number)*
音频混响类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| 0 | | |\n@| 1 | | |\n@| 2 | | |\n@| 3 | | |\n@| 4 | | |\n@| 5 | | |\n@| 6 | | |\n@| 7 | | |\n| enable-mic | boolean | - | | - |\n| enable-agc | boolean | - | | - |\n| enable-ans | boolean | - | | - |\n| audio-volume-type | string | - | | *(string)*
音量类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| auto | | |\n@| media | | |\n@| voicecall | | |\n| video-width | number | - | | - |\n| video-height | number | - | | - |\n| beauty-style | string | - | | *(string)*
设置美颜类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| smooth | | |\n@| nature | | |\n| filter | string | - | | *(string)*
设置色彩滤镜 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| standard | | |\n@| pink | | |\n@| nostalgia | | |\n@| blues | | |\n@| romantic | | |\n@| cool | | |\n@| fresher | | |\n@| solor | | |\n@| aestheticism | | |\n@| whitening | | |\n@| cerisered | | |\n| picture-in-picture-mode | string/Array | - | | *(string/Array)*
设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: \\[\"push\", \"pop\"] |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| [] | | |\n@| push | | |\n@| pop | | |\n| voice-changer-type | number | - | | - |\n| custom-effect | boolean | - | | - |\n| skin-whiteness | number | - | | - |\n| skin-smoothness | number | - | | - |\n| face-thinness | number | - | | - |\n| eye-bigness | number | - | | - |\n| fps | number | - | | - |\n| @bgmstart | eventhandle | - | | - |\n| @bgmprogress | eventhandle | - | | - |\n| @bgmcomplete | eventhandle | - | | - |\n| @audiovolumenotify | eventhandle | - | | - |\n| @enterpictureinpicture | eventhandler | - | | - |\n| @leavepictureinpicture | eventhandler | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.live.live-pusher)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/live-pusher.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/live-pusher.html)"},"channel-live":{"name":"## channel-live","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| feed-id | string | - | | - |\n| finder-user-name | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.channel-live)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/channel-live.html)"},"channel-video":{"name":"## channel-video","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| feed-id | string | - | | - |\n| finder-user-name | string | - | | - |\n| feed-token | string | - | | - |\n| autoplay | string | - | | - |\n| loop | boolean | - | | - |\n| muted | boolean | - | | - |\n| object-fit | boolean | - | | *(boolean)*
当视频大小与 video 容器大小不一致时,视频的表现形式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| contain | | |\n@| fill | | |\n@| cover | | |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.channel-video)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/channel-video.html)"},"voip-room":{"name":"## voip-room","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| openid | string | - | | - |\n| mode | string | - | | *(string)*
对话窗口类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| camera | | |\n@| video | | |\n| device-position | string | - | | *(string)*
摄像头方向,仅在 mode 为 camera 时有效 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| front | | |\n@| back | | |\n| object-fit | string | - | | *(string)*
画面与容器比例不一致时,画面的表现形式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| fill | | |\n@| contain | | |\n@| cover | | |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.voip-room)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/voip-room.html)"},"map":{"name":"## map","description":"地图","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 4.31 | 4.31 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| longitude | number | - | | 中心经度 |\n| latitude | number | - | | 中心纬度 |\n| scale | number | - | | 缩放级别,web端取值范围为5-18 , app端取值范围为3-20 |\n| min-scale | number | 3 | | 最小缩放级别 |\n| max-scale | number | 20 | | 最大缩放级别 |\n| layer-style | string | \"1\" | | 个性化地图(如实现地图暗黑模式) |\n| markers | array | - | | 标记点 |\n| covers | array | - | | 即将移除,请使用 markers |\n| polyline | array | - | | 路线 |\n| polygons | array | - | | 多边形 |\n| circles | array | - | | 圆 |\n| controls | array | - | | 控件 |\n| include-points | array | - | | 缩放视野以包含所有给定的坐标点 |\n| show-location | boolean | - | | 显示带有方向的当前定位点 |\n| enable-3D | boolean | false | | 是否显示3D楼块 |\n| show-compass | boolean | false | | 是否显示指南针 |\n| enable-zoom | boolean | true | | 是否支持缩放 |\n| enable-scroll | boolean | true | | 是否支持拖动 |\n| enable-rotate | boolean | false | | 是否支持旋转 |\n| rotate | number | 0 | | 旋转角度(范围0-360)地图正北和设备 y 轴角度的夹角 |\n| skew | number | 0 | | 倾斜角度,范围 0 ~ 40 , 关于 z 轴的倾角 |\n| enable-overlooking | boolean | false | | 是否开启俯视(是否开启手势修改倾斜角度) |\n| enable-satellite | boolean | false | | 是否开启卫星图 |\n| enable-traffic | boolean | false | | 是否开启实时路况 |\n| enable-poi | boolean | false | | 是否展示 POI 点 |\n| enable-building | boolean | false | | 是否展示建筑物 |\n| enable-indoorMap | boolean | false | | 是否展示室内地图 |\n| @markertap | (event: [UniMapMarkerTapEvent](#unimapmarkertapevent)) => void | - | | 点击标记点时触发 |\n| @callouttap | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 点击标记点对应的气泡时触发 |\n| @controltap | (event: [UniMapControlTapEvent](#unimapcontroltapevent)) => void | - | | 点击控件时触发 |\n| @regionchange | (event: [UniMapRegionChangeEvent](#unimapregionchangeevent)) => void | - | | 视野发生变化时触发 |\n| @updated | (event: [UniMapUpdatedEvent](#unimapupdatedevent)) => void | - | | 在地图渲染更新完成时触发 |\n| @tap | (event: [UniMapTapEvent](#unimaptapevent)) => void | - | | 点击地图时触发 |\n| @anchorpointtap | (event: [UniMapAnchorPointTapEvent](#unimapanchorpointtapevent)) => void | - | | 点击定位标时触发 |\n| @poitap | (event: [UniMapPoiTapEvent](#unimappoitapevent)) => void | - | | 点击地图poi点时触发 |\n| subkey | string | - | | - |\n| show-scale | boolean | - | | - |\n| enable-auto-max-overlooking | boolean | - | | - |\n| setting | object | - | | - |\n| @labeltap | eventhandle | - | | - |\n| @polylinetap | eventhandle | - | | - |\n| @abilitysuccess | eventhandle | - | | - |\n| @abilityfail | eventhandle | - | | - |\n| @authsuccess | eventhandle | - | | - |\n| @interpolatepoint | eventhandle | - | | - |\n| @error | eventhandle | - | | - |\n| ~~theme~~ | string | \"normal\" | | 主题(satellite 或 normal) |","event":"\n### 事件\n#### UniMapMarkerTapEvent\n\n```mermaid\ngraph LR\n \nUniMapMarkerTapEvent -- Extends --> UniCustomEvent<UniMapMarkerTapEventDetail>\n style UniCustomEvent<UniMapMarkerTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapMarkerTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapMarkerTapEventDetail\n\n\n###### UniMapMarkerTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| markerId | number | 否 | - | - | |\n\n\n#### UniMapControlTapEvent\n\n```mermaid\ngraph LR\n \nUniMapControlTapEvent -- Extends --> UniCustomEvent<UniMapControlTapEventDetail>\n style UniCustomEvent<UniMapControlTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapControlTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapControlTapEventDetail\n\n\n###### UniMapControlTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| controlId | number | 否 | - | - | |\n\n\n#### UniMapRegionChangeEvent\n\n```mermaid\ngraph LR\n \nUniMapRegionChangeEvent -- Extends --> UniCustomEvent<>\n style UniCustomEvent<> color:#42b983\n click UniCustomEvent<> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapRegionChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| causedBy | string | 否 | - | - | |\n\n\n#### UniMapUpdatedEvent\n\n```mermaid\ngraph LR\n \nUniMapUpdatedEvent -- Extends --> UniCustomEvent<UniMapUpdatedEventDetail>\n style UniCustomEvent<UniMapUpdatedEventDetail> color:#42b983\n click UniCustomEvent<UniMapUpdatedEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n#### UniMapTapEvent\n\n```mermaid\ngraph LR\n \nUniMapTapEvent -- Extends --> UniCustomEvent<UniMapTapEventDetail>\n style UniCustomEvent<UniMapTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapTapEventDetail\n\n\n###### UniMapTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 否 | - | - | |\n| longitude | number | 否 | - | - | |\n\n\n#### UniMapAnchorPointTapEvent\n\n```mermaid\ngraph LR\n \nUniMapAnchorPointTapEvent -- Extends --> UniCustomEvent<UniMapAnchorPointTapEventDetail>\n style UniCustomEvent<UniMapAnchorPointTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapAnchorPointTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapAnchorPointTapEventDetail\n\n\n###### UniMapAnchorPointTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 否 | - | - | |\n| longitude | number | 否 | - | - | |\n\n\n#### UniMapPoiTapEvent\n\n```mermaid\ngraph LR\n \nUniMapPoiTapEvent -- Extends --> UniCustomEvent<UniMapPoiTapEventDetail>\n style UniCustomEvent<UniMapPoiTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapPoiTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapPoiTapEventDetail\n\n\n###### UniMapPoiTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 否 | - | - | |\n| longitude | number | 否 | - | - | |\n| name | string | 否 | - | - | |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/map/map.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/map/map\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/map/map\n\n>Template\n```vue\n\n \n \n \n 注意:需要正确配置地图服务商的Key才能正常显示地图组件\n \n 属性示例\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 方法示例\n \n \n \n \n \n \n \n\n \n \n\n\n\n\n\n\n```\n\n>Script\n```uts\n\n type TypeJestResult = {\n translateMarkerMsg : string,\n animationEnd : boolean,\n centerPoints : LocationObject,\n southwest : LocationObject,\n northeast : LocationObject,\n moveToLocationMsg : string,\n scale : number\n }\n\n const testMarkers :Marker[]= [{\n id: 0,\n latitude: 39.989631,\n longitude: 116.481018,\n title: '方恒国际 阜通东大街6号',\n iconPath: '../../../static/location.png',\n rotate: 0,\n width: 20,\n height: 20,\n anchor: {\n x: 0.5,\n y: 1\n } ,\n callout: {\n content: '方恒国际 阜通东大街6号',\n color: '#00BFFF',\n fontSize: 10,\n borderRadius: 4,\n borderWidth: 1,\n borderColor: '#333300',\n bgColor: '#CCFF99',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 1,\n latitude: 39.9086920000,\n longitude: 116.3974770000,\n title: '天安门',\n // zIndex: '1',\n iconPath: '../../../static/location.png',\n width: 40,\n height: 40,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '首都北京\\n天安门',\n color: '#00BFFF',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#CCFF11',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 2,\n latitude: 39.894793,\n longitude: 116.321592,\n title: '北京西站',\n iconPath: '../../../static/location.png',\n width: 40,\n height: 40,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '北京西站',\n color: '#ffffff',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#ff5500',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 3,\n latitude: 39.902344,\n longitude: 116.484822,\n title: '北京东站',\n iconPath: '../../../static/location.png',\n width: 20,\n height: 20,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '北京东站',\n color: '#ffffff',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#ff5500',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 4,\n latitude: 39.865011,\n longitude: 116.379007,\n title: '北京南站',\n iconPath: '../../../static/location.png',\n width: 40,\n height: 40,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '北京南站',\n color: '#ffffff',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#00aa00',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n ];\n\n\n const testPolyline: Polyline[] = [{\n points: [{\n latitude: 39.925539,\n longitude: 116.279037\n },\n {\n latitude: 39.925539,\n longitude: 116.520285\n }],\n color: '#FFCCFF',\n width: 7,\n dottedLine: true,\n arrowLine: true,\n borderColor: '#000000',\n borderWidth: 2\n },\n {\n points: [{\n latitude: 39.938698,\n longitude: 116.275177\n },\n {\n latitude: 39.966069,\n longitude: 116.289253\n },\n {\n latitude: 39.944226,\n longitude: 116.306076\n },\n {\n latitude: 39.966069,\n longitude: 116.322899\n },\n {\n latitude: 39.938698,\n longitude: 116.336975\n }],\n color: '#CCFFFF',\n width: 5,\n dottedLine: false,\n arrowLine: true,\n borderColor: '#CC0000',\n borderWidth: 3\n }\n ];\n\n const testPolygons : Polygon[] = [{\n points: [{\n latitude: 39.781892,\n longitude: 116.293413\n },\n {\n latitude: 39.787600,\n longitude: 116.391842\n },\n {\n latitude: 39.733187,\n longitude: 116.417932\n },\n {\n latitude: 39.704653,\n longitude: 116.338255\n }],\n fillColor: '#FFCCFF',\n strokeWidth: 3,\n strokeColor: '#CC99CC',\n zIndex: 11\n },\n {\n points: [{\n latitude: 39.887600,\n longitude: 116.518932\n },\n {\n latitude: 39.781892,\n longitude: 116.518932\n },\n {\n latitude: 39.781892,\n longitude: 116.428932\n },\n {\n latitude: 39.887600,\n longitude: 116.428932\n }\n ],\n fillColor: '#CCFFFF',\n strokeWidth: 5,\n strokeColor: '#CC0000',\n zIndex: 3\n }\n ];\n\n const testCircles: Circle[] = [{\n latitude: 39.996441,\n longitude: 116.411146,\n radius: 15000,\n strokeWidth: 5,\n color: '#CCFFFF',\n fillColor: '#CC0000'\n },\n {\n latitude: 40.096441,\n longitude: 116.511146,\n radius: 12000,\n strokeWidth: 3,\n color: '#CCFFFF',\n fillColor: '#FFCCFF'\n },\n {\n latitude: 39.896441,\n longitude: 116.311146,\n radius: 9000,\n strokeWidth: 1,\n color: '#CCFFFF',\n fillColor: '#CC0000'\n }\n ];\n\n const testIncludePoints :LocationObject[] = [{\n latitude: 39.989631,\n longitude: 116.481018,\n },\n {\n latitude: 39.9086920000,\n longitude: 116.3974770000,\n }\n ];\n\n\n const mapContext = ref(null as MapContext | null);\n const location = ref({ longitude: 116.39742, latitude: 39.909 } as LocationObject);\n const rotate = ref(0);\n const skew = ref(0);\n // 自动化测试\n const autoTest = ref(false);\n const updateAutoTest = (value : boolean) => {\n autoTest.value = value\n }\n\n\n const jestResult = reactive({\n translateMarkerMsg: \"\",\n animationEnd: false,\n centerPoints: {\n latitude: 0,\n longitude: 0\n },\n southwest: {\n latitude: 0,\n longitude: 0\n },\n northeast: {\n latitude: 0,\n longitude: 0\n },\n moveToLocationMsg: \"\",\n scale: 0,\n } as TypeJestResult);\n\n\n onReady(() => {\n mapContext.value = uni.createMapContext(\"map1\", getCurrentInstance()!.proxy!)\n });\n\n const scale = ref(13);\n const confirm_scale_input = (value : number) => {\n scale.value = value\n };\n\n const controls = ref([] as Control[]);\n const addControls = () => {\n controls.value = [{\n id: 1,\n position: {\n left: 5,\n top: 180,\n width: 30,\n height: 30\n } as ControlPosition,\n iconPath: '../../../static/uni.png',\n clickable: true\n } as Control]\n }\n\n const showLocation = ref(false);\n const enable3D = ref(false);\n const showCompass = ref(false);\n const enableOverlooking = ref(false);\n const enableRotate = ref(false);\n const enableZoom = ref(true);\n const enableScroll = ref(true);\n const enableSatellite = ref(false);\n const enableTraffic = ref(false);\n const change_show_location = (checked : boolean) => {\n showLocation.value = checked\n }\n\n const change_enable_3d = (checked : boolean) => {\n enable3D.value = checked\n }\n\n const change_show_campass = (checked : boolean) => {\n showCompass.value = checked\n }\n\n const change_enable_overlooking = (checked : boolean) => {\n enableOverlooking.value = checked\n }\n\n const change_enable_rotate = (checked : boolean) => {\n enableRotate.value = checked\n }\n\n const change_enable_zoom = (checked : boolean) => {\n enableZoom.value = checked\n }\n\n const change_enable_scroll = (checked : boolean) => {\n enableScroll.value = checked\n }\n\n const change_enable_satellite = (checked : boolean) => {\n enableSatellite.value = checked\n }\n\n const change_enable_traffic = (checked : boolean) => {\n enableTraffic.value = checked\n }\n\n const includePoints = ref([] as LocationObject[]);\n const includePoint = () => {\n includePoints.value = testIncludePoints;\n };\n\n\n let markers = ref([] as Marker[]);\n const addMarkers = () => {\n scale.value = 11\n const temp = JSON.parse(JSON.stringify(testMarkers))!\n markers.value = temp\n };\n\n const removeMarker = () => {\n // #ifdef APP\n mapContext.value?.removeMarkers({markerIds:[4]})\n // #endif\n // #ifdef WEB\n const index = markers.value.findIndex((marker: Marker):boolean=>{\n return marker.id == 4\n });\n if (index != -1) {\n delete markers.value[index].label;\n markers.value.splice(index, 1);\n } else {\n uni.showToast({\n title: '未找到该标记点',\n icon: 'none'\n });\n }\n // #endif\n };\n\n // #ifdef WEB\n const addMarkersLabel = () => {\n markers.value.forEach((marker, index) => {\n marker.label = {\n content: 'Hello Label' + (index + 1),\n color: '#aa00ff',\n fontSize: 12,\n x: 5,\n y: 0,\n borderColor: '#333300',\n borderWidth: 2,\n borderRadius: 20,\n bgColor: '#aaffff',\n padding: 10\n };\n });\n };\n // #endif\n\n\n const polyline = ref([] as Polyline[]);\n const addPolyline = () => {\n scale.value = 11;\n polyline.value = JSON.parse(JSON.stringify(testPolyline))!;\n };\n const removePolyline = () => {\n if (polyline.value.length > 1) {\n polyline.value = JSON.parse(JSON.stringify(testPolyline))!.splice(0, 1);\n }\n };\n\n\n const polygons = ref([] as Polygon[]);\n const addPolygons = () => {\n scale.value = 10;\n polygons.value = JSON.parse(JSON.stringify(testPolygons))!;\n };\n const removePolygon = () => {\n if (polygons.value.length > 1) {\n polygons.value = JSON.parse(JSON.stringify(testPolygons))!.splice(0, 1);\n }\n };\n\n\n const circles = ref([] as Circle[]);\n const addCircles = () => {\n scale.value = 10;\n circles.value = JSON.parse(JSON.stringify(testCircles))!;\n };\n const removeCircle = () => {\n if (circles.value.length > 1) {\n circles.value = JSON.parse(JSON.stringify(testCircles))!.slice(1);\n }\n };\n\n const handleGetCenterLocation = () => {\n mapContext.value?.getCenterLocation({\n success: ret => {\n // console.log('getCenterLocation',ret);\n jestResult.centerPoints = ret;\n if (!autoTest.value) {\n uni.showModal({\n content: JSON.stringify(ret)\n });\n }\n }\n });\n };\n\n const handleGetRegion = () => {\n mapContext.value?.getRegion({\n success: ret => {\n // console.log('getRegion',JSON.stringify(ret));\n jestResult.southwest = ret.southwest;\n jestResult.northeast = ret.northeast\n if (!autoTest.value) {\n uni.showModal({\n content: JSON.stringify(ret)\n });\n }\n }\n });\n };\n\n\n const handleTranslateMarker = () => {\n mapContext.value?.translateMarker({\n markerId: 1,\n destination: {\n latitude: 39.989631,\n longitude: 116.481018\n },\n autoRotate: true,\n rotate: 10,\n duration: 2000,\n moveWithRotate: true,\n // #ifdef WEB\n animationEnd: () => {\n console.log('动画结束');\n jestResult.animationEnd = true;\n },\n // #endif\n success: ret => {\n console.log('handleTranslateMarker',JSON.stringify(ret));\n const result = ret as UTSJSONObject\n jestResult.translateMarkerMsg = result[\"errMsg\"] as string;\n },\n fail: error => {\n console.log(error)\n }\n });\n mapContext.value?.translateMarker({\n markerId: 2,\n destination: {\n latitude: 39.902344,\n longitude: 116.484822,\n },\n autoRotate: true,\n rotate: 0,\n duration: 2000,\n success: ret => {\n console.log('handleTranslateMarker', JSON.stringify(ret));\n },\n fail: error => {\n console.log(error)\n }\n });\n };\n\n\n const handleGetScale = () => {\n mapContext.value?.getScale({\n success: res => {\n // console.log('getScale',res);\n scale.value = res.scale\n jestResult.scale = res.scale\n if (!autoTest.value) {\n uni.showModal({\n content: '当前地图的缩放级别为:' + res.scale\n });\n }\n },\n fail: error => {\n console.log(error)\n },\n });\n };\n\n const handleMoveToLocation = () => {\n mapContext.value?.moveToLocation({\n latitude: 39.909,\n longitude: 116.39742,\n success: res => {\n console.log('moveToLocation',res);\n const result = res as UTSJSONObject\n jestResult.moveToLocationMsg = result[\"errMsg\"] as string;\n\n if (!autoTest.value) {\n uni.showModal({\n content: JSON.stringify(res)\n });\n }\n },\n fail: error => {\n console.log(error)\n }\n });\n };\n\n const handleMoveToMyLocation = () => {\n mapContext.value?.moveToLocation({\n success: res => {\n uni.showModal({\n content: '地图中心已经移动到当前位置'\n })\n },\n fail: error => {\n console.log(error);\n }\n })\n }\n\n const maptap = (e : UniMapTapEvent) => {\n // console.log('点击地图时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n const onmarkertap = (e : UniMapMarkerTapEvent) => {\n // console.log('点击标记点时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n const oncontroltap = (e : UniMapControlTapEvent) => {\n // console.log('点击控件时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n const oncallouttap = (e : UniEvent) => {\n // console.log('点击标记点对应的气泡时触发',e)\n uni.showModal({\n content: JSON.stringify(e)\n });\n };\n\n const onupdated = (e : UniMapUpdatedEvent) => {\n console.log('在地图渲染更新完成时触发', e)\n };\n\n const onregionchange = (e : UniMapRegionChangeEvent) => {\n console.log('视野发生变化时触发', e.detail)\n };\n\n const onpoitap = (e : UniMapPoiTapEvent) => {\n // console.log('点击地图poi点时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n defineExpose({\n jestResult,\n autoTest,\n updateAutoTest,\n addControls,\n addMarkers,\n // #ifdef WEB\n addMarkersLabel,\n // #endif\n removeMarker,\n addPolyline,\n removePolyline,\n addPolygons,\n removePolygon,\n addCircles,\n removeCircle,\n includePoint,\n handleGetCenterLocation,\n handleGetRegion,\n handleTranslateMarker,\n handleMoveToLocation,\n handleGetScale\n })\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.map.map)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/map.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/map.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=map&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=map&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=map&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=map&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=map)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=map&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"canvas":{"name":"## canvas","description":"> 组件类型:[UniCanvasElement](/dom/unicanvaselement.md) \n\n 画布","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.21 | 4.41 | 4.25 | 4.25 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | - |\n| canvas-id | string | - | | - |\n| disable-scroll | boolean | - | | - |\n| @touchstart | eventhandle | - | | - |\n| @touchmove | eventhandle | - | | - |\n| @touchend | eventhandle | - | | - |\n| @touchcancel | eventhandle | - | | - |\n| @longtap | eventhandle | - | | - |\n| @error | eventhandle | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/canvas/canvas.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/canvas/canvas\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/canvas/canvas\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n testToBlobResult: {{testToBlobResult}}\r\n \r\n \r\n \r\n 0\">\r\n canvasToDataURL:\r\n {{dataBase64.slice(0,22)}}...\r\n \r\n \r\n \r\n \r\n \r\n CanvasContext API 演示\r\n \r\n \r\n \r\n\r\n \r\n 获取 CanvasContext 结果:\r\n {{testCanvasContext}}\r\n \r\n \r\n 测试 ToDataURL 结果:\r\n {{testToDataURLResult}}\r\n \r\n\r\n \r\n 测试 createImage 结果:\r\n {{testCreateImage}}\r\n \r\n\r\n \r\n 测试 createPath2D 结果:\r\n {{testCreatePath2D}}\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n function hidpi(canvas : UniCanvasElement) {\r\n const context = canvas.getContext(\"2d\")!;\r\n const dpr = uni.getDeviceInfo().devicePixelRatio ?? 1;\r\n canvas.width = canvas.offsetWidth * dpr;\r\n canvas.height = canvas.offsetHeight * dpr;\r\n context.scale(dpr, dpr);\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'Context2D',\r\n canvas: null as UniCanvasElement | null,\r\n canvasContext: null as CanvasContext | null,\r\n renderingContext: null as CanvasRenderingContext2D | null,\r\n canvasWidth: 0,\r\n canvasHeight: 0,\r\n dataBase64: '',\r\n taskId: 0,\r\n lastTime: 0,\r\n frameCount: 0,\r\n // 仅测试\r\n testCanvasContext: false,\r\n testToBlobResult: false,\r\n testToDataURLResult: false,\r\n testCreateCanvasContextAsyncSuccess: false,\r\n testCreateImage: false,\r\n testCreatePath2D: false,\r\n testFrameCount: 0\r\n }\r\n },\r\n onReady() {\r\n // HBuilderX 4.25+\r\n // 异步调用方式, 跨平台写法\r\n uni.createCanvasContextAsync({\r\n id: 'canvas',\r\n component: this,\r\n success: (context : CanvasContext) => {\r\n this.canvasContext = context;\r\n this.renderingContext = context.getContext('2d')!;\r\n this.canvas = this.renderingContext!.canvas;\r\n\r\n hidpi(this.canvas!);\r\n this.canvasWidth = this.canvas!.width;\r\n this.canvasHeight = this.canvas!.height;\r\n\r\n // #ifdef WEB\r\n context.toBlob((blob : Blob) => {\r\n this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg')\r\n }, 'image/jpeg', 0.95)\r\n // #endif\r\n this.testToDataURLResult = context.toDataURL().startsWith('data:image/png;base64')\r\n this.testCanvasContext = true\r\n }\r\n })\r\n\r\n // 同步调用方式,仅支持 app/web\r\n // let canvas = uni.getElementById(\"canvas\") as UniCanvasElement\r\n // this.renderingContext = canvas.getContext(\"2d\")\r\n // hidpi(canvas);\r\n // this.canvas = canvas;\r\n // this.canvasWidth = canvas.width;\r\n // this.canvasHeight = canvas.height;\r\n },\r\n onUnload() {\r\n if (this.taskId > 0) {\r\n this.stopAnimationFrame()\r\n }\r\n },\r\n methods: {\r\n // #ifdef WEB\r\n canvasToBlob() {\r\n this.canvasContext!.toBlob((blob : Blob) => {\r\n this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg')\r\n }, 'image/jpeg', 0.95)\r\n },\r\n // #endif\r\n canvasToDataURL() {\r\n this.dataBase64 = this.canvasContext!.toDataURL()\r\n },\r\n onCreateImage() {\r\n this.renderingContext!.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\r\n let image = this.canvasContext!.createImage();\r\n image.src = \"../../static/logo.png\"\r\n image.onload = () => {\r\n this.testCreateImage = true\r\n this.renderingContext?.drawImage(image, 0, 0, 100, 100);\r\n }\r\n },\r\n onCreatePath2D() {\r\n this.renderingContext!.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\r\n const context = this.renderingContext!\r\n let path2D = this.canvasContext!.createPath2D()\r\n this.testCreatePath2D = true\r\n const amplitude = 64;\r\n const wavelength = 64;\r\n for (let i = 0; i < 5; i++) {\r\n const x1 = 0 + (i * wavelength);\r\n const y1 = 128;\r\n const x2 = x1 + wavelength / 4;\r\n const y2 = y1 - amplitude;\r\n const x3 = x1 + 3 * wavelength / 4;\r\n const y3 = y1 + amplitude;\r\n const x4 = x1 + wavelength;\r\n const y4 = y1;\r\n context.moveTo(x1, y1);\r\n path2D.bezierCurveTo(x2, y2, x3, y3, x4, y4);\r\n }\r\n context.stroke(path2D);\r\n },\r\n startAnimationFrame() {\r\n this.taskId = this.canvasContext!.requestAnimationFrame((timestamp : number) => {\r\n this.testFrameCount++\r\n this.updateFPS(timestamp)\r\n this.startAnimationFrame()\r\n })\r\n },\r\n stopAnimationFrame() {\r\n this.canvasContext!.cancelAnimationFrame(this.taskId)\r\n this.taskId = 0\r\n },\r\n updateFPS(timestamp : number) {\r\n this.frameCount++\r\n if (timestamp - this.lastTime >= 1000) {\r\n const timeOfFrame = (1000 / this.frameCount)\r\n this.renderingContext!.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\r\n this.renderingContext!.fillText(`${this.frameCount} / ${timeOfFrame.toFixed(3)}ms`, 10, 18)\r\n this.frameCount = 0\r\n this.lastTime = timestamp\r\n }\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.canvas.canvas)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/canvas.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=canvas&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=canvas&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=canvas&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=canvas&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=canvas)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=canvas&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"ad":{"name":"## ad","description":"广告","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | 4.41 | 4.31 | 4.31 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| adpid | string | - | | 广告位id,在uniAD官网申请广告位 |\n| @load | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 广告加载成功的回调 |\n| @close | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 广告关闭的回调 |\n| @error | (e:[UniAdErrorEvent](#uniaderrorevent)) => void | - | | 广告加载失败的回调 |\n| unit-id | string | - | | - |\n| ad-intervals | number | - | | - |\n| ad-type | string | - | | - |\n| ad-theme | string | - | | - |","event":"\n### 事件\n#### UniAdErrorEvent\n\n\n##### UniAdErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **IUniAdError** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| errCode | number | 是 | - | - | 错误码
- -5001 广告位标识adpid为空,请传入有效的adpid
- -5002 无效的广告位标识adpid,请使用正确的adpid
- -5003 广告位未开通广告,请在广告平台申请并确保已审核通过
- -5004 无广告模块,打包时请配置要使用的广告模块
- -5005 广告加载失败,请稍后重试
- -5006 广告已经展示过了,请重新加载
- -5007 广告不可用或已过期,请重新请求
- -5008 广告不可用或已过期,请重新请求
- -5009 广告类型不符,请检查后再试
- -5011 打包或开通的渠道,不支持此类型广告
- -5013 广告播放失败,请重新加载 |\n@| errSubject | string | 是 | - | - | 统一错误主题(模块)名称 |\n@| data | any | 否 | - | - | 错误信息中包含的数据 |\n@| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) | 否 | - | - | 源错误信息,可以包含多个错误,详见SourceError |\n@| errMsg | string | 是 | - | - | - |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniAdErrorEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/ad/ad.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/ad/ad\n```uvue\n\r\n \r\n \r\n \r\n 信息流广告加载失败,请退出当前页面重试。\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.ad.ad)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/ad.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/ad.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=ad&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=ad&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=ad&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=ad&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=ad)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=ad&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"web-view":{"name":"## web-view","description":"> 组件类型:[UniWebViewElement](/dom/uniwebviewelement.md) \n\n 承载网页的容器","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| src | string([string.HTMLURIString](/uts/data-type.md#ide-string)) | - | | webview 指向网页的链接 |\n| allow | string | - | | 用于为 [iframe](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/iframe) 指定其[特征策略](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/策略特征) |\n| sandbox | string | - | | 该属性对呈现在 [iframe](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/iframe) 框架中的内容启用一些额外的限制条件。 |\n| fullscreen | boolean | - | | 是否铺满整个页面,默认值:`true`。 |\n| webview-styles | **WebViewStyles** | {\"progress\":{\"color\":\"#00FF00\"}} | | webview 网络地址页面加载进度条样式 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| progress | [WebViewProgressStyles](#webviewprogressstyles-values) \\\\| boolean | 是 | false | - | 网络地址页面加载进度条样式,设置为 false 时表示不显示加载进度条。 |\n@\n| horizontalScrollBarAccess | boolean | true | | 设置是否显示横向滚动条 |\n| verticalScrollBarAccess | boolean | true | | 设置是否显示纵向滚动条 |\n| @message | (event: [UniWebViewMessageEvent](#uniwebviewmessageevent)) => void | - | | 网页向应用 postMessage 时触发。e.detail = { data } |\n| @error | (event: [UniWebViewErrorEvent](#uniwebviewerrorevent)) => void | - | | 网页加载错误时触发。e.detail = { errSubject, errCode, errMsg, url, fullUrl, src } |\n| @load | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | | 网页加载完成后触发。e.detail = { url, src } |\n| @loading | (event: [UniWebViewLoadingEvent](#uniwebviewloadingevent)) => void | - | | 网页加载中触发。e.detail = { url, src } |\n| @download | (event: [UniWebViewDownloadEvent](#uniwebviewdownloadevent)) => void | - | | 点击网页中可下载链接时触发。e.detail = { url, userAgent, contentDisposition, mimetype, contentLength } |\n| ~~@loaded~~ | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | | 网页加载完成后触发。e.detail = { url, src }。已废弃,请改用load |","event":"\n### 事件\n#### UniWebViewMessageEvent\n\n```mermaid\ngraph LR\n \nUniWebViewMessageEvent -- Extends --> UniCustomEvent<UniWebViewMessageEventDetail>\n style UniCustomEvent<UniWebViewMessageEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewMessageEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewMessageEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值message |\n\n\n##### UniWebViewMessageEventDetail\n\n\n###### UniWebViewMessageEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| data | UTSJSONObject[\\] | 是 | - | - | 消息包含的数据,4.13版本之前类型为Map\\ \\| null,4.13版本(含)之后类型为Array\\ |\n\n\n#### UniWebViewErrorEvent\n\n```mermaid\ngraph LR\n \nUniWebViewErrorEvent -- Extends --> UniCustomEvent<UniWebViewErrorEventDetail>\n style UniCustomEvent<UniWebViewErrorEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewErrorEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值error |\n\n\n##### UniWebViewErrorEventDetail\n\n\n###### UniWebViewErrorEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| errSubject | string | 是 | - | - | 统一错误主题(模块)名称,固定值uni-web-view |\n| errCode | number | 是 | - | - | 统一错误码
100001 ssl error
100002 page error
100003 http error |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| 100001 | - | - |\n@| 100002 | - | - |\n@| 100003 | - | - |\n| errMsg | string | 是 | - | - | 统一错误描述信息 |\n| url | string | 是 | - | - | 加载错误的网页链接,非完整链接,仅包含scheme://authority部分,4.13版本起支持 |\n| fullUrl | string | 是 | - | - | 加载错误的网页链接,完整链接,4.13版本起支持 |\n| src | string | 是 | - | - | 加载错误的网页链接,完整链接,4.13版本起支持 |\n\n\n#### UniWebViewLoadEvent\n\n```mermaid\ngraph LR\n \nUniWebViewLoadEvent -- Extends --> UniCustomEvent<UniWebViewLoadEventDetail>\n style UniCustomEvent<UniWebViewLoadEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewLoadEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值load |\n\n\n##### UniWebViewLoadEventDetail\n\n\n###### UniWebViewLoadEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| ~~url~~ | string | 是 | - | - | 加载完成的网页链接 |\n| src | string | 是 | - | - | 加载完成的网页链接,4.13版本起支持 |\n\n\n#### UniWebViewLoadingEvent\n\n```mermaid\ngraph LR\n \nUniWebViewLoadingEvent -- Extends --> UniCustomEvent<UniWebViewLoadingEventDetail>\n style UniCustomEvent<UniWebViewLoadingEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewLoadingEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewLoadingEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值loading |\n\n\n##### UniWebViewLoadingEventDetail\n\n\n###### UniWebViewLoadingEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| ~~url~~ | string | 是 | - | - | 加载中的网页链接 |\n| src | string | 是 | - | - | 加载中的网页链接,4.13版本起支持 |\n\n\n#### UniWebViewDownloadEvent\n\n```mermaid\ngraph LR\n \nUniWebViewDownloadEvent -- Extends --> UniCustomEvent<UniWebViewDownloadEventDetail>\n style UniCustomEvent<UniWebViewDownloadEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewDownloadEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewDownloadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值download |\n\n\n##### UniWebViewDownloadEventDetail\n\n\n###### UniWebViewDownloadEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| url | string | 是 | - | - | 下载链接 |\n| userAgent | string | 是 | - | - | 用户代理 |\n| contentDisposition | string | 是 | - | - | 指示回复的内容该以何种形式展示,是以内联的形式(即网页或者页面的一部分),还是以附件的形式下载并保存到本地 |\n| mimetype | string | 是 | - | - | 媒体类型 |\n| contentLength | number | 是 | - | - | 文件大小 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/web-view/web-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/web-view/web-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/web-view/web-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 显示横向滚动条\r\n \r\n \r\n \r\n 显示竖向滚动条\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 前进、后退功能在Windows端需要打自定义基座,MAC端需要配置Xcode环境后进行真机运行或者打自定义基座\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n // #ifdef APP\r\n import { canWebViewGoBack, canWebViewGoForward, hasNativeView } from '@/uni_modules/uts-get-native-view';\r\n // #endif\r\n export default {\r\n data() {\r\n return {\r\n src: 'https://www.dcloud.io',\r\n webview_styles: {\r\n progress: {\r\n color: '#FF3333'\r\n }\r\n },\r\n webviewContext: null as WebviewContext | null,\r\n webviewElement: null as UniWebViewElement | null,\r\n loadError: false,\r\n horizontalScrollBarAccess: true,\r\n verticalScrollBarAccess: true,\r\n canGoBack: false,\r\n canGoForward: false,\r\n // 自动化测试\r\n autoTest: false,\r\n eventLoading: null as UTSJSONObject | null,\r\n eventLoad: null as UTSJSONObject | null,\r\n eventError: null as UTSJSONObject | null,\r\n pointerEvents: 'auto',\r\n isTouchEnable: false\r\n }\r\n },\r\n onReady() {\r\n // #ifdef APP\r\n // TODO web 实现createWebviewContext\r\n this.webviewContext = uni.createWebviewContext('web-view', this)\r\n this.webviewElement = uni.getElementById('web-view') as UniWebViewElement //推荐使用element,功能更丰富\r\n // console.log('url: ',this.webviewElement?.getAttribute(\"src\"));\r\n // this.webviewElement?.setAttribute(\"src\",\"https://ext.dcloud.net.cn/\")\r\n // #endif\r\n },\r\n methods: {\r\n getPackageName() : string {\r\n let packageName : string = \"\"\r\n\r\n // #ifdef APP-IOS\r\n const res = uni.getAppBaseInfo();\r\n packageName = res.bundleId\r\n // #endif\r\n\r\n return packageName\r\n },\r\n isProd() : boolean {\r\n if (this.getPackageName() == 'io.dcloud.hellouniappx') {\r\n return true\r\n }\r\n return false\r\n },\r\n back() {\r\n this.webviewContext?.back();\r\n },\r\n forward() {\r\n this.webviewContext?.forward();\r\n },\r\n reload() {\r\n this.webviewContext?.reload();\r\n // this.webviewElement?.reload();\r\n },\r\n stop() {\r\n this.webviewContext?.stop();\r\n },\r\n nativeToWeb() {\r\n this.webviewContext?.evalJS(\"alert('hello uni-app x')\");\r\n },\r\n message(event : UniWebViewMessageEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n },\r\n error(event : UniWebViewErrorEvent) {\r\n this.loadError = true\r\n console.log(JSON.stringify(event.detail));\r\n if (this.autoTest) {\r\n this.eventError = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"errCode\": event.detail.errCode,\r\n \"errMsg\": event.detail.errMsg,\r\n \"url\": event.detail.url,\r\n \"fullUrl\": event.detail.fullUrl,\r\n \"src\": event.detail.src\r\n };\r\n }\r\n },\r\n loading(event : UniWebViewLoadingEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n if (this.autoTest) {\r\n this.eventLoading = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"src\": event.detail.src\r\n };\r\n }\r\n },\r\n load(event : UniWebViewLoadEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n // #ifdef APP\r\n this.canGoBack = canWebViewGoBack('web-view');\r\n this.canGoForward = canWebViewGoForward('web-view');\r\n // #endif\r\n if (this.autoTest) {\r\n this.eventLoad = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"src\": event.detail.src\r\n };\r\n }\r\n },\r\n download(event : UniWebViewDownloadEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n uni.showModal({\r\n content: \"下载链接: \" + event.detail.url + \"\\n文件大小: \" + event.detail.contentLength / 1024 + \"KB\",\r\n showCancel: false\r\n });\r\n },\r\n confirm(event : UniInputConfirmEvent) {\r\n let url = event.detail.value;\r\n if (!url.startsWith('https://') && !url.startsWith('http://')) {\r\n url = 'https://' + url;\r\n }\r\n this.src = url;\r\n },\r\n changeHorizontalScrollBarAccess(event : UniSwitchChangeEvent) {\r\n this.horizontalScrollBarAccess = event.detail.value;\r\n },\r\n changeVerticalScrollBarAccess(event : UniSwitchChangeEvent) {\r\n this.verticalScrollBarAccess = event.detail.value;\r\n },\r\n // 自动化测试\r\n touchstart(event : UniTouchEvent) {\r\n if (this.autoTest) {\r\n this.isTouchEnable = event.touches[0].clientX > 0 && event.touches[0].clientY > 0;\r\n }\r\n },\r\n tap(event : UniPointerEvent) {\r\n if (this.autoTest) {\r\n this.isTouchEnable = event.clientX > 0 && event.clientY > 0;\r\n }\r\n },\r\n getWindowInfo() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n //自动化测试专用\r\n checkNativeWebView() : boolean {\r\n // #ifdef APP\r\n return hasNativeView('web-view')\r\n // #endif\r\n // #ifdef WEB\r\n return true\r\n // #endif\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.web-view.web-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/web-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=web-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=web-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=web-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=web-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=web-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=web-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"page-meta":{"name":"## page-meta","description":"页面元数据,用于设置页面的一些属性,如背景色、下拉刷新等","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| background-text-style | string | - | | 下拉背景字体、loading 图的样式,仅支持 dark 和 light |\n| background-color | string | - | | 窗口的背景色,必须为十六进制颜色值 |\n| background-color-top | string | - | | 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 |\n| background-color-bottom | string | - | | 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 |\n| scroll-top | string | - | | 滚动位置,可以使用 px 或者 rpx 为单位,在被设置时,页面会滚动到对应位置 |\n| scroll-duration | number | - | | 滚动动画时长 |\n| page-style | string | - | | 页面根节点样式,页面根节点是所有页面节点的祖先节点,相当于 HTML 中的 body 节点 |\n| root-font-size | string | - | | 页面的根字体大小,页面中的所有 rem 单位,将使用这个字体大小作为参考值,即 1rem 等于这个字体大小 |\n| enable-pull-down-refresh | boolean | - | | 是否开启下拉刷新 |\n| @resize | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 页面尺寸变化时会触发 resize 事件, event.detail = { size: { windowWidth, windowHeight } } |\n| @scroll | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 页面滚动时会触发 scroll 事件, event.detail = { scrollTop } |\n| @scrolldone | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 如果通过改变 scroll-top 属性来使页面滚动,页面滚动结束后会触发 scrolldone 事件 |\n| root-background-color | string | - | | - |\n| page-font-size | string | - | | - |\n| page-orientation | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.page-meta.page-meta)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/page-meta.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/page-meta.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=page-meta&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=page-meta&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=page-meta&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=page-meta&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=page-meta)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=page-meta&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"navigation-bar":{"name":"## navigation-bar","description":"页面导航条配置节点","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | 4.41 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| title | string | - | | 导航条标题 |\n| title-icon | string | - | | 标题icon |\n| titleIcon-radius | string | - | | 标题icon圆角 |\n| subtitle-text | string | - | | - |\n| subtitle-size | string | - | | - |\n| subtitle-color | string | - | | - |\n| subtitle-overflow | string | - | | - |\n| title-align | string | - | | - |\n| background-image | string | - | | - |\n| background-repeat | string | - | | - |\n| blur-effect | string | - | | - |\n| loading | string | - | | 是否在导航条显示 loading 加载提示 |\n| front-color | string | - | | 导航条前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 |\n| background-color | string | - | | 导航条背景颜色值,有效值为十六进制颜色 |\n| color-animation-duration | number | - | | 改变导航栏颜色时的动画时长,默认为 0 (即没有动画效果) |\n| color-animation-timing-func | string | - | | 改变导航栏颜色时的动画方式,支持 linear 、 easeIn 、 easeOut 和 easeInOut |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.page-meta.navigation-bar)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/navigation-bar.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigation-bar.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=navigation-bar&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=navigation-bar&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=navigation-bar&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=navigation-bar&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=navigation-bar)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=navigation-bar&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"custom-tab-bar":{"name":"## custom-tab-bar","description":"自定义tabBar","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.24 | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| direction | string | - | | 选项的排列方向 |\n| show-icon | boolean | - | | 是否显示icon |\n| selected | number | - | | 选中的tabBar选项索引值 |\n| @onTabItemTap | (event: [OnTabItemTapOption](#ontabitemtapoption)) => void | - | | 点击自定义 tabBar 触发事件,detail = {index, pagePath, text} |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.page-meta.custom-tab-bar)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/custom-tab-bar.html)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=custom-tab-bar&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=custom-tab-bar&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=custom-tab-bar&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=custom-tab-bar&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=custom-tab-bar&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=custom-tab-bar)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=custom-tab-bar&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"unicloud-db":{"name":"## unicloud-db","description":"> 组件类型:[UniCloudDBElement](#uniclouddbelement) \n\n 是一个数据库查询组件,它将clientDB的API封装为组件,进一步减少开发者使用所需的代码量。","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| 4.0 | 4.41 | 3.93 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| v-slot:default | string | - | | {data, loading, hasMore, pagination, error} |\n| collection | string([string.DBCollectionString](/uts/data-type.md#ide-string)) | - | | 表名 |\n| field | string([string.DBFieldString](/uts/data-type.md#ide-string)) | - | | 查询字段,多个字段用 `,` 分割 |\n| where | string([string.JQLString](/uts/data-type.md#ide-string)) | - | | 查询条件 |\n| orderby | string | - | | 排序字段及正序倒叙设置 |\n| groupby | string | - | | 对数据进行分组 |\n| group-field | string | - | | 对数据进行分组统计 |\n| distinct | boolean | - | | 是否对数据查询结果中重复的记录进行去重 |\n| page-data | string | - | | add 多次查询的集合, replace 当前查询的集合 |\n| page-current | number | - | | 当前页 |\n| page-size | number | - | | 每页数据数量 |\n| getone | boolean | - | | 指定查询结果是否返回数组第一条数据,默认 false。在false情况下返回的是数组,即便只有一条结果,也需要\\[0]方式获取。在true下,直接返回结果数据,少一层数组 |\n| getcount | boolean | - | | 是否查询总数量 |\n| gettree | boolean | - | | 是否查询树状结构数据 |\n| startwith | string | - | | gettree的第一层级条件,此初始条件可以省略,不传startWith时默认从最顶级开始查询 |\n| limitlevel | number | - | | gettree查询返回的树的最大层级。超过设定层级的节点不会返回。默认10级,最大15,最小1 |\n| manual | boolean | - | | 是否手动加载数据,默认为 false,页面onLoad时自动联网加载数据 |\n| loadtime | string | - | | 加载数据时机,默认auto,可选值 auto\\|onready\\|manual |\n| @load | (data : Array\\, ended : boolean, pagination : [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | - | | 成功回调。如联网返回结果后,想修改下数据再渲染界面,则在本方法里对data进行修改 |\n| @error | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 失败回调 |\n| ~~action~~ | string([string.ClientDBActionString](/uts/data-type.md#ide-string)) | - | | 云端执行数据库查询的前或后,触发某个action函数操作,进行预处理或后处理(推荐改用JQL触发器) |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/unicloud-db/unicloud-db.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n```uvue\n\r\n \r\n \r\n 0\" ref=\"listView\" class=\"list\" :scroll-y=\"true\" @scrolltolower=\"loadMore()\">\r\n \r\n \r\n {{item}}\r\n \r\n \r\n ❌\r\n \r\n \r\n \r\n Loading...\r\n {{error.errMsg}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.unicloud.unicloud-db)\n- [unicloud-db组件教程](https://doc.dcloud.net.cn/uniCloud/unicloud-db.html)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=unicloud-db&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=unicloud-db&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=unicloud-db&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=unicloud-db&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=unicloud-db&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=unicloud-db)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=unicloud-db&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)","component_type":"### UniCloudDBElement\n\n#### UniCloudDBElement 的属性值\n| 名称 | 类型 | 必填 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| dataList | Array\\ | 是 | - | 已加载的数据 |\n#### UniCloudDBElement 的方法\n##### loadData(options?: UTSJSONObject \\| null): void @loaddata\n加载数据\n当 \\ 组件的 manual 属性设为 true 或者 loadtime 属性设置为 manual 时,不会在页面初始化时联网查询数据,此时需要通过本方法在需要的时候手动加载数据。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| options | **UniCloudDBComponentLoadDataOptions** | 否 | - | - | 可选参数 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| clear | boolean | 否 | false | - | 是否清空数据 |\n@| current | number | 否 | - | - | 当前第几页 |\n@| success | (res?: T) => void | 否 | - | - | 成功回调 |\n@| fail | (err?: any) => void | 否 | - | - | 失败回调 |\n@| complete | () => void | 否 | - | - | 完成回调 | \n\n\n###### loadData 兼容性 \n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| - | - | - | - |\n\n\n##### loadMore(): void @loadmore\n加载更多数据\n在列表的加载下一页场景下,使用ref方式访问组件方法,加载更多数据,每加载成功一次,当前页 +1\n\n\n###### loadMore 兼容性 \n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| - | - | - | - |\n\n\n##### add(value: UTSJSONObject, options?: UTSJSONObject \\| null): void @add\n新增数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | UTSJSONObject | 是 | - | - | 新增数据. |\n| options | **UniCloudDBComponentAddOptions** | 否 | - | - | 可选参数 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| showToast | boolean | 否 | true | - | 是否显示 Toast |\n@| toastTitle | string | 否 | - | - | Toast 标题 |\n@| needLoading | boolean | 否 | true | - | 是否需要 Loading |\n@| loadingTitle | string | 否 | - | - | Loading 标题 |\n@| success | (res?: T) => void | 否 | - | - | 成功回调 |\n@| fail | (err?: any) => void | 否 | - | - | 失败回调 |\n@| complete | () => void | 否 | - | - | 完成回调 | \n\n\n###### add 兼容性 \n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| - | - | - | - |\n\n\n##### remove(): void @remove\n移除数据\n\n\n###### remove 兼容性 \n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| - | - | - | - |\n\n\n##### remove(): void @remove\n移除数据\n\n\n###### remove 兼容性 \n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| - | - | - | - |\n\n\n##### update(id: string, value: UTSJSONObject, options?: UTSJSONObject \\| null): void @update\n更新数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| id | string | 是 | - | - | 数据库字段的唯一标识. |\n| value | UTSJSONObject | 是 | - | - | 需要修改的新数据. |\n| options | **UniCloudDBComponentUpdateOptions** | 否 | - | - | 可选参数 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| showToast | boolean | 否 | true | - | 是否显示更新后 Toast |\n@| toastTitle | string | 否 | \"\" | - | 更新成功后 Toast 标题 |\n@| confirmTitle | string | 否 | - | - | 确认框标题 |\n@| confirmContent | string | 否 | - | - | 确认框内容 |\n@| needConfirm | boolean | 否 | true | - | 是否显示更新确认框 |\n@| needLoading | boolean | 否 | true | - | 是否需要 Loading |\n@| loadingTitle | string | 否 | - | - | Loading 标题 |\n@| success | (res?: T) => void | 否 | - | - | 成功回调 |\n@| fail | (err?: any) => void | 否 | - | - | 失败回调 |\n@| complete | () => void | 否 | - | - | 完成回调 | \n\n\n###### update 兼容性 \n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| - | - | - | - |\n\n"},"double-tap-gesture-handler":{"name":"## double-tap-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.double-tap-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/double-tap-gesture-handler.html)"},"force-press-gesture-handler":{"name":"## force-press-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| pressure | | 压力大小 |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.force-press-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/force-press-gesture-handler.html)"},"horizontal-drag-gesture-handler":{"name":"## horizontal-drag-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| deltaX | | 相对上一次,X 轴方向移动的坐标 |\n@| deltaY | | 相对上一次,Y 轴方向移动的坐标 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.horizontal-drag-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/horizontal-drag-gesture-handler.html)"},"long-press-gesture-handler":{"name":"## long-press-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| translationX | | 相对于初始触摸点的 X 轴偏移量 |\n@| translationY | | 相对于初始触摸点的 Y 轴偏移量 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.long-press-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/long-press-gesture-handler.html)"},"pan-gesture-handler":{"name":"## pan-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| deltaX | | 相对上一次,X 轴方向移动的坐标 |\n@| deltaY | | 相对上一次,Y 轴方向移动的坐标 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.pan-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/pan-gesture-handler.html)"},"scale-gesture-handler":{"name":"## scale-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| focalX | | 中心点相对于全局的X坐标 |\n@| focalY | | 中心点相对于全局的Y坐标 |\n@| focalDeltaX | | 相对上一次,中心点在X轴方向移动的坐标 |\n@| focalDeltaY | | 相对上一次,中心点在Y轴方向移动的坐标 |\n@| scale | | 放大或缩小的比例 |\n@| horizontalScale | | scale的横向分量 |\n@| verticalScale | | scale的纵向分量 |\n@| rotation | | 旋转角(单位:弧度) |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n@| pointerCount | | 跟踪的手指数 |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.scale-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/scale-gesture-handler.html)"},"tap-gesture-handler":{"name":"## tap-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.tap-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/tap-gesture-handler.html)"},"vertical-drag-gesture-handler":{"name":"## vertical-drag-gesture-handler","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| deltaX | | 相对上一次,X 轴方向移动的坐标 |\n@| deltaY | | 相对上一次,Y 轴方向移动的坐标 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.vertical-drag-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/vertical-drag-gesture-handler.html)"},"draggable-sheet":{"name":"## draggable-sheet","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| initial-child-size | number | - | | - |\n| min-child-size | number | - | | - |\n| max-child-size | number | - | | - |\n| snap | boolean | - | | - |\n| snap-sizes | Array.<number> | - | | - |\n| worklet:onsizeupdate | worklet | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.draggable-sheet)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/draggable-sheet.html)"},"grid-builder":{"name":"## grid-builder","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| padding | Array | - | | - |\n| list | Array | - | | - |\n| child-count | Array | - | | - |\n| type | string | - | | *(string)*
布局方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| aligned | | |\n@| masonry | | |\n| cross-axis-count | number | - | | - |\n| max-cross-axis-extent | number | - | | - |\n| main-axis-gap | number | - | | - |\n| cross-axis-gap | number | - | | - |\n| @itembuild | eventhandle | - | | - |\n| @itemdispose | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.grid-builder)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/grid-builder.html)"},"list-builder":{"name":"## list-builder","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| padding | Array | - | | - |\n| type | string | - | | *(string)*
类型,默认为定高模式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| static | | |\n@| dynamic | | |\n| list | Array | - | | - |\n| child-count | Array | - | | - |\n| child-height | Array | - | | - |\n| @itembuild | eventhandle | - | | - |\n| @itemdispose | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.list-builder)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/list-builder.html)"},"open-container":{"name":"## open-container","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| closed-color | string | - | | - |\n| closed-elevation | number | - | | - |\n| closed-border-radius | number | - | | - |\n| middle-color | string | - | | - |\n| open-color | string | - | | - |\n| open-elevation | number | - | | - |\n| open-border-radius | number | - | | - |\n| transition-duration | number | - | | - |\n| transition-type | string | - | | *(string)*
动画类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| fade | | |\n@| fadeThrough | | |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.open-container)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/open-container.html)"},"share-element":{"name":"## share-element","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| key | string | - | | - |\n| transform | boolean | - | | - |\n| duration | number | - | | - |\n| easing-function | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.share-element)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/share-element.html)"},"snapshot":{"name":"## snapshot","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| mode | string | - | | *(string)*
渲染模式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| view | | |\n@| picture | | |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.snapshot)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/snapshot.html)"},"span":{"name":"## span","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.span)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/span.html)"},"ad-custom":{"name":"## ad-custom","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| unit-id | string | - | | - |\n| ad-intervals | number | - | | - |\n| @load | eventhandle | - | | - |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.ad-custom)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/ad-custom.html)"},"official-account":{"name":"## official-account","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.official-account)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/official-account.html)"},"store-home":{"name":"## store-home","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| appid | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.store-home)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/store-home.html)"},"store-product":{"name":"## store-product","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| appid | string | - | | - |\n| product-id | string | - | | - |\n| product-promotion-link | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.store-product)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/store-product.html)"},"native-component":{"name":"## native-component","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.native.native-component)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/native-component.html)"},"aria-component":{"name":"## aria-component","description":"","compatibility":"\n###\n兼容性\n| Web | 微信小程序 | Android | iOS |\n| :- | :- | :- | :- |\n| x | x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.accessibility.aria-component)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/aria-component.html)"}}
\ No newline at end of file
+{"view":{"name":"## view","description":"> 组件类型:UniViewElement \n\n 基本视图容器","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| hover-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"none\" | | 指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果 |\n| hover-stop-propagation | boolean | false | | 指定是否阻止本节点的祖先节点出现点击态(祖先节点:指根节点到该节点路径上的所有节点都是这个节点的祖先节点) |\n| hover-start-time | number | 50 | | 按住后多久出现点击态,单位毫秒 |\n| hover-stay-time | number | 400 | | 手指松开后点击态保留时间,单位毫秒 |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/view/view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/view/view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/view/view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n hover_class: false,\r\n stop_propagation: false,\r\n start_time: 50,\r\n stay_time: 400,\r\n start_time_enum: [{ \"value\": 50, \"name\": \"50毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[],\r\n stay_time_enum: [{ \"value\": 400, \"name\": \"400毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[]\r\n }\r\n },\r\n methods: {\r\n change_hover_class_boolean(checked : boolean) {\r\n this.hover_class = checked\r\n },\r\n change_stop_propagation_boolean(checked : boolean) {\r\n this.stop_propagation = checked\r\n },\r\n radio_change_start_time_enum(time : number) {\r\n this.start_time = time\r\n },\r\n radio_change_stay_time_enum(time : number) {\r\n this.stay_time = time\r\n },\r\n },\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"scroll-view":{"name":"## scroll-view","description":"> 组件类型:UniScrollViewElement \n\n 可滚动视图容器","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | 渲染模式,可取值 nested |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested | | 嵌套模式。用于处理父子 scroll-view 间的嵌套滚动,子节点只能是 nested-scroll-header nested-scroll-body 组件或自定义 refresher |\n| direction | string | \"vertical\" | | 滚动方向,可取值 none、all、horizontal、vertical,默认值vertical |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 禁止滚动 |\n@| all | | 横向竖向都可滚动 app端不支持 |\n@| horizontal | | 横向滚动 |\n@| vertical | | 竖向滚动 |\n| associative-container | string | \"\" | | 关联的滚动容器 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested-scroll-view | | 嵌套滚动 |\n| enable-back-to-top | boolean | false | | iOS点击顶部状态栏滚动条返回顶部,只支持竖向 |\n| bounces | boolean | true | | 控制是否回弹效果 优先级高于rebound |\n| upper-threshold | number | 50 | | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 |\n| lower-threshold | number | 50 | | 距底部/右边多远时(单位px),触发 scrolltolower 事件 |\n| scroll-top | number | 0 | | 设置竖向滚动条位置 |\n| scroll-left | number | 0 | | 设置横向滚动条位置 |\n| scroll-into-view | string([string.IDString](/uts/data-type.md#ide-string)) | - | | 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素起始位置 |\n| scroll-with-animation | boolean | false | | 是否在设置滚动条位置时使用滚动动画,设置false没有滚动动画 |\n| refresher-enabled | boolean | false | | 开启下拉刷新,暂时不支持scroll-x = true横向刷新 |\n| refresher-threshold | number | 45 | | 设置下拉刷新阈值 |\n| refresher-max-drag-distance | number | - | | 设置下拉最大拖拽距离(单位px),默认是下拉刷新控件高度的2.5倍 |\n| refresher-default-style | string | \"black\" | | 设置下拉刷新默认样式,支持设置 black \\| white \\| none, none 表示不使用默认样式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| black | | 深颜色雪花样式 |\n@| white | | 浅白色雪花样式 |\n@| none | | 不使用默认样式 |\n| refresher-background | string([string.ColorString](/uts/data-type.md#ide-string)) | \"transparent\" | | 设置下拉刷新区域背景颜色,默认透明 |\n| refresher-triggered | boolean | false | | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\n| show-scrollbar | boolean | true | | 控制是否出现滚动条 |\n| custom-nested-scroll | boolean | false | | 子元素是否开启嵌套滚动 将滚动事件与父元素协商处理 |\n| nested-scroll-child | string([string.IDString](/uts/data-type.md#ide-string)) | \"\" | | 嵌套滚动子元素的id属性,不支持ref,scroll-view惯性滚动时会让对应id元素视图进行滚动,子元素滚动时会触发scroll-view的nestedprescroll事件,嵌套子元素需要设置custom-nested-scroll = true |\n| @refresherpulling | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新控件被下拉 |\n| @refresherrefresh | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被触发 |\n| @refresherrestore | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被复位 |\n| @refresherabort | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被中止 |\n| @scrolltoupper | (event: [UniScrollToUpperEvent](#uniscrolltoupperevent)) => void | - | | 滚动到顶部/左边,会触发 scrolltoupper 事件 |\n| @scrolltolower | (event: [UniScrollToLowerEvent](#uniscrolltolowerevent)) => void | - | | 滚动到底部/右边,会触发 scrolltolower 事件 |\n| @scroll | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @scrollend | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动结束时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @startnestedscroll | (event: [UniStartNestedScrollEvent](#unistartnestedscrollevent)) => Boolean | - | | 子元素开始滚动时触发, return true表示与子元素开启滚动协商 默认return false! event = {node} |\n| @nestedprescroll | (event: [UniNestedPreScrollEvent](#uninestedprescrollevent)) => void | - | | 子元素滚动时触发,可执行event.consumed(x,y)告知子元素deltaX、deltaY各消耗多少。子元素将执行差值后的deltaX、deltaY滚动距离。不执行consumed(x,y)则表示父元素不消耗deltaX、deltaY。event = {deltaX, deltaY} |\n| @stopnestedscroll | (event: [UniStopNestedScrollEvent](#unistopnestedscrollevent)) => void | - | | 子元素滚动结束或意外终止时触发 |\n| enable-passive | boolean | - | | - |\n| fast-deceleration | boolean | - | | - |\n| @dragstart | eventhandle | - | | - |\n| @dragging | eventhandle | - | | - |\n| @dragend | eventhandle | - | | - |\n| ~~rebound~~ | boolean | true | | 控制是否回弹效果。已废弃,请改用bounces |\n| ~~scroll-y~~ | boolean | true | | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-x~~ | boolean | false | | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |","event":"\n### 事件\n#### UniRefresherEvent\n\n```mermaid\ngraph LR\n \nUniRefresherEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRefresherEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dy | number | 是 | - | - | - |\n\n\n#### UniScrollToUpperEvent\n\n```mermaid\ngraph LR\n \nUniScrollToUpperEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToUpperEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 top 或 left |\n\n\n#### UniScrollToLowerEvent\n\n```mermaid\ngraph LR\n \nUniScrollToLowerEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToLowerEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 bottom 或 right |\n\n\n#### UniScrollEvent\n\n```mermaid\ngraph LR\n \nUniScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number | 是 | - | - | 竖向滚动的距离 |\n@| scrollLeft | number | 是 | - | - | 横向滚动的距离 |\n@| scrollHeight | number | 是 | - | - | 滚动区域的高度 |\n@| scrollWidth | number | 是 | - | - | 滚动区域的宽度 |\n@| deltaY | number | 是 | - | - | 当次滚动事件竖向滚动量 |\n@| deltaX | number | 是 | - | - | 当次滚动事件横向滚动量 |\n\n\n#### UniStartNestedScrollEvent\n\n```mermaid\ngraph LR\n \nUniStartNestedScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniStartNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| node | [UniElement](/dom/unielement.md) | 是 | - | - | 开始滚动子节点对象 |\n| isTouch | boolean | 是 | - | | 是否由触摸行为发生的Event |\n\n\n#### UniNestedPreScrollEvent\n\n```mermaid\ngraph LR\n \nUniNestedPreScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniNestedPreScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| deltaX | number | 是 | - | - | x轴滚动距离 |\n| deltaY | number | 是 | - | - | y轴滚动距离 |\n| isTouch | boolean | 是 | - | | 是否由触摸行为发生的Event |\n\n\n##### UniNestedPreScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| consumed | (consumedX: number, consumedY: number) => void | 是 | - | - | 通知到子节点x,y轴滚动距离的消耗 |\n\n#### UniStopNestedScrollEvent\n\n```mermaid\ngraph LR\n \nUniStopNestedScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniStopNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| isTouch | boolean | 是 | - | - | 是否由触摸行为发生的Event |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/scroll-view/scroll-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/scroll-view/scroll-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/scroll-view/scroll-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Vertical Scroll\r\n 纵向滚动\r\n \r\n \r\n \r\n A\r\n B\r\n C\r\n \r\n \r\n \r\n 点击这里返回顶部\r\n \r\n\r\n \r\n Horizontal Scroll\r\n 横向滚动\r\n \r\n \r\n \r\n A\r\n B\r\n C\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n type ScrollEventTest = {\r\n type : string;\r\n target : UniElement | null;\r\n currentTarget : UniElement | null;\r\n direction ?: string\r\n }\r\n export default {\r\n data() {\r\n return {\r\n scrollTop: 0,\r\n oldScrollTop: 0,\r\n scrollLeft: 120,\r\n showScrollbar: true,\r\n // 自动化测试\r\n isScrollTest: '',\r\n isScrolltolowerTest: '',\r\n isScrolltoupperTest: '',\r\n scrollDetailTest: null as UniScrollEventDetail | null,\r\n scrollEndDetailTest: null as UniScrollEventDetail | null,\r\n }\r\n },\r\n methods: {\r\n upper: function (e : UniScrollToUpperEvent) {\r\n console.log('滚动到顶部/左边', e)\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget,\r\n direction: e.detail.direction,\r\n } as ScrollEventTest, 'scrolltoupper')\r\n },\r\n lower: function (e : UniScrollToLowerEvent) {\r\n console.log('滚动到底部/右边', e)\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget,\r\n direction: e.detail.direction,\r\n } as ScrollEventTest, 'scrolltolower')\r\n },\r\n scroll: function (e : UniScrollEvent) {\r\n this.scrollDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as ScrollEventTest, 'scroll')\r\n this.oldScrollTop = e.detail.scrollTop\r\n },\r\n end: function (e : UniScrollEvent) {\r\n console.log('滚动结束时触发', e)\r\n this.scrollEndDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as ScrollEventTest, 'scrollend')\r\n },\r\n goTop: function () {\r\n // 解决view层不同步的问题\r\n this.scrollTop = this.oldScrollTop\r\n this.$nextTick(function () {\r\n this.scrollTop = 0\r\n })\r\n uni.showToast({\r\n icon: 'none',\r\n title: '纵向滚动 scrollTop 值已被修改为 0',\r\n })\r\n },\r\n // 自动化测试专用(由于事件event参数对象中存在循环引用,在ios端JSON.stringify报错,自动化测试无法page.data获取)\r\n checkEventTest(e : ScrollEventTest, eventName : String) {\r\n const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;\r\n const result = isPass ? `${eventName}:Success` : `${eventName}:Fail`;\r\n switch (eventName) {\r\n case 'scroll':\r\n this.isScrollTest = result\r\n break;\r\n case 'scrolltolower':\r\n this.isScrolltolowerTest = result + `-${e.direction}`\r\n break;\r\n case 'scrolltoupper':\r\n this.isScrolltoupperTest = result + `-${e.direction}`\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n // 自动化测试专用\r\n setVerticalScrollBy(y : number) {\r\n const element = uni.getElementById(\"verticalScrollView\")\r\n if (element != null) {\r\n element.scrollBy(0, y)\r\n }\r\n }\r\n },\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.scroll-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/scroll-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/scroll-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=scroll-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=scroll-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=scroll-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=scroll-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=scroll-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=scroll-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"swiper-item":{"name":"## swiper-item","description":"> 组件类型:UniSwiperItemElement \n\n swiper的唯一合法子组件。每个swiper-item代表一个滑块。宽高自动设置为100%","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| item-id | string | - | | 该 swiper-item 的标识符 |\n| skip-hidden-item-layout | boolean | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.swiper.swiper-item)\n- [参见uni-app相关文档](https://uniapp.dcloud.net.cn/component/swiper.html#swiper-item)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/swiper-item.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=swiper-item&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=swiper-item&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=swiper-item&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=swiper-item&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=swiper-item)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=swiper-item&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"swiper":{"name":"## swiper","description":"> 组件类型:UniSwiperElement \n\n 滑块视图容器","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| indicator-dots | boolean | false | | 是否显示面板指示点 |\n| indicator-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"rgba(0, 0, 0, .3)\" | | 指示点颜色 |\n| indicator-active-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#000000\" | | 当前选中的指示点颜色 |\n| active-class | string | - | | swiper-item 可见时的 class |\n| changing-class | boolean | - | | acceleration 设置为 {{true}} 时且处于滑动过程中,中间若干屏处于可见时的class |\n| acceleration | boolean | - | | 当开启时,会根据滑动速度,连续滑动多屏 |\n| disable-programmatic-animation | boolean | - | | 是否禁用代码变动触发 swiper 切换时使用动画。 |\n| disable-touch | boolean | false | | 是否禁止用户 touch 操作 |\n| touchable | boolean | - | | 是否监听用户的触摸事件 |\n| easing-function | string | - | | 指定 swiper 切换缓动动画类型,有效值:default、linear、easeInCubic、easeOutCubic、easeInOutCubic |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| default | | |\n@| linear | | |\n@| easeInCubic | | |\n@| easeOutCubic | | |\n@| easeInOutCubic | | |\n| autoplay | boolean | false | | 是否自动切换 |\n| current | number | 0 | | 当前所在滑块的 index |\n| current-item-id | string | - | | 当前所在滑块的 item-id ,不能与 current 被同时指定 |\n| interval | number | 3000 | | 自动切换时间间隔 |\n| duration | number | - | | 滑动动画时长 |\n| circular | boolean | false | | 是否采用衔接滑动 |\n| vertical | boolean | false | | 滑动方向是否为纵向 |\n| rebound | boolean | true | | 控制是否回弹效果 |\n| previous-margin | string | - | | 前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值 |\n| next-margin | string | - | | 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值 |\n| display-multiple-items | number | - | | 同时显示的滑块数量 |\n| skip-hidden-item-layout | boolean | - | | 是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息 |\n| @change | (event: [UniSwiperChangeEvent](#uniswiperchangeevent)) => void | - | | current 改变时会触发 change 事件,event.detail = {current: current, source: source} |\n| @transition | (event: [UniSwiperTransitionEvent](#uniswipertransitionevent)) => void | - | | swiper-item 的位置发生改变时会触发 transition 事件,event.detail = {dx: dx, dy: dy} |\n| @animationfinish | (event: [UniSwiperAnimationFinishEvent](#uniswiperanimationfinishevent)) => void | - | | 动画结束时会触发 animationfinish 事件,event.detail = {current: current, source: source} |","event":"\n### 事件\n#### UniSwiperChangeEvent\n\n```mermaid\ngraph LR\n \nUniSwiperChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniSwiperChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniSwiperChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| current | number | 是 | - | - | 发生change事件的滑块下标 |\n@| currentItemId | string | 否 | - | | 切换结束的 swiper-item 的 item-id 属性值 |\n@| source | string | 是 | - | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n\n#### UniSwiperTransitionEvent\n\n```mermaid\ngraph LR\n \nUniSwiperTransitionEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniSwiperTransitionEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniSwiperTransitionEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dx | number | 是 | - | - | 横向偏移量,单位是逻辑像素px |\n@| dy | number | 是 | - | - | 纵向偏移量,单位是逻辑像素px |\n\n\n#### UniSwiperAnimationFinishEvent\n\n```mermaid\ngraph LR\n \nUniSwiperAnimationFinishEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniSwiperAnimationFinishEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniSwiperAnimationFinishEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| current | number | 是 | - | - | 发生动画结束事件的滑块下标 |\n@| currentItemId | string | 否 | - | | 动画结束的 swiper-item 的 item-id 属性值 |\n@| source | string | 是 | - | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/swiper/swiper.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/swiper/swiper\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/swiper/swiper\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n A\r\n \r\n \r\n B\r\n \r\n \r\n C\r\n \r\n \r\n \r\n \r\n \r\n 是否显示面板指示点\r\n \r\n \r\n \r\n 是否自动切换\r\n \r\n \r\n \r\n 是否循环\r\n \r\n \r\n \r\n 是否显示rebound效果\r\n \r\n \r\n 间隔时间(毫秒)\r\n \r\n \r\n \r\n \r\n 定制指示器颜色\r\n \r\n \r\n \r\n 纵向\r\n \r\n \r\n \r\n 指定current为最后一个元素\r\n \r\n \r\n \r\n 指定current-item-id为最后一个元素\r\n \r\n \r\n \r\n 禁止用户 touch 操作\r\n \r\n \r\n \r\n swiperTransition 是否打印\r\n \r\n \r\n \r\n swiperAnimationfinish 是否打印\r\n \r\n \r\n \r\n swiperChange 是否打印\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n type SwiperEventTest = {\r\n type : string;\r\n target : UniElement | null;\r\n currentTarget : UniElement | null;\r\n }\r\n export default {\r\n data() {\r\n return {\r\n background: ['color1', 'color2', 'color3'],\r\n dotsSelect: false,\r\n reboundSelect: false,\r\n autoplaySelect: false,\r\n circularSelect: false,\r\n indicatorColorSelect: false,\r\n verticalSelect: false,\r\n currentSelect: false,\r\n currentItemIdSelect: false,\r\n intervalSelect: 2000,\r\n indicatorColor: \"\",\r\n indicatorColorActive: \"\",\r\n currentVal: 0,\r\n currentItemIdVal: \"\",\r\n disableTouchSelect: false,\r\n swiperTransitionSelect: false,\r\n swiperAnimationfinishSelect: false,\r\n swiperChangeSelect: false,\r\n currentValChange: 0,\r\n // 自动化测试\r\n changeDetailTest: null as UniSwiperChangeEventDetail | null,\r\n transitionDetailTest: null as UniSwiperTransitionEventDetail | null,\r\n animationfinishDetailTest: null as UniSwiperAnimationFinishEventDetail | null,\r\n isChangeTest: '',\r\n isTransitionTest: '',\r\n isAnimationfinishTest: '',\n swipeX: 0,\n swipeY: 0\r\n }\r\n },\n onReady() {\n // 获取模拟滑动手势的起始点\n let ele = uni.getElementById(\"swiper-view\")\n let eleRect = ele?.getBoundingClientRect()\r\n if(eleRect != null) {\r\n this.swipeX = eleRect.width - 10\r\n this.swipeY += eleRect.y + uni.getSystemInfoSync().safeArea.top + 44 + 35\r\n }\n },\r\n methods: {\n swipertouchStart(e: UniTouchEvent) {\n console.log(\"swiper touchstart\")\n },\n viewtouchStart(e: UniTouchEvent) {\n console.log(\"view touchstart:\")\n },\r\n swiperChange: function (e : UniSwiperChangeEvent) {\r\n this.changeDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as SwiperEventTest, 'change')\r\n this.currentValChange = e.detail.current\r\n console.log(this.currentValChange)\r\n if (this.swiperChangeSelect) {\r\n console.log(\"swiperChange\")\r\n console.log(e)\r\n }\r\n },\r\n swiperTransition: function (e : UniSwiperTransitionEvent) {\r\n this.transitionDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as SwiperEventTest, 'transition')\r\n if (this.swiperTransitionSelect) {\r\n console.log(\"swiperTransition\")\r\n console.log(e)\r\n }\r\n },\r\n swiperAnimationfinish: function (e : UniSwiperAnimationFinishEvent) {\r\n this.animationfinishDetailTest = e.detail\r\n this.checkEventTest({\r\n type: e.type,\r\n target: e.target,\r\n currentTarget: e.currentTarget\r\n } as SwiperEventTest, 'animationfinish')\r\n if (this.swiperAnimationfinishSelect) {\r\n console.log(\"swiperAnimationfinish\")\r\n console.log(e)\r\n }\r\n },\r\n // 自动化测试专用(由于事件event参数对象中存在循环引用,在ios端JSON.stringify报错,自动化测试无法page.data获取)\r\n checkEventTest(e : SwiperEventTest, eventName : String) {\r\n const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;\r\n const result = isPass ? `${eventName}:Success` : `${eventName}:Fail`;\r\n switch (eventName) {\r\n case 'change':\r\n this.isChangeTest = result\r\n break;\r\n case 'transition':\r\n this.isTransitionTest = result\r\n break;\r\n case 'animationfinish':\r\n this.isAnimationfinishTest = result\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n dotsChange: function (e : UniSwitchChangeEvent) {\r\n this.dotsSelect = e.detail.value\r\n },\r\n swiperTransitionChange: function (e : UniSwitchChangeEvent) {\r\n this.swiperTransitionSelect = e.detail.value\r\n },\r\n swiperChangeChange: function (e : UniSwitchChangeEvent) {\r\n this.swiperChangeSelect = e.detail.value\r\n },\r\n swiperAnimationfinishChange: function (e : UniSwitchChangeEvent) {\r\n this.swiperAnimationfinishSelect = e.detail.value\r\n },\r\n autoplayChange: function (e : UniSwitchChangeEvent) {\r\n this.autoplaySelect = e.detail.value\r\n },\r\n verticalChange: function (e : UniSwitchChangeEvent) {\r\n this.verticalSelect = e.detail.value\r\n },\r\n disableTouchChange: function (e : UniSwitchChangeEvent) {\r\n this.disableTouchSelect = e.detail.value\r\n },\r\n currentItemIdChange: function (e : UniSwitchChangeEvent) {\r\n this.currentItemIdSelect = e.detail.value\r\n if (this.currentItemIdSelect) {\r\n this.currentItemIdVal = 'C'\r\n } else {\r\n this.currentItemIdVal = 'A'\r\n }\r\n },\r\n currentChange: function (e : UniSwitchChangeEvent) {\r\n this.currentSelect = e.detail.value\r\n if (this.currentSelect) {\r\n this.currentVal = 2\r\n } else {\r\n this.currentVal = 0\r\n }\r\n\r\n },\r\n circularChange: function (e : UniSwitchChangeEvent) {\r\n this.circularSelect = e.detail.value\r\n console.log(this.circularSelect)\r\n },\r\n reboundSelectChange: function (e : UniSwitchChangeEvent) {\r\n this.reboundSelect = e.detail.value\r\n console.log(this.reboundSelect)\r\n },\r\n sliderChange(e : UniSliderChangeEvent) {\r\n this.intervalSelect = e.detail.value\r\n },\r\n indicatorColorChange(e : UniSwitchChangeEvent) {\r\n this.indicatorColorSelect = e.detail.value\r\n if (this.indicatorColorSelect) {\r\n // 选择了定制指示器颜色\r\n this.indicatorColor = \"#ff00ff\"\r\n this.indicatorColorActive = \"#0000ff\"\r\n } else {\r\n // 没有选择颜色\r\n this.indicatorColor = \"\"\r\n this.indicatorColorActive = \"\"\r\n }\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [swiper-item](swiper-item.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.swiper.swiper)\n- [参见uni-app相关文档](https://uniapp.dcloud.net.cn/component/swiper.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/swiper.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=swiper&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=swiper&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=swiper&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=swiper&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=swiper)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=swiper&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"match-media":{"name":"## match-media","description":"media query 匹配检测节点","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| width | number | - | | 页面宽度(px 为单位) |\n| min-width | number | - | | 页面最小宽度(px 为单位) |\n| max-width | number | - | | 页面最大宽度(px 为单位) |\n| height | number | - | | 页面高度(px 为单位) |\n| min-height | number | - | | 页面最小高度(px 为单位) |\n| max-height | number | - | | 页面最大高度(px 为单位) |\n| orientation | string | - | | 屏幕方向(landscape 或 portrait) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| vertical | - | |\n@| horizontal | - | |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.match-media)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/match-media.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/match-media.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=match-media&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=match-media&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=match-media&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=match-media&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=match-media)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=match-media&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"movable-area":{"name":"## movable-area","description":"movable-view 的可移动区域","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| scale-area | boolean | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.movable.movable-area)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/movable-area.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/movable-area.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=movable-area&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=movable-area&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=movable-area&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=movable-area&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=movable-area)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=movable-area&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"movable-view":{"name":"## movable-view","description":"可移动的视图容器,在页面中可以拖拽滑动","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| direction | string | - | | movable-view的移动方向,属性值有all、vertical、horizontal、none |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| all | - | |\n@| vertical | - | |\n@| horizontal | - | |\n@| none | - | |\n| inertia | boolean | - | | movable-view 是否带有惯性。 |\n| out-of-bounds | boolean | - | | 超过可移动区域后,movable-view 是否还可以移动。 |\n| x | string \\\\| number | - | | 定义 x 轴方向的偏移,如果 x 的值不在可移动范围内,会自动移动到可移动范围;改变 x 的值会触发动画。 |\n| y | string \\\\| number | - | | 定义 y 轴方向的偏移,如果 y 的值不在可移动范围内,会自动移动到可移动范围;改变 y 的值会触发动画。 |\n| damping | number | - | | 阻尼系数,用于控制 x 或 y 改变时的动画和过界回弹的动画,值越大移动越快。 |\n| friction | number | - | | 摩擦系数,用于控制惯性滑动的动画,值越大摩擦力越大,滑动越快停止;必须大于0,否则会被设置成默认值 2。 |\n| disabled | boolean | - | | 是否禁用。 |\n| scale | boolean | - | | 是否支持双指缩放,默认缩放手势生效区域是在 movable-view 内。 |\n| scale-min | number | - | | 定义缩放倍数最小值,默认为 0.5。 |\n| scale-max | number | - | | 定义缩放倍数最大值,默认为 10。 |\n| scale-value | number | - | | 定义缩放倍数,取值范围为 0.5 - 10 |\n| animation | boolean | - | | 是否使用动画,默认为 true。 |\n| @change | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 拖动过程中触发的事件,event.detail = {x: x, y: y, source: source}。其中source表示产生移动的原因,值可为touch(拖动)、touch-out-of-bounds(超出移动范围)、out-of-bounds(超出移动范围后的回弹)、friction(惯性)和空字符串(setData)。 |\n| @scale | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 缩放过程中触发的事件,event.detail = {x: x, y: y, scale: scale}。 |\n| htouchmove | eventhandle | - | | - |\n| vtouchmove | eventhandle | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/movable-view/movable-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/movable-view/movable-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n 示例 1\r\n \\nmovable-view 区域小于 movable-area\r\n \r\n \r\n text\r\n \r\n \r\n 点击这里移动至 (30px, 30px)\r\n \r\n \r\n 示例 2\r\n \\nmovable-view区域大于movable-area\r\n \r\n \r\n text\r\n \r\n \r\n 示例 3\r\n \\n只可以横向移动\r\n \r\n \r\n text\r\n \r\n \r\n 示例 4\r\n \\n只可以纵向移动\r\n \r\n \r\n text\r\n \r\n \r\n 示例 5\r\n \\n可超出边界\r\n \r\n \r\n text\r\n \r\n \r\n 示例 6\r\n \\n带有惯性\r\n \r\n \r\n text\r\n \r\n \r\n 示例 7\r\n \\n可放缩\r\n \r\n \r\n text\r\n \r\n \r\n 点击这里放大3倍\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n x: 0,\r\n y: 0,\r\n scale: 2,\r\n old: {\r\n x: 0,\r\n y: 0,\r\n scale: 2\r\n }\r\n }\r\n },\r\n methods: {\r\n tap: function (e) {\r\n // 解决view层不同步的问题\r\n this.x = this.old.x\r\n this.y = this.old.y\r\n this.$nextTick(function () {\r\n this.x = 30\r\n this.y = 30\r\n })\r\n },\r\n tap2() {\r\n // 解决view层不同步的问题\r\n this.scale = this.old.scale\r\n this.scale = this.old.scale\r\n this.$nextTick(function () {\r\n this.scale = 3\r\n })\r\n },\r\n onChange: function (e) {\r\n this.old.x = e.detail.x\r\n this.old.y = e.detail.y\r\n },\r\n onScale: function (e) {\r\n this.old.scale = e.detail.scale\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.movable.movable-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/movable-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/movable-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=movable-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=movable-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=movable-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=movable-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=movable-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=movable-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"cover-view":{"name":"## cover-view","description":"覆盖在原生组件之上的文本视图,可覆盖的原生组件包括map、video、canvas、camera,只支持嵌套cover-view、cover-image","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| scroll-top | number/string | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/cover-view/cover-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/cover-view/cover-view\n\n>Template\n```vue\n\n \n \n \n 注意:需要正确配置地图服务商的Key才能正常显示地图组件\n \n \n \n 简单的cover-view\n \n \n \n\n\n\n\n\n\n```\n\n>Script\n```uts\n\n export default {\n data() {\n return {\n showMap: false,\n latitude: 39.909,\n longitude: 116.39742\n };\n },\n onLoad() {\n this.showMap = true\n }\n }\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.cover.cover-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/cover-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/cover-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=cover-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=cover-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=cover-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=cover-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=cover-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=cover-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"cover-image":{"name":"## cover-image","description":"覆盖在原生组件之上的图片视图,可覆盖的原生组件同cover-view,支持嵌套在cover-view里。","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| v-for | Any | - | | - |\n| v-if | Any | - | | - |\n| v-show | Any | - | | - |\n| src | string([string.ImageURIString](/uts/data-type.md#ide-string)) | - | | 图标路径,支持临时路径、网络地址(1.6.0起支持)。暂不支持base64格式。 |\n| referrer-policy | string | - | | *(string)*
格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| origin | | |\n@| no-referrer | | |\n| @load | eventhandle | - | | - |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.cover.cover-image)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/cover-image.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/cover-image.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=cover-image&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=cover-image&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=cover-image&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=cover-image&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=cover-image)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=cover-image&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"list-item":{"name":"## list-item","description":"> 组件类型:UniListItemElement \n\n list-view组件的唯一合法子组件。每个item是一行","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.02 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | number | 0 | | 对应list-item的类型 list-view 将对同类型条目进行复用,所以合理的类型拆分,可以很好地提升 list-view 性能 |","event":"","example":"","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.list-view.list-item)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=list-item&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=list-item&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=list-item&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=list-item&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=list-item&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=list-item)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=list-item&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"sticky-header":{"name":"## sticky-header","description":"> 组件类型:UniStickyHeaderElement \n\n 吸顶布局容器
注意:暂时仅支持作为list-view、sticky-section的子节点, sticky-header不支持css样式!当一个容器视图设置多个sticky-header时,后一个sticky-header会停靠在前一个sticky-header的末尾处。","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.02 | 3.93 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| padding | array\\ | [0,0,0,0\\] | | 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |\n| offset-top | number | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/sticky-header/sticky-header.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/sticky-header/sticky-header\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/sticky-header/sticky-header\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n {{i}}\r\n \r\n \r\n \r\n \r\n 向上滑动页面,体验sticky-header吸顶效果。\r\n \r\n \r\n \r\n \r\n \r\n {{name}}\r\n \r\n \r\n \r\n \r\n\r\n \r\n {{item}}\r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n sift_item: [\"排序\", \"筛选\"],\r\n list_item: [] as Array,\r\n refresher_enabled_boolean: true,\r\n refresher_triggered_boolean: false,\r\n scroll_top_input: 0\r\n }\r\n },\r\n onLoad() {\r\n let lists : Array = []\r\n for (let i = 0; i < 40; i++) {\r\n lists.push(\"item---\" + i)\r\n }\r\n this.list_item = lists\r\n },\r\n methods: {\r\n list_view_refresherrefresh() {\r\n console.log(\"下拉刷新被触发 \")\r\n this.refresher_triggered_boolean = true\r\n setTimeout(() => {\r\n this.refresher_triggered_boolean = false\r\n }, 1500)\r\n },\r\n confirm_scroll_top_input(value : number) {\r\n this.scroll_top_input = value\r\n },\r\n clickTH(index : number) {\r\n console.log(\"点击表头:\" + index);\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.sticky.sticky-header)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/sticky-header.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=sticky-header&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=sticky-header&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=sticky-header&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=sticky-header&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=sticky-header)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=sticky-header&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"sticky-section":{"name":"## sticky-section","description":"> 组件类型:UniStickySectionElement \n\n 吸顶布局容器
注意:暂时仅支持作为list-view的子节点, sticky-section不支持css样式!","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.02 | 3.98 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| push-pinned-header | boolean | true | | sticky-section元素重叠时是否继续上推 |\n| padding | array\\ | [0,0,0,0\\] | | 长度为 4 的数组,按 top、right、bottom、left 顺序指定内边距 |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/sticky-section/sticky-section.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/sticky-section/sticky-section\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/sticky-section/sticky-section\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{list.text}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export type sectionData = {\r\n name : string,\r\n list : sectionListItem[]\r\n }\r\n export type sectionListItem = {\r\n text : string\r\n }\r\n export default {\r\n data() {\r\n return {\r\n data: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N'],\r\n sectionPadding: [0, 10, 0, 10] as Array,\r\n scrollIntoView: \"\",\r\n scrolling: false,\r\n sectionArray: [] as sectionData[],\r\n appendId: 0\r\n }\r\n },\r\n onLoad() {\r\n this.data.forEach(key => {\r\n const list = [] as sectionListItem[]\r\n for (let i = 1; i < 11; i++) {\r\n const item = { text: key + \"--item--content----\" + i } as sectionListItem\r\n list.push(item)\r\n }\r\n const data = { name: key, list: list } as sectionData\r\n this.sectionArray.push(data)\r\n }\r\n )\r\n },\r\n methods: {\r\n toTop() {\r\n this.scrollIntoView = \"\"\r\n uni.getElementById(\"list-view\")!.scrollTop = 0\r\n },\r\n //用于自动化测试\r\n listViewScrollByY(y : number) {\r\n const listview = this.$refs[\"list-view\"] as UniElement\r\n // listview.scrollBy(0, y)\r\n listview.scrollTop = y\r\n },\r\n gotoStickyHeader(id : string) {\r\n // #ifdef APP\r\n this.scrollIntoView = id\r\n // #endif\r\n // #ifdef WEB\r\n console.log(\"web端不支持该功能\")\r\n // #endif\r\n },\r\n onScroll() {\r\n this.scrolling = true\r\n },\r\n onScrollEnd() {\r\n this.scrolling = false\r\n //滚动后重置scrollIntoView = \"\"\r\n if (this.scrollIntoView != \"\") {\r\n this.scrollIntoView = \"\"\r\n }\r\n },\r\n appendSectionItem(index : number) {\r\n const data = this.sectionArray[index]\r\n this.appendId++\r\n const list = [\r\n { text: data.name + \"--item--content----new1--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new2--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new3--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new4--\" + this.appendId } as sectionListItem,\r\n { text: data.name + \"--item--content----new5--\" + this.appendId } as sectionListItem\r\n ] as sectionListItem[]\r\n data.list.unshift(...list)\r\n },\r\n deleteSection() {\r\n this.sectionArray.shift()\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.sticky.sticky-section)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/sticky-section.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=sticky-section&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=sticky-section&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=sticky-section&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=sticky-section&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=sticky-section)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=sticky-section&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"list-view":{"name":"## list-view","description":"> 组件类型:UniListViewElement \n\n 列表组件","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.02 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| direction | string | \"vertical\" | | 滚动方向,可取值 none、horizontal、vertical,默认值vertical。注:iOS 平台仅支持vertical |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 禁止滚动 |\n@| horizontal | | 横向滚动 |\n@| vertical | | 竖向滚动 |\n| associative-container | string | \"\" | | 关联的滚动容器 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested-scroll-view | | 嵌套滚动 |\n| bounces | boolean | true | | 控制是否回弹效果 优先级高于rebound |\n| upper-threshold | number | 50 | | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 |\n| lower-threshold | number | 50 | | 距底部/右边多远时(单位px),触发 scrolltolower 事件 |\n| scroll-top | number | 0 | | 设置竖向滚动条位置 |\n| scroll-left | number | 0 | | 设置横向滚动条位置 |\n| show-scrollbar | boolean | true | | 控制是否出现滚动条 |\n| scroll-into-view | string([string.IDString](/uts/data-type.md#ide-string)) | - | | 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素起始位置 |\n| scroll-with-animation | boolean | false | | 是否在设置滚动条位置时使用滚动动画,设置false没有滚动动画 |\n| refresher-enabled | boolean | false | | 开启下拉刷新,暂时不支持scroll-x = true横向刷新 |\n| refresher-threshold | number | 45 | | 设置下拉刷新阈值, 仅 refresher-default-style = 'none' 自定义样式下生效 |\n| refresher-max-drag-distance | number | - | | 设置下拉最大拖拽距离(单位px),默认是下拉刷新控件高度的2.5倍 |\n| refresher-default-style | string | \"black\" | | 设置下拉刷新默认样式,支持设置 black \\| white \\| none, none 表示不使用默认样式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| black | | 深颜色雪花样式 |\n@| white | | 浅白色雪花样式 |\n@| none | | 不使用默认样式 |\n| refresher-background | string([string.ColorString](/uts/data-type.md#ide-string)) | \"transparent\" | | 设置下拉刷新区域背景颜色,默认透明 |\n| refresher-triggered | boolean | false | | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\n| enable-back-to-top | boolean | false | | iOS点击顶部状态栏滚动条返回顶部,只支持竖向 |\n| custom-nested-scroll | boolean | false | | 子元素是否开启嵌套滚动 将滚动事件与父元素协商处理 |\n| @refresherpulling | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新控件被下拉 |\n| @refresherrefresh | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被触发 |\n| @refresherrestore | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被复位 |\n| @refresherabort | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被中止 |\n| @scrolltoupper | (event: [UniScrollToUpperEvent](#uniscrolltoupperevent)) => void | - | | 滚动到顶部/左边,会触发 scrolltoupper 事件 |\n| @scrolltolower | (event: [UniScrollToLowerEvent](#uniscrolltolowerevent)) => void | - | | 滚动到底部/右边,会触发 scrolltolower 事件 |\n| @scroll | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @scrollend | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动结束时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| padding | Array | - | | - |\n| ~~rebound~~ | boolean | true | | 控制是否回弹效果。已废弃,请改用bounces |\n| ~~scroll-y~~ | boolean | true | | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-x~~ | boolean | false | | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |","event":"\n### 事件\n#### UniRefresherEvent\n\n```mermaid\ngraph LR\n \nUniRefresherEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRefresherEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dy | number | 是 | - | - | - |\n\n\n#### UniScrollToUpperEvent\n\n```mermaid\ngraph LR\n \nUniScrollToUpperEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToUpperEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 top 或 left |\n\n\n#### UniScrollToLowerEvent\n\n```mermaid\ngraph LR\n \nUniScrollToLowerEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToLowerEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 bottom 或 right |\n\n\n#### UniScrollEvent\n\n```mermaid\ngraph LR\n \nUniScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number | 是 | - | - | 竖向滚动的距离 |\n@| scrollLeft | number | 是 | - | - | 横向滚动的距离 |\n@| scrollHeight | number | 是 | - | - | 滚动区域的高度 |\n@| scrollWidth | number | 是 | - | - | 滚动区域的宽度 |\n@| deltaY | number | 是 | - | - | 当次滚动事件竖向滚动量 |\n@| deltaX | number | 是 | - | - | 当次滚动事件横向滚动量 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/list-view/list-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/list-view/list-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/list-view/list-view\n\n>Template\n```vue\n\n\n\n \n \n \n {{key}}\n \n \n \n {{text[state]}}\n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n\n\n\n```\n\n>Script\n```uts\n\n type ScrollEventTest = {\n type : string;\n target : UniElement | null;\n currentTarget : UniElement | null;\n direction ?: string\n }\n import { ItemType } from '@/components/enum-data/enum-data-types'\n export default {\n data() {\n return {\n refresher_triggered_boolean: false,\n refresher_enabled_boolean: false,\n scroll_with_animation_boolean: false,\n show_scrollbar_boolean: false,\n bounces_boolean: true,\n scroll_y_boolean: true,\n scroll_x_boolean: false,\n scroll_direction: \"vertical\",\n upper_threshold_input: 50,\n lower_threshold_input: 50,\n scroll_top_input: 0,\n scroll_left_input: 0,\n refresher_background_input: \"#FFF\",\n scrollData: [] as Array,\n size_enum: [{ \"value\": 0, \"name\": \"item---0\" }, { \"value\": 3, \"name\": \"item---3\" }] as ItemType[],\n scrollIntoView: \"\",\n refresherrefresh: false,\n refresher_default_style_input: \"black\",\n text: ['继续下拉执行刷新', '释放立即刷新', '刷新中', \"\"],\n state: 3,\n reset: true,\n // 自动化测试\n isScrollTest: '',\n isScrolltolowerTest: '',\n isScrolltoupperTest: '',\n scrollDetailTest: null as UniScrollEventDetail | null,\n scrollEndDetailTest: null as UniScrollEventDetail | null,\n }\n },\n onLoad() {\n let lists : Array = []\n for (let i = 0; i < 10; i++) {\n lists.push(\"item---\" + i)\n }\n this.scrollData = lists\n },\n methods: {\n list_view_click() { console.log(\"组件被点击时触发\") },\n list_view_touchstart() { console.log(\"手指触摸动作开始\") },\n list_view_touchmove() { console.log(\"手指触摸后移动\") },\n list_view_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\n list_view_touchend() { console.log(\"手指触摸动作结束\") },\n list_view_tap() { console.log(\"手指触摸后马上离开\") },\n list_view_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\n list_view_refresherpulling(e : RefresherEvent) {\n console.log(\"下拉刷新控件被下拉\")\n if (this.reset) {\n if (e.detail.dy > 45) {\n this.state = 1\n } else {\n this.state = 0\n }\n }\n },\n list_view_refresherrefresh() {\n console.log(\"下拉刷新被触发 \")\n this.refresherrefresh = true\n this.refresher_triggered_boolean = true\n this.state = 2\n this.reset = false;\n setTimeout(() => {\n this.refresher_triggered_boolean = false\n }, 1500)\n },\n list_view_refresherrestore() {\n this.refresherrefresh = false\n this.state = 3\n this.reset = true\n console.log(\"下拉刷新被复位\")\n },\n list_view_refresherabort() { console.log(\"下拉刷新被中止\") },\n list_view_scrolltoupper(e : UniScrollToUpperEvent) {\n console.log(\"滚动到顶部/左边,会触发 scrolltoupper 事件 direction=\" + e.detail.direction)\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget,\n direction: e.detail.direction,\n } as ScrollEventTest, 'scrolltoupper')\n },\n list_view_scrolltolower(e : UniScrollToLowerEvent) {\n console.log(\"滚动到底部/右边,会触发 scrolltolower 事件 direction=\" + e.detail.direction)\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget,\n direction: e.detail.direction,\n } as ScrollEventTest, 'scrolltolower')\n },\n list_view_scroll(e : UniScrollEvent) {\n console.log(\"滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY}\")\n this.scrollDetailTest = e.detail\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget\n } as ScrollEventTest, 'scroll')\n },\n list_view_scrollend(e : UniScrollEvent) {\n console.log(\"滚动结束时触发\", e.detail)\n this.scrollEndDetailTest = e.detail\n this.checkEventTest({\n type: e.type,\n target: e.target,\n currentTarget: e.currentTarget\n } as ScrollEventTest, 'scrollend')\n },\n list_item_click() { console.log(\"list-item组件被点击时触发\") },\n list_item_touchstart() { console.log(\"手指触摸list-item组件动作开始\") },\n list_item_touchmove() { console.log(\"手指触摸list-item组件后移动\") },\n list_item_touchcancel() { console.log(\"手指触摸list-item组件动作被打断,如来电提醒,弹窗\") },\n list_item_touchend() { console.log(\"手指触摸list-item组件动作结束\") },\n list_item_tap() { console.log(\"手指触摸list-item组件后马上离开\") },\n list_item_longpress() { console.log(\"list-item组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\n change_refresher_triggered_boolean(checked : boolean) { this.refresher_triggered_boolean = checked },\n change_refresher_enabled_boolean(checked : boolean) { this.refresher_enabled_boolean = checked },\n change_scroll_with_animation_boolean(checked : boolean) { this.scroll_with_animation_boolean = checked },\n change_show_scrollbar_boolean(checked : boolean) { this.show_scrollbar_boolean = checked },\n change_bounces_boolean(checked : boolean) { this.bounces_boolean = checked },\n change_scroll_y_boolean(checked : boolean) {\n this.scroll_y_boolean = checked\n this.change_scroll_direction()\n },\n change_scroll_x_boolean(checked : boolean) {\n this.scroll_x_boolean = checked\n this.change_scroll_direction()\n },\n change_scroll_direction() {\n if (this.scroll_y_boolean && this.scroll_x_boolean || this.scroll_y_boolean) {\n this.scroll_direction = \"vertical\"\n } else if (!this.scroll_y_boolean && !this.scroll_x_boolean) {\n this.scroll_direction = \"none\"\n } else if (!this.scroll_y_boolean && this.scroll_x_boolean) {\n this.scroll_direction = \"horizontal\"\n }\n },\n confirm_upper_threshold_input(value : number) { this.upper_threshold_input = value },\n confirm_lower_threshold_input(value : number) { this.lower_threshold_input = value },\n confirm_scroll_top_input(value : number) { this.scroll_top_input = value },\n confirm_scroll_left_input(value : number) { this.scroll_left_input = value },\n confirm_refresher_background_input(value : string) { this.refresher_background_input = value },\n item_change_size_enum(index : number) { this.scrollIntoView = \"item---\" + index },\n // 自动化测试专用(由于事件event参数对象中存在循环引用,在ios端JSON.stringify报错,自动化测试无法page.data获取)\n checkEventTest(e : ScrollEventTest, eventName : String) {\n const isPass = e.type === eventName && e.target instanceof UniElement && e.currentTarget instanceof UniElement;\n const result = isPass ? `${eventName}:Success` : `${eventName}:Fail`;\n switch (eventName) {\n case 'scroll':\n this.isScrollTest = result\n break;\n case 'scrolltolower':\n this.isScrolltolowerTest = result + `-${e.direction}`\n break;\n case 'scrolltoupper':\n this.isScrolltoupperTest = result + `-${e.direction}`\n break;\n default:\n break;\n }\n },\n //自动化测试例专用\n check_scroll_height() : Boolean {\n var listElement = this.$refs[\"listview\"] as UniElement\n console.log(\"check_scroll_height--\" + listElement.scrollHeight)\n if (listElement.scrollHeight > 2000) {\n return true\n }\n return false\n },\n //自动化测试例专用\n check_scroll_width() : Boolean {\n var listElement = this.$refs[\"listview\"] as UniElement\n console.log(\"check_scroll_width\" + listElement.scrollWidth)\n if (listElement.scrollWidth > 2000) {\n return true\n }\n return false\n },\n change_refresher_style_boolean(checked : boolean) {\n if (checked) {\n this.refresher_default_style_input = \"none\"\n } else {\n this.refresher_default_style_input = \"black\"\n }\n }\n }\n }\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [list-item](list-item.md) | |\n| [sticky-header](sticky-header.md) | |\n| [sticky-section](sticky-section.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.list-view.list-view)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/list-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=list-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=list-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=list-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=list-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=list-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=list-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"flow-item":{"name":"## flow-item","description":"> 组件类型:UniFlowItemElement \n\n waterflow组件的唯一合法子组件。每个item","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.41 | 4.41 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | number | 0 | | 对应flow-item的类型 waterflow 将对同类型条目进行复用,所以合理的类型拆分,可以很好地提升 waterflow 性能 |","event":"","example":"","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.waterflow.flow-item)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=flow-item&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=flow-item&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=flow-item&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=flow-item&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=flow-item&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=flow-item)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=flow-item&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"waterflow":{"name":"## waterflow","description":"> 组件类型:UniWaterFlowElement \n\n 瀑布流组件","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.41 | 4.41 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| cross-axis-count | number | - | | - |\n| main-axis-gap | number | - | | - |\n| cross-axis-gap | number | - | | - |\n| padding | Array | - | | - |\n| associative-container | string | \"\" | | 关联的滚动容器 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| nested-scroll-view | | 嵌套滚动 |\n| bounces | boolean | true | | 控制是否回弹效果 |\n| upper-threshold | number | 50 | | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 |\n| lower-threshold | number | 50 | | 距底部/右边多远时(单位px),触发 scrolltolower 事件 |\n| scroll-top | number | 0 | | 设置竖向滚动条位置 |\n| show-scrollbar | boolean | true | | 控制是否出现滚动条 |\n| scroll-into-view | string([string.IDString](/uts/data-type.md#ide-string)) | - | | 值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素起始位置 |\n| scroll-with-animation | boolean | false | | 是否在设置滚动条位置时使用滚动动画,设置false没有滚动动画 |\n| refresher-enabled | boolean | false | | 开启下拉刷新,暂时不支持scroll-x = true横向刷新 |\n| refresher-threshold | number | 45 | | 设置下拉刷新阈值, 仅 refresher-default-style = 'none' 自定义样式下生效 |\n| refresher-max-drag-distance | number | - | | 设置下拉最大拖拽距离(单位px),默认是下拉刷新控件高度的2.5倍 |\n| refresher-default-style | string | \"black\" | | 设置下拉刷新默认样式,支持设置 black \\| white \\| none, none 表示不使用默认样式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| black | | 深颜色雪花样式 |\n@| white | | 浅白色雪花样式 |\n@| none | | 不使用默认样式 |\n| refresher-background | string([string.ColorString](/uts/data-type.md#ide-string)) | \"transparent\" | | 设置下拉刷新区域背景颜色,默认透明 |\n| refresher-triggered | boolean | false | | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\n| enable-back-to-top | boolean | false | | iOS点击顶部状态栏滚动条返回顶部,只支持竖向 |\n| custom-nested-scroll | boolean | false | | 子元素是否开启嵌套滚动 将滚动事件与父元素协商处理 |\n| @refresherpulling | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新控件被下拉 |\n| @refresherrefresh | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被触发 |\n| @refresherrestore | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被复位 |\n| @refresherabort | (event: [UniRefresherEvent](#unirefresherevent)) => void | - | | 下拉刷新被中止 |\n| @scrolltoupper | (event: [UniScrollToUpperEvent](#uniscrolltoupperevent)) => void | - | | 滚动到顶部/左边,会触发 scrolltoupper 事件 |\n| @scrolltolower | (event: [UniScrollToLowerEvent](#uniscrolltolowerevent)) => void | - | | 滚动到底部/右边,会触发 scrolltolower 事件 |\n| @scroll | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |\n| @scrollend | (event: [UniScrollEvent](#uniscrollevent)) => void | - | | 滚动结束时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} |","event":"\n### 事件\n#### UniRefresherEvent\n\n```mermaid\ngraph LR\n \nUniRefresherEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRefresherEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| dy | number | 是 | - | - | - |\n\n\n#### UniScrollToUpperEvent\n\n```mermaid\ngraph LR\n \nUniScrollToUpperEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToUpperEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 top 或 left |\n\n\n#### UniScrollToLowerEvent\n\n```mermaid\ngraph LR\n \nUniScrollToLowerEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollToLowerEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| direction | string | 是 | - | - | 滚动方向 bottom 或 right |\n\n\n#### UniScrollEvent\n\n```mermaid\ngraph LR\n \nUniScrollEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniScrollEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| scrollTop | number | 是 | - | - | 竖向滚动的距离 |\n@| scrollLeft | number | 是 | - | - | 横向滚动的距离 |\n@| scrollHeight | number | 是 | - | - | 滚动区域的高度 |\n@| scrollWidth | number | 是 | - | - | 滚动区域的宽度 |\n@| deltaY | number | 是 | - | - | 当次滚动事件竖向滚动量 |\n@| deltaX | number | 是 | - | - | 当次滚动事件横向滚动量 |\n\n","example":"","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [flow-item](flow-item.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.waterflow.waterflow)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=waterflow&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=waterflow&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=waterflow&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=waterflow&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=waterflow&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=waterflow)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=waterflow&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"nested-scroll-header":{"name":"## nested-scroll-header","description":"> 组件类型:UniNestedScrollHeaderElement \n\n scroll-view 嵌套模式场景中属于外层 scroll-view 的节点,仅支持作为 \\ 嵌套模式的直接子节点。不支持复数子节点,渲染时会取其第一个子节点来渲染","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.11 | 4.11 |\n","attribute":"","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/nested-scroll-header/nested-scroll-header.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/nested-scroll-header/nested-scroll-header\n```uvue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{key}}\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.nested-scroll.nested-scroll-header)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/nested-scroll-header.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=nested-scroll-header&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=nested-scroll-header&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=nested-scroll-header&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=nested-scroll-header&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=nested-scroll-header)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=nested-scroll-header&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"nested-scroll-body":{"name":"## nested-scroll-body","description":"> 组件类型:UniNestedScrollHeaderElement \n\n scroll-view 嵌套模式场景中属于嵌套内层 scroll-view 的父节点,仅支持作为 \\ 嵌套模式的直接子节点。不支持复数子节点,渲染时会取其第一个子节点来渲染","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.11 | 4.11 |\n","attribute":"","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/nested-scroll-body/nested-scroll-body.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/nested-scroll-body/nested-scroll-body\n```uvue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n nested-scroll-body\r\n \r\n \r\n \r\n \r\n \r\n {{key}}\r\n \r\n \r\n \r\n \r\n 不会渲染,因为 nested-scroll-body 只会渲染第一个子节点\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view-container.nested-scroll.nested-scroll-body)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/nested-scroll-body.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=nested-scroll-body&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=nested-scroll-body&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=nested-scroll-body&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=nested-scroll-body&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=nested-scroll-body)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=nested-scroll-body&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"icon":{"name":"## icon","description":"图标","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | icon的类型,有效值:success, success_no_circle, info, warn, waiting, cancel, download, search, clear |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| success | - | |\n@| success_no_circle | - | |\n@| warn | - | |\n@| waiting | - | |\n@| cancel | - | |\n@| download | - | |\n@| search | - | |\n@| clear | - | |\n| size | number | - | | icon的大小,单位px |\n| color | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | icon的颜色,同css的color |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.icon)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/icon.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/icon.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=icon&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=icon&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=icon&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=icon&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=icon)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=icon&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"text":{"name":"## text","description":"> 组件类型:[UniTextElement](/dom/unitextelement.md) \n\n 文本","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| selectable | boolean | false | | 文本是否可选 |\n| space | string | - | | 显示连续空格 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| ensp | | 中文字符空格一半大小 |\n@| emsp | | 中文字符空格大小 |\n@| nbsp | | 根据字体设置的空格大小 |\n| decode | boolean | false | | 是否解码 (app平台如需解析字符实体,需要配置为 true) |\n| user-select | boolean | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/text/text.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/text/text\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/text/text\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n {{ text }}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'text',\r\n texts: [\r\n 'HBuilderX,轻巧、极速,极客编辑器',\r\n 'uni-app x,终极跨平台方案',\r\n 'uniCloud,js serverless云服务',\r\n 'uts,大一统语言',\r\n 'uniMPSdk,让你的App具备小程序能力',\r\n 'uni-admin,开源、现成的全端管理后台',\r\n 'uni-id,开源、全端的账户中心',\r\n 'uni-pay,开源、云端一体、全平台的支付',\r\n 'uni-ai,聚合ai能力',\r\n 'uni-cms,开源、云端一体、全平台的内容管理平台',\r\n 'uni-im,开源、云端一体、全平台的im即时消息',\r\n 'uni统计,开源、完善、全平台的统计报表',\r\n '......'\r\n ] as string[],\r\n text: '',\r\n canAdd: true,\r\n canRemove: false,\r\n extraLine: [] as string[]\r\n }\r\n },\r\n methods: {\r\n add: function () {\r\n this.extraLine.push(this.texts[this.extraLine.length % 12]);\r\n this.text = this.extraLine.join('\\n');\r\n this.canAdd = this.extraLine.length < 12;\r\n this.canRemove = this.extraLine.length > 0;\r\n },\r\n remove: function () {\r\n if (this.extraLine.length > 0) {\r\n this.extraLine.pop();\r\n this.text = this.extraLine.join('\\n');\r\n this.canAdd = this.extraLine.length < 12;\r\n this.canRemove = this.extraLine.length > 0;\r\n }\r\n },\r\n textProps: function () {\r\n uni.navigateTo({\r\n url: '/pages/component/text/text-props'\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [text](text.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.text)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/text.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/text.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=text&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=text&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=text&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=text&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=text)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=text&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"rich-text":{"name":"## rich-text","description":"> 组件类型:UniRichTextElement \n\n 富文本。可渲染文字样式、图片、超链接。支持部分HTML标签","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| nodes | array \\\\| string | - | | 节点列表 \\| HTML String |\n| selectable | boolean | false | | 文本是否可选 |\n| @itemclick | (event: [UniRichTextItemClickEvent](#unirichtextitemclickevent)) => void | - | | 拦截点击事件(只支持 a、img标签),返回img标签的src属性或a标签的href属性。event.detail={ src \\| href } |\n| space | string | - | | *(string)*
显示连续空格 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| ensp | | |\n@| emsp | | |\n@| nbsp | | |\n| user-select | boolean | - | | - |","event":"\n### 事件\n#### UniRichTextItemClickEvent\n\n```mermaid\ngraph LR\n \nUniRichTextItemClickEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniRichTextItemClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniRichTextItemClickEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| src | string | 否 | - | - | \\图片链接 |\n@| href | string | 否 | - | - | \\超链接 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/rich-text/rich-text.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/rich-text/rich-text\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/rich-text/rich-text\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n selectable\r\n \r\n \r\n \r\n \r\n \r\n rich-text-parent\r\n {{richTextStr}}\r\n \r\n \n \n \n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n text: \"hello uni-app x!
uni-app x,终极跨平台方案\",\r\n richTextHeight: 0,\r\n richTextElement: null as UniElement | null,\r\n // 自动化测试\r\n autoTest: false,\r\n testNodes: '',\r\n isItemClickTrigger: false,\r\n richTextStr: false\r\n }\r\n },\r\n onReady() {\r\n this.richTextElement = uni.getElementById('richtext') as UniElement\r\n setTimeout(() => {\r\n this.updateRichTextHeight()\r\n }, 2500)\r\n },\r\n methods: {\r\n changeText() {\r\n if (this.text === \"hello uni-app x!
uni-app x,终极跨平台方案\") {\r\n this.text = \"hello uni-app x!
uni-app x,终极跨平台方案
\"\r\n } else {\r\n this.text = \"hello uni-app x!
uni-app x,终极跨平台方案\"\r\n }\r\n setTimeout(() => {\r\n this.updateRichTextHeight()\r\n }, 200)\r\n },\r\n updateRichTextHeight() {\r\n if (this.richTextElement != null) {\r\n const elRect = this.richTextElement!.getBoundingClientRect()\r\n this.richTextHeight = elRect.height\r\n console.log('richTextHeight:', this.richTextHeight)\r\n }\r\n },\r\n // 自动化测试\r\n itemClickForTest(_ : RichTextItemClickEvent) {\r\n this.isItemClickTrigger = true;\r\n },\r\n getBoundingClientRectForTest() : DOMRect {\r\n return uni.getElementById('test-rich-text')?.getBoundingClientRect()!;\r\n },\r\n getWindowInfoForTest() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n richTextParentClick() {\r\n this.richTextStr = true;\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.rich-text)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/rich-text.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/rich-text.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=rich-text&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=rich-text&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=rich-text&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=rich-text&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=rich-text)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=rich-text&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"progress":{"name":"## progress","description":"> 组件类型:UniProgressElement \n\n 进度条","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| duration | number | 30 | | 进度增加1%所需毫秒数 |\n| percent | number | 0 | | 百分比0~100 |\n| show-info | boolean | false | | 在进度条右侧显示百分比 |\n| border-radius | number | 0 | | 圆角大小 |\n| font-size | number | 16 | | 右侧百分比字体大小 |\n| stroke-width | number | 6 | | 进度条线的宽度,单位px |\n| activeColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#09BB07\" | | 已选择的进度条的颜色 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#EBEBEB\" | | 未选择的进度条的颜色 |\n| active | boolean | false | | 进度条从左往右的动画 |\n| active-mode | string | \"backwards\" | | backwards: 动画从头播;forwards:动画从上次结束点接着播 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| backwards | | 动画从头播 |\n@| forwards | | 动画从上次结束点接着播 |\n| @activeend | (event: [UniProgressActiveendEvent](#uniprogressactiveendevent)) => void | - | | 动画完成事件 |\n| color | string | - | | - |","event":"\n### 事件\n#### UniProgressActiveendEvent\n\n```mermaid\ngraph LR\n \nUniProgressActiveendEvent -- Extends --> UniCustomEvent<UniProgressActiveendEventDetail>\n style UniCustomEvent<UniProgressActiveendEventDetail> color:#42b983\n click UniCustomEvent<UniProgressActiveendEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniProgressActiveendEventDetail\n\n\n###### UniProgressActiveendEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| curPercent | number | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/progress/progress.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/progress/progress\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/progress/progress\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { state, setEventCallbackNum } from '@/store/index.uts'\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n title: 'progress',\r\n pgList: [0, 0, 0, 0] as number[],\r\n curPercent: 0,\r\n showInfo: true,\r\n borderRadius: 0,\r\n fontSize: 16,\r\n strokeWidth: 3,\r\n backgroundColor: '#EBEBEB',\r\n\r\n // 组件属性 autotest\r\n active_boolean: false,\r\n show_info_boolean: false,\r\n duration_input: 30,\r\n percent_input: 0,\r\n stroke_width_input: 6,\r\n activeColor_input: \"#09BB07\",\r\n backgroundColor_input: \"#EBEBEB\",\r\n active_mode_enum: [{ \"value\": 0, \"name\": \"backwards\" }, { \"value\": 1, \"name\": \"forwards\" }] as ItemType[],\r\n active_mode_enum_current: 0\r\n }\r\n },\r\n methods: {\r\n // 自动化测试\r\n getEventCallbackNum() : number {\r\n return state.eventCallbackNum\r\n },\r\n // 自动化测试\r\n setEventCallbackNum(num : number) {\r\n setEventCallbackNum(num)\r\n },\r\n\r\n setProgress() {\r\n this.pgList = [20, 40, 60, 80] as number[]\r\n },\r\n clearProgress() {\r\n this.pgList = [0, 0, 0, 0] as number[]\r\n },\r\n activeend(e : UniProgressActiveendEvent) {\r\n // 自动化测试\r\n if ((e.target?.tagName ?? '').includes('PROGRESS')) {\r\n this.setEventCallbackNum(state.eventCallbackNum + 1)\r\n }\r\n if (e.type === 'activeend') {\r\n this.setEventCallbackNum(state.eventCallbackNum + 2)\r\n }\r\n this.curPercent = e.detail.curPercent\r\n },\r\n progress_touchstart() { console.log(\"手指触摸动作开始\") },\r\n progress_touchmove() { console.log(\"手指触摸后移动\") },\r\n progress_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n progress_touchend() { console.log(\"手指触摸动作结束\") },\r\n progress_tap() { console.log(\"手指触摸后马上离开\") },\r\n change_active_boolean(checked : boolean) { this.active_boolean = checked },\r\n change_show_info_boolean(checked : boolean) { this.show_info_boolean = checked },\r\n confirm_duration_input(value : number) { this.duration_input = value },\r\n confirm_percent_input(value : number) { this.percent_input = value },\r\n confirm_stroke_width_input(value : number) { this.stroke_width_input = value },\r\n confirm_activeColor_input(value : string) { this.activeColor_input = value },\r\n confirm_backgroundColor_input(value : string) { this.backgroundColor_input = value },\r\n radio_change_active_mode_enum(checked : number) { this.active_mode_enum_current = checked }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.progress)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/progress.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/progress.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=progress&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=progress&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=progress&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=progress&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=progress)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=progress&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"native-view":{"name":"## native-view","description":"> 组件类型:[UniNativeViewElement](/dom/uninativeviewelement.md) \n\n 自定义原生View组件","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.31 | 4.31 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| @init | (event: [UniNativeViewInitEvent](#uninativeviewinitevent)) => void | - | | native-view初始化时回调,event.detail = { element: 'native-view元素实例对象'} |","event":"\n### 事件\n#### UniNativeViewInitEvent\nnative-view 组件 init事件event\n```mermaid\ngraph LR\n \nUniNativeViewInitEvent -- Extends --> UniCustomEvent<UniNativeViewInitEventDetail>\n style UniCustomEvent<UniNativeViewInitEventDetail> color:#42b983\n click UniCustomEvent<UniNativeViewInitEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniNativeViewInitEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniNativeViewInitEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| element | [UniNativeViewElement](/dom/uninativeviewelement.md) | 是 | - | - | - |\n| type | string | 是 | - | - | - |\n\n\n##### UniNativeViewInitEventDetail\n\n\n###### UniNativeViewInitEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| element | [UniNativeViewElement](/dom/uninativeviewelement.md) | 是 | - | - | - |\n\n","example":"### 示例\n#### native-view\n展示使用 native-view 封装的原生view的UTS插件-标准模式组件\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/native-view/native-view.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/native-view/native-view\n```uvue\n\r\n \n 说明:如果本地无 uts 插件编译环境请提交打包自定义基座查看效果\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::\n#### native-button\n通过 native-view 绑定原生 button 实现的UTS插件-标准模式组件\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//uni_modules/native-button/components/native-button/native-button.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n```uvue\n\r\n\t\r\n\r\n\r\n\n```","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.basic-content.native-view)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=native-view&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=native-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=native-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=native-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=native-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=native-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=native-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"button":{"name":"## button","description":"> 组件类型:UniButtonElement \n\n 按钮","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | false | | 是否禁用 |\n| hover-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"button-hover\" | | 指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果 |\n| hover-stop-propagation | boolean | - | | 指定是否阻止本节点的祖先节点出现点击态 |\n| hover-start-time | number | 20 | | 按住后多久出现点击态,单位毫秒 |\n| hover-stay-time | number | 70 | | 手指松开后点击态保留时间,单位毫秒 |\n| size | string | \"default\" | | 按钮的大小 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| default | | 默认大小 |\n@| mini | | 小尺寸 |\n| type | string | \"default\" | | 按钮的样式类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| default | | 白色 |\n@| primary | | 蓝色 |\n@| warn | | 红色 |\n| plain | boolean | false | | 按钮是否镂空,背景色透明 |\n| loading | boolean | - | | 名称前是否带 loading 图标 |\n| form-type | string | - | | 用于 form 组件,点击分别会触发 form 组件的 submit/reset 事件 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| submit | | 提交表单 |\n@| reset | | 重置表单 |\n| open-type | string | - | | 开放能力 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| agreePrivacyAuthorization | | 用户同意隐私协议按钮。用户点击一次此按钮后,所有已声明过的隐私接口可以正常调用。 |\n@| feedback | | 打开“意见反馈”页面,用户可提交反馈内容并上传日志 |\n@| share | | 触发用户转发 |\n@| getUserInfo | | 获取用户信息,可以从@getuserinfo回调中获取到用户信息 |\n@| contact | | 打开客服会话,如果用户在会话中点击消息卡片后返回应用,可以从 @contact 回调中获得具体信息 |\n@| getPhoneNumber | | 获取用户手机号,可以从@getphonenumber回调中获取到用户信息 |\n@| launchApp | | 打开APP,可以通过app-parameter属性设定向APP传的参数 |\n@| openSetting | | 打开授权设置页 |\n@| chooseAvatar | | 获取用户头像,可以从@chooseavatar回调中获取到头像信息 |\n@| getAuthorize | | 支持小程序授权 |\n@| lifestyle | | 关注生活号 |\n@| contactShare | | 分享到通讯录好友 |\n@| openGroupProfile | | 呼起QQ群资料卡页面,可以通过group-id属性设定需要打开的群资料卡的群号,同时manifest.json中必须配置groupIdList |\n@| openGuildProfile | | 呼起频道页面,可以通过guild-id属性设定需要打开的频道ID |\n@| openPublicProfile | | 打开公众号资料卡,可以通过public-id属性设定需要打开的公众号资料卡的号码,同时manifest.json中必须配置publicIdList |\n@| shareMessageToFriend | | 在自定义开放数据域组件中,向指定好友发起分享据 |\n@| addFriend | | 添加好友,对方需要通过该小程序进行授权,允许被加好友后才能调用成功用户授权 |\n@| addColorSign | | 添加彩签,点击后添加状态有用户提示,无回调 |\n@| addGroupApp | | 添加群应用(只有管理员或群主有权操作),添加后给button绑定@addgroupapp事件接收回调数据 |\n@| addToFavorites | | 收藏当前页面,点击按钮后会触发Page.onAddToFavorites方法 |\n@| chooseAddress | | 选择用户收货地址,可以从@chooseaddress回调中获取到用户选择的地址信息 |\n@| chooseInvoiceTitle | | 选择用户发票抬头,可以从@chooseinvoicetitle回调中获取到用户选择发票抬头信息 |\n@| login | | 登录,可以从@login回调中确认是否登录成功 |\n@| subscribe | | 订阅类模板消息,需要用户授权才可发送 |\n@| favorite | | 触发用户收藏 |\n@| watchLater | | 触发用户稍后再看 |\n@| openProfile | | 触发打开用户主页 |\n@| liveActivity | | |\n@| getRealtimePhoneNumber | | |\n| lang | string | - | | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| en | | |\n@| zh_CN | | |\n@| zh_TW | | |\n| session-from | string | - | | 会话来源 |\n| send-message-title | string | - | | 会话内消息卡片标题 |\n| send-message-path | string | - | | 会话内消息卡片点击跳转应用路径 |\n| send-message-img | string | - | | 会话内消息卡片图片 |\n| show-message-card | boolean | - | | 显示会话内消息卡片 |\n| app-parameter | string | - | | 打开 APP 时,向 APP 传递的参数 |\n| group-id | string | - | | 打开群资料卡时,传递的群号 |\n| guild-id | string | - | | 打开频道页面时,传递的频道号 |\n| public-id | string | - | | 打开公众号资料卡时,传递的号码 |\n| @getuserinfo | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与uni.getUserInfo返回的一致 |\n| @contact | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 客服消息回调 |\n| @getphonenumber | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 获取用户手机号回调 |\n| @error | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当使用开放能力时,发生错误的回调 |\n| @opensetting | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 在打开授权设置页后回调 |\n| @launchapp | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 打开 APP 成功的回调 |\n| @chooseavatar | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 获取用户头像回调 |\n| @chooseaddress | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 调起用户编辑并选择收货地址的回调 |\n| @chooseinvoicetitle | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 用户选择发票抬头的回调 |\n| @addgroupapp | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 添加群应用的回调 |\n| @subscribe | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 订阅消息授权回调 |\n| @login | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 登录回调 |\n| phone-number-no-quota-toast | boolean | - | | - |\n| createliveactivity | eventhandle | - | | - |\n| @getrealtimephonenumber | eventhandle | - | | - |\n| @agreeprivacyauthorization | eventhandle | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/button/button.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/button/button\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/button/button\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \n \n \n \n \r\n \r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n plain_boolean: false,\r\n disabled_boolean: false,\r\n default_style: false,\r\n size_enum: [{ \"value\": 0, \"name\": \"default\" }, { \"value\": 1, \"name\": \"mini\" }] as ItemType[],\r\n size_enum_current: 0,\r\n type_enum: [{ \"value\": 0, \"name\": \"default\" }, { \"value\": 1, \"name\": \"primary\" }, { \"value\": 2, \"name\": \"warn\" }] as ItemType[],\r\n type_enum_current: 0,\r\n count: 0,\r\n text: ''\r\n }\r\n },\r\n onReady() {\r\n this.text = 'uni-app-x'\r\n },\r\n methods: {\r\n button_click() {\r\n console.log(\"组件被点击时触发\")\r\n this.count++\r\n },\r\n button_touchstart() { console.log(\"手指触摸动作开始\") },\r\n button_touchmove() { console.log(\"手指触摸后移动\") },\r\n button_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n button_touchend() { console.log(\"手指触摸动作结束\") },\r\n button_tap() { console.log(\"手指触摸后马上离开\") },\r\n button_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n change_plain_boolean(checked : boolean) { this.plain_boolean = checked },\r\n change_disabled_boolean(checked : boolean) { this.disabled_boolean = checked },\r\n change_default_style(checked : boolean) { this.default_style = checked },\r\n radio_change_size_enum(checked : number) { this.size_enum_current = checked },\r\n radio_change_type_enum(checked : number) { this.type_enum_current = checked },\r\n confirm_text_input(value : string) { this.text = value },\r\n navigateToChild() {\r\n uni.navigateTo({\r\n url: 'buttonstatus',\r\n })\r\n },\n openPrivacyDialog() {\n uni.openDialogPage({\n url: '/pages/component/button/privacy',\n })\n },\r\n //用于自动化测试\r\n checkUniButtonElement() : boolean {\r\n const button = uni.getElementById(\"testButton\")\r\n if (button != null && button instanceof UniButtonElement) {\r\n return true\r\n }\r\n return false\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.button)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/button.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/button.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=button&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=button&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=button&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=button&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=button)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=button&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"checkbox":{"name":"## checkbox","description":"> 组件类型:UniCheckboxElement \n\n 多选项。在1组check-group中可选择多个","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | false | | 是否禁用 |\n| value | string | - | | checkbox 标识,选中时触发 checkbox-group 的 change 事件,并携带 checkbox 的 value |\n| checked | boolean | false | | 当前是否选中,可用来设置默认选中 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | checkbox默认的背景颜色 |\n| borderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#d1d1d1\" | | checkbox默认的边框颜色 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | checkbox选中时的背景颜色 |\n| activeBorderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#d1d1d1\" | | checkbox选中时的边框颜色 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | checkbox的图标颜色,优先级大于color属性 |\n| ~~iconColor~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | checkbox的图标颜色,优先级大于color属性 (使用foreColor替代) |\n| ~~color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | checkbox的颜色 (使用foreColor替代) |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/checkbox/checkbox.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/checkbox/checkbox\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/checkbox/checkbox\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n uni-app-x\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n 默认样式 \r\n \r\n \r\n \r\n 选中\r\n \r\n {{ text }}\r\n 禁用\r\n \r\n {{ wrapText }}\r\n \r\n \r\n \r\n \r\n 不同颜色和尺寸的checkbox \r\n \r\n \r\n \r\n 选中\r\n \r\n 未选中\r\n \r\n \r\n \r\n\r\n \r\n \r\n 推荐展示样式 \r\n \r\n \r\n \r\n \r\n \r\n {{ item.name }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n type ItemType = {\r\n value : string\r\n name : string\r\n checked : boolean\r\n }\r\n export default {\r\n data() {\r\n return {\r\n items: [\r\n {\r\n value: 'CHN',\r\n name: '中国',\r\n checked: true,\r\n },\r\n {\r\n value: 'USA',\r\n name: '美国',\r\n checked: false,\r\n },\r\n {\r\n value: 'BRA',\r\n name: '巴西',\r\n checked: false,\r\n },\r\n {\r\n value: 'JPN',\r\n name: '日本',\r\n checked: false,\r\n },\r\n {\r\n value: 'ENG',\r\n name: '英国',\r\n checked: false,\r\n },\r\n {\r\n value: 'FRA',\r\n name: '法国',\r\n checked: false,\r\n },\r\n ] as ItemType[],\r\n testEvent: false,\r\n text: '未选中',\r\n wrapText: 'uni-app x,终极跨平台方案\\nuts,大一统语言',\r\n value: [] as string[],\r\n disabled: true,\r\n checked: true,\r\n color: '#007aff',\r\n iconColor: '#211cfe',\r\n foreColor: '#ff0000',\r\n // 组件属性 autotest\r\n checked_boolean: false,\r\n disabled_boolean: false,\r\n color_input: \"#007aff\",\r\n backgroundColor_input: \"#ffffff\",\r\n borderColor_input: \"#d1d1d1\",\r\n activeBackgroundColor_input: \"#ffffff\",\r\n activeBorderColor_input: \"#d1d1d1\",\r\n iconColor_input: \"#007aff\",\r\n foreColor_input: '#ff0000'\r\n }\r\n },\r\n methods: {\r\n\r\n checkboxChange: function (e : UniCheckboxGroupChangeEvent) {\r\n // 自动化测试\r\n if ((e.target?.tagName ?? '') == 'CHECKBOX-GROUP' && e.type === 'change') {\r\n this.testEvent = true\r\n }\r\n\r\n const selectedNames : string[] = []\r\n this.items.forEach((item) => {\r\n if (e.detail.value.includes(item.value)) {\r\n selectedNames.push(item.name)\r\n }\r\n })\r\n uni.showToast({\r\n icon: 'none',\r\n title: '当前选中:' + selectedNames.join(','),\r\n })\r\n },\r\n testChange: function (e : UniCheckboxGroupChangeEvent) {\r\n this.value = e.detail.value\r\n },\r\n checkbox_click() { console.log(\"组件被点击时触发\") },\r\n checkbox_touchstart() { console.log(\"手指触摸动作开始\") },\r\n checkbox_touchmove() { console.log(\"手指触摸后移动\") },\r\n checkbox_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n checkbox_touchend() { console.log(\"手指触摸动作结束\") },\r\n checkbox_tap() { console.log(\"手指触摸后马上离开\") },\r\n checkbox_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n change_checked_boolean(checked : boolean) { this.checked_boolean = checked },\r\n change_disabled_boolean(checked : boolean) { this.disabled_boolean = checked },\r\n confirm_color_input(value : string) { this.color_input = value },\r\n confirm_backgroundColor_input(value : string) { this.backgroundColor_input = value },\r\n confirm_borderColor_input(value : string) { this.borderColor_input = value },\r\n confirm_activeBackgroundColor_input(value : string) { this.activeBackgroundColor_input = value },\r\n confirm_activeBorderColor_input(value : string) { this.activeBorderColor_input = value },\r\n confirm_iconColor_input(value : string) { this.iconColor_input = value },\r\n confirm_foreColor_input(value : string) { this.foreColor_input = value }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.checkbox.checkbox)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/checkbox.html#checkbox)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/checkbox.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=checkbox&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=checkbox&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=checkbox&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=checkbox&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=checkbox)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=checkbox&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"checkbox-group":{"name":"## checkbox-group","description":"> 组件类型:UniCheckboxGroupElement \n\n 多选框组","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| @change | (event: [UniCheckboxGroupChangeEvent](#unicheckboxgroupchangeevent)) => void | - | | checkbox-group中选中项发生改变是触发 change 事件,detail = {value:\\[选中的checkbox的value的数组] |","event":"\n### 事件\n#### UniCheckboxGroupChangeEvent\n\n```mermaid\ngraph LR\n \nUniCheckboxGroupChangeEvent -- Extends --> UniCustomEvent<UniCheckboxGroupChangeEventDetail>\n style UniCustomEvent<UniCheckboxGroupChangeEventDetail> color:#42b983\n click UniCustomEvent<UniCheckboxGroupChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniCheckboxGroupChangeEventDetail\n\n\n###### UniCheckboxGroupChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | Array\\ | 是 | - | - | - |\n\n","example":"","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [checkbox](checkbox.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.checkbox.checkbox-group)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/checkbox.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/checkbox-group.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=checkbox-group&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=checkbox-group&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=checkbox-group&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=checkbox-group&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=checkbox-group)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=checkbox-group&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"form":{"name":"## form","description":"> 组件类型:UniFormElement \n\n 表单","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.97 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | - | | 是否禁用 |\n| report-submit | boolean | - | | 是否返回 formId 用于发送模板消息 |\n| @submit | (event: [UniFormSubmitEvent](#uniformsubmitevent)) => void | - | | 携带 form 中的数据触发 submit 事件,event.detail = {value : {'name': 'value'}} |\n| @reset | (event: [UniFormResetEvent](#uniformresetevent)) => void | - | | 表单重置时会触发 reset 事件 |\n| report-submit-timeout | number | - | | - |","event":"\n### 事件\n#### UniFormSubmitEvent\n\n```mermaid\ngraph LR\n \nUniFormSubmitEvent -- Extends --> UniCustomEvent<UniFormSubmitEventDetail>\n style UniCustomEvent<UniFormSubmitEventDetail> color:#42b983\n click UniCustomEvent<UniFormSubmitEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniFormSubmitEventDetail\n\n\n###### UniFormSubmitEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | UTSJSONObject | 是 | - | - | - |\n\n\n#### UniFormResetEvent\n\n```mermaid\ngraph LR\n \nUniFormResetEvent -- Extends --> UniCustomEvent<UniFormResetEventDetail>\n style UniCustomEvent<UniFormResetEventDetail> color:#42b983\n click UniCustomEvent<UniFormResetEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/form/form.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/form/form\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/form/form\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n 提交的表单数据\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n nickname: '',\r\n gender: '0',\r\n age: 18,\r\n loves: ['0'],\r\n switch: true,\r\n comment: '',\r\n formData: {} as UTSJSONObject,\r\n // 仅测试\r\n testVerifySubmit: false,\r\n testVerifyReset: false,\r\n }\r\n },\r\n computed: {\r\n formDataText() : string {\r\n return JSON.stringify(this.formData)\r\n }\r\n },\r\n methods: {\r\n onFormSubmit: function (e : UniFormSubmitEvent) {\r\n this.formData = e.detail.value\r\n\r\n // 仅测试\r\n this.testVerifySubmit = (e.type == 'submit' && (e.target?.tagName ?? '') == \"FORM\")\r\n },\r\n onFormReset: function (e : UniFormResetEvent) {\r\n this.formData = {}\r\n\r\n // 仅测试\r\n this.testVerifyReset = (e.type == 'reset' && (e.target?.tagName ?? '') == \"FORM\")\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.form)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/form.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/form.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=form&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=form&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=form&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=form&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=form)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=form&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"input":{"name":"## input","description":"> 组件类型:[UniInputElement](/dom/uniinputelement.md) \n\n 输入框","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| disabled | boolean | false | | 是否禁用 |\n| value | string | \"\" | | 输入框的初始内容 |\n| type | text \\| number \\| idcard \\| digit \\| tel \\| safe-password \\| nickname | \"text\" | | input的类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| text | | 文本输入键盘 |\n@| number | | 数字输入键盘 |\n@| idcard | | 身份证输入键盘 |\n@| digit | | 带小数点数字输入键盘 |\n@| tel | | 电话输入键盘 |\n@| safe-password | | 密码安全输入键盘 |\n@| nickname | | 昵称输入键盘 |\n| password | boolean | false | | 是否是密码类型 |\n| placeholder | string | \"\" | | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | | 指定 placeholder 的样式,目前仅支持color,font-size和font-weight |\n| placeholder-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"\" | | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | \"不限制长度\" | | 最大输入长度,0和正数为合法值,非法值的时候不限制最大长度 |\n| cursor-spacing | number | 0 | | 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 |\n| cursor-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"\" | | 指定光标颜色 |\n| auto-focus | boolean | false | | 自动获取焦点,与`focus`属性对比,此属性只会首次生效。 |\n| focus | boolean | false | | 获取焦点 |\n| confirm-type | send \\| search \\| next \\| go \\| done | \"done\" | | 设置键盘右下角按钮的文字,仅在 type为text 时生效。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| send | | 发送 |\n@| search | | 搜索 |\n@| next | | 下一个 |\n@| go | | 前往 |\n@| done | | 完成 |\n| always-embed | boolean | - | | 强制 input 处于同层状态,默认 focus 时 input 会切到非同层状态 (仅在 iOS 下生效) |\n| confirm-hold | boolean | false | | 点击键盘右下角按钮时是否保持键盘不收起 |\n| cursor | number | 0 | | 指定focus时的光标位置 |\n| selection-start | number | -1 | | 光标起始位置,自动聚集时有效,需与selection-end搭配使用 |\n| selection-end | number | -1 | | 光标结束位置,自动聚集时有效,需与selection-satrt搭配使用 |\n| adjust-position | boolean | true | | 键盘弹起时,是否自动上推页面 |\n| text-content-type | string | - | | 文本区域的语义,根据类型自动填充 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| oneTimeCode | | 一次性验证码 |\n| hold-keyboard | boolean | false | | focus时,点击页面的时候不收起键盘 |\n| safe-password-cert-path | string | - | | 安全键盘加密公钥的路径,只支持包内路径 |\n| safe-password-length | number | - | | 安全键盘输入密码长度 |\n| safe-password-time-stamp | number | - | | 安全键盘加密时间戳 |\n| safe-password-nonce | string | - | | 安全键盘加密盐值 |\n| safe-password-salt | string | - | | 安全键盘计算 hash 盐值,若指定custom-hash 则无效 |\n| safe-password-custom-hash | string | - | | 安全键盘计算 hash 的算法表达式 |\n| random-number | boolean | - | | 当 type 为 number, digit, idcard 数字键盘是否随机排列 |\n| controlled | boolean | - | | 是否为受控组件。为 true 时,value 内容会完全受 setData 控制 |\n| always-system | boolean | - | | 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效 |\n| inputmode | none \\| text \\| decimal \\| numeric \\| tel \\| search \\| email \\| url | \"text\" | | 是一个枚举属性,它提供了用户在编辑元素或其内容时可能输入的数据类型的提示。在符合条件的高版本webview里,uni-app的 web 和 app-vue 平台中可使用本属性。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 无虚拟键盘。在应用程序或者站点需要实现自己的键盘输入控件时很有用。 |\n@| text | | 使用用户本地区域设置的标准文本输入键盘。 |\n@| decimal | | 小数输入键盘,包含数字和分隔符(通常是“ . ”或者“ , ”),设备可能也可能不显示减号键。 |\n@| numeric | | 数字输入键盘,所需要的就是 0 到 9 的数字,设备可能也可能不显示减号键。 |\n@| tel | | 电话输入键盘,包含 0 到 9 的数字、星号(*)和井号(#)键。表单输入里面的电话输入通常应该使用 \\ 。 |\n@| search | | 为搜索输入优化的虚拟键盘,比如,返回键可能被重新标记为“搜索”,也可能还有其他的优化。 |\n@| email | | 为邮件地址输入优化的虚拟键盘,通常包含\"@\"符号和其他优化。表单里面的邮件地址输入应该使用 \\ 。 |\n@| url | | 为网址输入优化的虚拟键盘,比如,“/”键会更加明显、历史记录访问等。表单里面的网址输入通常应该使用 \\ 。 |\n| @input | (event: [UniInputEvent](#uniinputevent)) => void | - | | 当键盘输入时,触发input事件,event.detail = {value, cursor},处理函数可以直接 return 一个字符串,将替换输入框的内容。 |\n| @focus | (event: [UniInputFocusEvent](#uniinputfocusevent)) => void | - | | 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 |\n| @blur | (event: [UniInputBlurEvent](#uniinputblurevent)) => void | - | | 输入框失去焦点时触发,event.detail = {value: value} |\n| @keyboardheightchange | (event: [UniInputKeyboardHeightChangeEvent](#uniinputkeyboardheightchangeevent)) => void | - | | 键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration} |\n| @confirm | (event: [UniInputConfirmEvent](#uniinputconfirmevent)) => void | - | | 点击完成按钮时触发,event.detail = {value: value} |\n| @nicknamereview | eventhandle | - | | - |","event":"\n### 事件\n#### UniInputEvent\n\n```mermaid\ngraph LR\n \nUniInputEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 光标的位置 |\n@| keyCode | number | 是 | - | - | 输入字符的Unicode值 |\n\n\n#### UniInputFocusEvent\n\n```mermaid\ngraph LR\n \nUniInputFocusEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputFocusEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | | 键盘高度 |\n@| value | string | 是 | - | - | 输入框内容 |\n\n\n#### UniInputBlurEvent\n\n```mermaid\ngraph LR\n \nUniInputBlurEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputBlurEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 选择区域的起始位置 |\n\n\n#### UniInputKeyboardHeightChangeEvent\n\n```mermaid\ngraph LR\n \nUniInputKeyboardHeightChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputKeyboardHeightChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | - | 键盘高度 |\n@| duration | number | 是 | - | - | 持续时间 |\n\n\n#### UniInputConfirmEvent\n\n```mermaid\ngraph LR\n \nUniInputConfirmEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputConfirmEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/input/input.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/input/input\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/input/input\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 设置输入框的初始内容\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n type取值(不同输入法表现可能不一致)\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 密码输入框\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 无value设置的密码输入框\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 占位符样式\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置禁用输入框\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置最大输入长度\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置光标与键盘的距离\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 自动获取焦点\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n confirm-type取值(不同输入法表现可能不一致)\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 点击键盘右下角按钮时保持键盘不收起\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置输入框聚焦时光标的位置(点这里)\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置输入框聚焦时光标的起始位置和结束位置(点这里)\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置光标颜色为红色\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 键盘弹起时,自动上推页面\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置hold-keyboard\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n input事件\r\n {{\r\n inputEventDetail\r\n }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n focus事件和blur事件\r\n {{\r\n focusAndBlurEventDetail\r\n }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n confirm事件\r\n {{\r\n confirmEventDetail\r\n }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n keyboardheightchange事件\r\n {{ keyboardHeightChangeEventDetail }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 带清除按钮的输入框\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 可查看密码的输入框\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 同时存在 v-model 和 value\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 设置adjust-position\r\n \r\n \r\n \r\n \r\n \r\n \n\n \n \n 输入内容的同步更新UI\n \n {{syncDisplayValue}}\n \n \n \n \n\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'input',\r\n showClearIcon: false,\r\n inputClearValue: '',\r\n showPassword: true,\r\n cursor: -1,\r\n cursor_color: \"#3393E2\",\r\n selectionStart: -1,\r\n selectionEnd: -1,\r\n inputEventDetail: '',\r\n focusAndBlurEventDetail: '',\r\n confirmEventDetail: '',\r\n keyboardHeightChangeEventDetail: '',\r\n focus: true,\r\n inputPassword: true,\r\n inputTypeTel: \"tel\",\r\n inputPlaceHolderStyle: \"color:red\",\r\n inputPlaceHolderClass: \"uni-input-placeholder-class\" as string.ClassString,\r\n inputMaxLengthValue: \"\",\r\n onMaxLengthInputValue: \"\",\r\n inputMaxLengthFocus: false,\r\n inputPasswordValue: \"cipher\",\r\n inputFocusKeyBoardChangeValue: true,\r\n holdKeyboard: false,\r\n keyboardHeight: 0,\r\n focusedForKeyboardHeightChangeTest: false,\r\n demoValue: '123',\r\n adjustPosition: false,\n syncDisplayValue: ''\r\n }\r\n },\r\n methods: {\r\n inputFocusKeyBoardChange(e : UniInputKeyboardHeightChangeEvent) {\r\n this.inputFocusKeyBoardChangeValue = e.detail.height > 50\r\n },\r\n onMaxLengthInput(event : UniInputEvent) {\r\n this.onMaxLengthInputValue = event.detail.value\r\n },\r\n setCursor: function (cursor : number) {\r\n (this.$refs['input'] as UniInputElement).focus();\r\n this.cursor = cursor;\r\n },\r\n onCursorBlurChange() {\r\n this.cursor = 0\r\n },\r\n setSelection: function (selectionStart : number, selectionEnd : number) {\r\n (this.$refs['input2'] as UniInputElement).focus();\r\n this.selectionStart = selectionStart;\r\n this.selectionEnd = selectionEnd;\r\n },\r\n onSelectionBlurChange() {\r\n this.selectionEnd = 0;\r\n },\r\n clearInput: function (event : UniInputEvent) {\r\n this.inputClearValue = event.detail.value\r\n if (event.detail.value.length > 0) {\r\n this.showClearIcon = true\r\n } else {\r\n this.showClearIcon = false\r\n }\r\n },\r\n clearIcon: function () {\r\n this.inputClearValue = ''\r\n this.showClearIcon = false\r\n },\r\n changePassword: function () {\r\n this.showPassword = !this.showPassword\r\n },\r\n onInput: function (event : UniInputEvent) {\r\n console.log(\"键盘输入\", JSON.stringify(event.detail));\r\n this.inputEventDetail = JSON.stringify(event.detail)\r\n },\r\n onFocus: function (event : UniInputFocusEvent) {\r\n console.log(\"输入框聚焦\", JSON.stringify(event.detail));\r\n this.focusAndBlurEventDetail = JSON.stringify(event.detail);\r\n },\r\n onBlur: function (event : UniInputBlurEvent) {\r\n console.log(\"输入框失去焦点\", JSON.stringify(event.detail));\r\n this.focusAndBlurEventDetail = JSON.stringify(event.detail);\r\n },\r\n onConfirm: function (event : UniInputConfirmEvent) {\r\n console.log(\"点击完成按钮\", JSON.stringify(event.detail));\r\n this.confirmEventDetail = JSON.stringify(event.detail);\r\n },\r\n onKeyborardHeightChange: function (event : UniInputKeyboardHeightChangeEvent) {\r\n console.log(\"键盘高度发生变化\", JSON.stringify(event.detail));\r\n this.keyboardHeightChangeEventDetail = JSON.stringify(event.detail);\r\n this.keyboardHeight = event.detail.height;\r\n },\r\n test_check_input_value() : number {\r\n return this.onMaxLengthInputValue.length\r\n },\r\n changeCursorColor(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n if (checked) {\r\n this.cursor_color = \"red\"\r\n } else {\r\n this.cursor_color = \"#3393E2\"\r\n }\r\n const input = uni.getElementById(\"uni-input-cursor-color\")\r\n input?.focus()\r\n },\r\n changeHoldKeyboard(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.holdKeyboard = checked\r\n },\r\n changeAdjustPosition(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.adjustPosition = checked\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.input)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/input.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/input.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=input&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=input&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=input&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=input&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=input)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=input&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"editor":{"name":"## editor","description":"富文本编辑器,可以对图片、文字进行编辑。","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| read-only | boolean | - | | 设置编辑器为只读。 |\n| placeholder | string | - | | 提示信息。 |\n| show-img-size | boolean | - | | 点击图片时显示图片大小控件。 |\n| show-img-toolbar | boolean | - | | 点击图片时显示工具栏控件。 |\n| show-img-resize | string | - | | 点击图片时显示修改尺寸控件。 |\n| @ready | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器初始化完成时触发 |\n| @focus | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器聚焦时触发,event.detail = {html, text, delta} |\n| @blur | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器失去焦点时触发,detail = {html, text, delta} |\n| @input | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 编辑器内容改变时触发,detail = {html, text, delta} |\n| @statuschange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式 |\n| enable-formats | Array.<string> | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/editor/editor.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/editor/editor\n\n>Template\n```vue\n\n \n \n \n \n \n \n \n \n \n\n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n\n\n \n \n\n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n\n\n\n\n\n\n```\n\n>Script\n```uts\n\n type Context = {\n id ?: string;\n pageId ?: number;\n }\n\n export default {\n data() {\n return {\n readOnly: false,\n formats: {},\n editorCtx: {} as Context,\n // 自动化测试\n autoTest: false,\n undoTest: false,\n redoTest: false,\n removeFormatTest: false,\n insertImageTest: false,\n blurTest: false\n }\n },\n onLoad() {\n uni.loadFontFace({\n family: 'Pacifico',\n source: 'url(\"/static/font/Pacifico-Regular.ttf\")',\n success() {\n console.log('success load font')\n },\n fail() {\n console.log('fail load font load')\n }\n })\n },\n methods: {\n readOnlyChange() {\n this.readOnly = !this.readOnly\n },\n onEditorReady() {\n uni.createSelectorQuery().select('#editor').context((res) => {\n this.editorCtx = res.context\n }).exec()\n },\n // 自动化测试专用\n setContents(options) {\n this.editorCtx.setContents({\n delta: {\n ops: options\n },\n success: (res) => {\n console.log('setContents-success', res)\n },\n fail: (err) => {\n console.log(err)\n }\n })\n },\n blur() {\n this.editorCtx.blur({\n success: (res) => {\n console.log('编辑器失焦:', res)\n this.blurTest = true\n },\n fail: (err) => {\n console.log(err)\n }\n })\n },\n getCon() {\n this.editorCtx.getContents({\n success: (res) => {\n console.log('文本详情:', res)\n },\n fail: (err) => {\n console.log(err)\n }\n })\n },\n undo() {\n this.editorCtx.undo({\n success: (res) => {\n this.undoTest = true\n },\n fail: (err) => {\n this.undoTest = false\n }\n })\n },\n redo() {\n this.editorCtx.redo({\n success: (res) => {\n this.redoTest = true\n },\n fail: (err) => {\n this.redoTest = false\n }\n })\n },\n format(e) {\n let { name, value } = e.target.dataset\n if (!name) return\n // console.log('format', name, value)\n this.editorCtx.format(name, value)\n },\n onStatusChange(e) {\n const formats = e.detail\n this.formats = formats\n },\n insertDivider() {\n this.editorCtx.insertDivider({\n success: function () {\n console.log('insert divider success')\n }\n })\n },\n clear() {\n this.editorCtx.clear({\n success: function (res) {\n console.log(\"clear success\")\n }\n })\n },\n clearShowModal() {\n uni.showModal({\n title: '清空编辑器',\n content: '确定清空编辑器全部内容?',\n success: res => {\n if (res.confirm) {\n this.clear()\n }\n }\n })\n },\n removeFormat() {\n this.editorCtx.removeFormat({\n success: (res) => {\n console.log('removeFormat-success', res)\n this.removeFormatTest = true\n },\n fail: (err) => {\n this.removeFormatTest = false\n }\n })\n },\n insertDate() {\n const date = new Date()\n const formatDate = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`\n this.editorCtx.insertText({\n text: formatDate\n })\n },\n insertImage(image) {\n this.editorCtx.insertImage({\n src: image,\n alt: '图像',\n success: () => {\n console.log('insert image success')\n this.insertImageTest = true\n }\n })\n },\n chooseInsertImage() {\n uni.chooseImage({\n count: 1,\n success: (res) => {\n this.insertImage(res.tempFilePaths[0])\n }\n })\n }\n }\n }\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.editor)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/editor.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/editor.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=editor&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=editor&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=editor&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=editor&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=editor)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=editor&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"label":{"name":"## label","description":"用来改进表单组件的可用性,使用for属性找到对应的id,或者将控件放在该标签下,当点击时,就会触发对应的控件","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | - | | 是否禁用 |\n| for | string | - | | 绑定控件的 id |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/label/label.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/label/label\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n 表单组件在label内\r\n \r\n \r\n \r\n \r\n\r\n \r\n label用for标识表单组件\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n label内有多个时选中第一个\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'label',\r\n checkboxItems: [{\r\n name: 'USA',\r\n value: '美国'\r\n },\r\n {\r\n name: 'CHN',\r\n value: '中国',\r\n checked: 'true'\r\n }\r\n ],\r\n radioItems: [{\r\n name: 'USA',\r\n value: '美国'\r\n },\r\n {\r\n name: 'CHN',\r\n value: '中国',\r\n checked: 'true'\r\n }\r\n ],\r\n hidden: false,\r\n checkboxValue: [] as string[],\r\n radioValue: ''\r\n }\r\n },\r\n methods: {\r\n checkboxChange: function (e : UniCheckboxGroupChangeEvent) {\r\n console.log(e.detail.value)\r\n this.checkboxValue = e.detail.value\r\n },\r\n radioChange: function (e : UniRadioGroupChangeEvent) {\r\n console.log(e.detail.value)\r\n this.radioValue = e.detail.value\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.label)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/label.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/label.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=label&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=label&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=label&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=label&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=label)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=label&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"picker":{"name":"## picker","description":"从底部弹起的滚动选择器,现支持五种选择器,通过mode来区分,分别是普通选择器,多列选择器,时间选择器,日期选择器,省市区选择器,默认是普通选择器。","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | - | | 是否禁用 |\n| mode | string | - | | 选择器类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| selector | | 普通选择器 |\n@| multiSelector | | 多列选择器 |\n@| time | | 时间选择器 |\n@| date | | 日期选择器 |\n@| region | | 省市选择器 |\n| range | array | - | | mode为 selector 或 multiSelector 时,range 有效 |\n| range-key | string | - | | 当 range 是一个 Object Array 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容 |\n| value | string | - | | mode为select或multiSelector时:value 的值表示选择了 range 中的第几个(下标从 0 开始);mode为time时:表示选中的时间,格式为\"hh:mm\";mode为date时:表示选中的日期,格式为\"YYYY-MM-DD\";mode为region时:
\t\t表示选中的省市区,默认选中每一列的第一个值。 |\n| start | string | - | | mode为time:表示有效时间范围的开始,字符串格式为\"hh:mm\";mode为date:表示有效日期范围的开始,字符串格式为\"YYYY-MM-DD\" |\n| end | string | - | | mode为time:表示有效时间范围的结束,字符串格式为\"hh:mm\";mode为date:表示有效日期范围的结束,字符串格式为\"YYYY-MM-DD\" |\n| fields | string | - | | 有效值 year,month,day,表示选择器的粒度 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| year | | 选择器粒度为年 |\n@| month | | 选择器粒度为月份 |\n@| day | | 选择器粒度为天 |\n| custom-item | string | - | | 可为每一列的顶部添加一个自定义的项 |\n| @change | (event: [UniEvent](/component/common.md#unievent)) => void | - | | value 改变时触发 change 事件,event.detail = {value: value} |\n| @columnchange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 某一列的值改变时触发 columnchange 事件,event.detail = {column: column, value: value},column 的值表示改变了第几列(下标从0开始),value 的值表示变更值的下标 |\n| @cancel | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 取消选择时触发 |\n| header-text | string | - | | - |\n| level | string | - | | mode=\"region\" 时有效,选择器层级 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| province | | |\n@| city | | |\n@| region | | |\n@| sub-district | | |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/picker/picker.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/picker/picker\n\n>Template\n```vue\n\r\n \r\n \r\n 普通选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n {{array[index].name}}\r\n \r\n \r\n \r\n \r\n\r\n 多列选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n \r\n {{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}}\r\n \r\n \r\n \r\n \r\n \r\n\r\n 时间选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n {{time}}\r\n \r\n \r\n \r\n \r\n \r\n 注:选择 09:01 ~ 21:01 之间的时间, 不在区间内不能选中\r\n \r\n\r\n 日期选择器\r\n \r\n \r\n \r\n 当前选择\r\n \r\n \r\n \r\n {{date}}\r\n \r\n \r\n \r\n \r\n \r\n 注:选择当前时间 ±10 年之间的时间, 不在区间内不能选中\r\n \r\n \r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n function getDate(type ?: string) : string {\r\n const date = new Date();\r\n\r\n let year : string | number = date.getFullYear();\r\n let month : string | number = date.getMonth() + 1;\r\n let day : string | number = date.getDate();\r\n\r\n if (type === 'start') {\r\n year = year - 10;\r\n } else if (type === 'end') {\r\n year = year + 10;\r\n }\r\n month = month > 9 ? month : '0' + month;;\r\n day = day > 9 ? day : '0' + day;\r\n\r\n return `${year}-${month}-${day}`;\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'picker',\r\n array: [{ name: '中国' }, { name: '美国' }, { name: '巴西' }, { name: '日本' }],\r\n index: 0,\r\n multiArray: [\r\n ['亚洲', '欧洲'],\r\n ['中国', '日本'],\r\n ['北京', '上海', '广州']\r\n ],\r\n multiIndex: [0, 0, 0],\r\n date: getDate(),\r\n startDate: getDate('start'),\r\n endDate: getDate('end'),\r\n time: '12:01'\r\n }\r\n },\r\n methods: {\r\n bindPickerChange: function (e) {\r\n console.log('picker发送选择改变,携带值为:' + e.detail.value)\r\n this.index = e.detail.value\r\n },\r\n bindMultiPickerColumnChange: function (e) {\r\n console.log('修改的列为:' + e.detail.column + ',值为:' + e.detail.value)\r\n this.multiIndex[e.detail.column] = e.detail.value\r\n switch (e.detail.column) {\r\n case 0: //拖动第1列\r\n switch (this.multiIndex[0]) {\r\n case 0:\r\n this.multiArray[1] = ['中国', '日本']\r\n this.multiArray[2] = ['北京', '上海', '广州']\r\n break\r\n case 1:\r\n this.multiArray[1] = ['英国', '法国']\r\n this.multiArray[2] = ['伦敦', '曼彻斯特']\r\n break\r\n }\r\n this.multiIndex.splice(1, 1, 0)\r\n this.multiIndex.splice(2, 1, 0)\r\n break\r\n case 1: //拖动第2列\r\n switch (this.multiIndex[0]) { //判断第一列是什么\r\n case 0:\r\n switch (this.multiIndex[1]) {\r\n case 0:\r\n this.multiArray[2] = ['北京', '上海', '广州']\r\n break\r\n case 1:\r\n this.multiArray[2] = ['东京', '北海道']\r\n break\r\n }\r\n break\r\n case 1:\r\n switch (this.multiIndex[1]) {\r\n case 0:\r\n this.multiArray[2] = ['伦敦', '曼彻斯特']\r\n break\r\n case 1:\r\n this.multiArray[2] = ['巴黎', '马赛']\r\n break\r\n }\r\n break\r\n }\r\n this.multiIndex.splice(2, 1, 0)\r\n break\r\n }\r\n this.$forceUpdate()\r\n },\r\n bindDateChange: function (e) {\r\n this.date = e.detail.value\r\n },\r\n bindTimeChange: function (e) {\r\n this.time = e.detail.value\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.picker)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/picker.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=picker&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=picker&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=picker&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=picker&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=picker)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=picker&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"picker-view-column":{"name":"## picker-view-column","description":"仅可放置于 picker-view 中,其子节点未继承 picker-view 的选中框的高度,需要自己设置高度并居中","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.picker-view.picker-view-column)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/picker-view.html#picker-view-column)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker-view-column.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=picker-view-column&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=picker-view-column&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=picker-view-column&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=picker-view-column&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=picker-view-column)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=picker-view-column&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"picker-view":{"name":"## picker-view","description":"> 组件类型:UniPickerViewElement \n\n 嵌入页面的滚动选择器","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| value | array\\ | - | | picker-view-column 选择的第几项 |\n| indicator-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置选择器中间选中框的样式 |\n| indicator-class | string([string.ClassString](/uts/data-type.md#ide-string)) | - | | 设置选择器中间选中框的类名 |\n| mask-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置蒙层的样式 |\n| mask-top-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置蒙层上半部分的样式 |\n| mask-bottom-style | string([string.CSSString](/uts/data-type.md#ide-string)) | - | | 设置蒙层下半部分的样式 |\n| mask-class | string([string.ClassString](/uts/data-type.md#ide-string)) | - | | 设置蒙层的类名 |\n| @change | (event: [UniPickerViewChangeEvent](#unipickerviewchangeevent)) => void | - | | 当滚动选择,value 改变时触发 change 事件,event.detail = {value: value};value为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0
\t\t开始) |\n| @pickstart | eventhandle | - | | - |\n| @pickend | eventhandle | - | | - |","event":"\n### 事件\n#### UniPickerViewChangeEvent\n\n```mermaid\ngraph LR\n \nUniPickerViewChangeEvent -- Extends --> UniCustomEvent<UniPickerViewChangeEventDetail>\n style UniCustomEvent<UniPickerViewChangeEventDetail> color:#42b983\n click UniCustomEvent<UniPickerViewChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniPickerViewChangeEventDetail\n\n\n###### UniPickerViewChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | Array\\ | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/picker-view/picker-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/picker-view/picker-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/picker-view/picker-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n 日期:{{year}}年{{month}}月{{day}}日\r\n \r\n \r\n \r\n \r\n {{item}}年\r\n \r\n \r\n {{item}}月\r\n \r\n \r\n \r\n {{item}}日\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { state, setEventCallbackNum } from '@/store/index.uts'\r\n export default {\r\n data() {\r\n // 20180112 HBuilderX内测开始 :)\r\n const _years : number[] = []\r\n const _year = 2018\r\n const _months : number[] = []\r\n const _month : number = 1\r\n const _days : number[] = []\r\n const _day = 12\r\n for (let i = 2000; i <= _year; i++) {\r\n _years.push(i)\r\n }\r\n for (let i = 1; i <= 12; i++) {\r\n _months.push(i)\r\n }\r\n for (let i = 1; i <= 31; i++) {\r\n _days.push(i)\r\n }\r\n return {\r\n title: 'picker-view',\r\n years: _years as number[],\r\n year: _year as number,\r\n months: _months as number[],\r\n month: _month as number,\r\n days: _days as number[],\r\n day: _day as number,\r\n value: [_year - 2000, _month - 1, _day - 1] as number[],\r\n result: [] as number[],\r\n indicatorStyle: 'height: 50px;',\r\n // 自动化测试\r\n indicatorClass: '',\r\n maskStyle: '',\r\n maskClass: '',\r\n maskTopStyle: '',\r\n maskBottomStyle: ''\r\n }\r\n },\r\n methods: {\r\n // 自动化测试\r\n getEventCallbackNum() : number {\r\n return state.eventCallbackNum\r\n },\r\n // 自动化测试\r\n setEventCallbackNum(num : number) {\r\n setEventCallbackNum(num)\r\n },\r\n bindChange(e : UniPickerViewChangeEvent) {\r\n // 自动化测试 触发事件元素、type 类型\r\n // console.log(e.target?.tagName, e.type);\r\n if ((e.target?.tagName ?? '').includes('PICKER-VIEW')) {\r\n this.setEventCallbackNum(state.eventCallbackNum + 1)\r\n }\r\n if (e.type === 'change') {\r\n this.setEventCallbackNum(state.eventCallbackNum + 2)\r\n }\r\n const val = e.detail.value\r\n this.result = val\r\n this.year = this.years[val[0]]\r\n this.month = this.months[val[1]]\r\n this.day = this.days[val[2]]\r\n },\r\n setValue() {\r\n this.value = [0, 1, 30] as number[]\r\n },\r\n setValue1() {\r\n this.value = [10, 10, 10] as number[]\r\n },\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [picker-view-column](picker-view-column.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.picker-view.picker-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/picker-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/picker-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=picker-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=picker-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=picker-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=picker-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=picker-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=picker-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"radio":{"name":"## radio","description":"> 组件类型:UniRadioElement \n\n 单选项。在1组radio-group中只能选中1个","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| disabled | boolean | false | | 是否禁用 |\n| value | string | - | | \\ 标识。当该radio 选中时,radio-group的 change 事件会携带radio的value |\n| checked | boolean | false | | \\ 当前是否选中 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | radio默认的背景颜色 |\n| borderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#d1d1d1\" | | radio默认的边框颜色 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007AFF\" | | radio选中时的背景颜色,优先级大于color属性 |\n| activeBorderColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"\" | | radio选中时的边框颜色 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | radio的图标颜色 |\n| ~~iconColor~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | radio的图标颜色 (使用foreColor替代) |\n| ~~color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007AFF\" | | radio的颜色 (使用foreColor替代) |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/radio/radio.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/radio/radio\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/radio/radio\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n uni-app-x\r\n \r\n \r\n\r\n \r\n \r\n \r\n 当前是否选中\" @change=\"change_checked_boolean\">\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n 默认样式 \r\n \r\n \r\n 选中\r\n \r\n {{\r\n text\r\n }}\r\n 禁用\r\n {{\r\n wrapText\r\n }}\r\n \r\n \r\n\r\n \r\n \r\n 不同颜色和尺寸的radio \r\n \r\n \r\n 选中\r\n \r\n 未选中\r\n \r\n \r\n\r\n \r\n \r\n 推荐展示样式 \r\n \r\n \r\n \r\n \r\n \r\n {{ item.name }}\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n type ItemType = {\r\n value : string\r\n name : string\r\n }\r\n export default {\r\n data() {\r\n return {\r\n items: [\r\n {\r\n value: 'CHN',\r\n name: '中国',\r\n },\r\n {\r\n value: 'USA',\r\n name: '美国',\r\n },\r\n\r\n {\r\n value: 'BRA',\r\n name: '巴西',\r\n },\r\n {\r\n value: 'JPN',\r\n name: '日本',\r\n },\r\n {\r\n value: 'ENG',\r\n name: '英国',\r\n },\r\n {\r\n value: 'FRA',\r\n name: '法国',\r\n },\r\n ] as ItemType[],\r\n current: 0,\r\n eventTest: false,\r\n\r\n value: '',\r\n text: '未选中',\r\n wrapText: 'uni-app x,终极跨平台方案\\nuts,大一统语言',\r\n disabled: true,\r\n checked: true,\r\n color: '#007aff',\r\n // 组件属性 autotest\r\n checked_boolean: false,\r\n disabled_boolean: false,\r\n color_input: \"#007AFF\",\r\n backgroundColor_input: \"#ffffff\",\r\n borderColor_input: \"#d1d1d1\",\r\n activeBackgroundColor_input: \"#007AFF\",\r\n activeBorderColor_input: \"\",\r\n iconColor_input: \"#ffffff\"\r\n }\r\n },\r\n\r\n methods: {\r\n radioChange(e : UniRadioGroupChangeEvent) {\r\n\r\n // 自动化测试\r\n console.log('test: radio event detail', e.target?.tagName, e.type)\r\n if ((e.target?.tagName ?? '') == 'RADIO-GROUP' && e.type == 'change') {\r\n this.eventTest = true\r\n }\r\n\r\n const selected = this.items.find((item) : boolean => {\r\n return item.value == e.detail.value\r\n })\r\n uni.showToast({\r\n icon: 'none',\r\n title: '当前选中:' + selected?.name,\r\n })\r\n },\r\n testChange(e : UniRadioGroupChangeEvent) {\r\n\r\n this.value = e.detail.value\r\n },\r\n radio_click() { console.log(\"组件被点击时触发\") },\r\n radio_touchstart() { console.log(\"手指触摸动作开始\") },\r\n radio_touchmove() { console.log(\"手指触摸后移动\") },\r\n radio_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n radio_touchend() { console.log(\"手指触摸动作结束\") },\r\n radio_tap() { console.log(\"手指触摸后马上离开\") },\r\n radio_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n change_checked_boolean(checked : boolean) { this.checked_boolean = checked },\r\n change_disabled_boolean(checked : boolean) { this.disabled_boolean = checked },\r\n confirm_color_input(value : string) { this.color_input = value },\r\n confirm_backgroundColor_input(value : string) { this.backgroundColor_input = value },\r\n confirm_borderColor_input(value : string) { this.borderColor_input = value },\r\n confirm_activeBackgroundColor_input(value : string) { this.activeBackgroundColor_input = value },\r\n confirm_activeBorderColor_input(value : string) { this.activeBorderColor_input = value },\r\n confirm_iconColor_input(value : string) { this.iconColor_input = value }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.radio.radio)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/radio.html#radio)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/radio.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=radio&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=radio&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=radio&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=radio&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=radio)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=radio&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"radio-group":{"name":"## radio-group","description":"> 组件类型:UniRadioGroupElement \n\n 单选框组","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| @change | (event: [UniRadioGroupChangeEvent](#uniradiogroupchangeevent)) => void | - | | radio-group 中的选中项发生变化时触发 change 事件,event.detail = {value: 选中项radio的value} |","event":"\n### 事件\n#### UniRadioGroupChangeEvent\n\n```mermaid\ngraph LR\n \nUniRadioGroupChangeEvent -- Extends --> UniCustomEvent<UniRadioGroupChangeEventDetail>\n style UniCustomEvent<UniRadioGroupChangeEventDetail> color:#42b983\n click UniCustomEvent<UniRadioGroupChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniRadioGroupChangeEventDetail\n\n\n###### UniRadioGroupChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | string | 是 | - | - | - |\n\n","example":"","children":"### 子组件 @children-tags\n| 子组件 | 兼容性 |\n| :- | :- |\n| [radio](radio.md) | |","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.radio.radio-group)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/radio.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/radio-group.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=radio-group&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=radio-group&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=radio-group&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=radio-group&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=radio-group)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=radio-group&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"slider":{"name":"## slider","description":"> 组件类型:UniSliderElement \n\n 滑动选择器","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| disabled | boolean | - | | 是否禁用 |\n| min | number | 0 | | slider 最小值 |\n| max | number | 100 | | slider 最大值 |\n| step | number | 1 | | slider 步长,取值必须大于 0,并且可被(max - min)整除 |\n| value | number | 0 | | radio当前取值 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | slider 滑块左侧已选择部分的线条颜色 |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#e9e9e9\" | | radio背景条的颜色 |\n| block-size | number | 28 | | radio滑块的大小,取值范围为 12 - 28 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | slider 的滑块背景颜色 |\n| show-value | boolean | false | | 是否显示当前 value |\n| @change | (event: [UniSliderChangeEvent](#unisliderchangeevent)) => void | - | | 完成一次拖动后触发的事件,event.detail = {value: value} |\n| @changing | (event: [UniSliderChangeEvent](#unisliderchangeevent)) => void | - | | 拖动过程中触发的事件,event.detail = {value: value} |\n| color | color | - | | - |\n| selected-color | color | - | | - |\n| ~~block-color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#ffffff\" | | 滑块颜色 (使用foreColor替代) |\n| ~~activeColor~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | \"#007aff\" | | slider 滑块左侧已选择部分的线条颜色 |","event":"\n### 事件\n#### UniSliderChangeEvent\n\n```mermaid\ngraph LR\n \nUniSliderChangeEvent -- Extends --> UniCustomEvent<UniSliderChangeEventDetail>\n style UniCustomEvent<UniSliderChangeEventDetail> color:#42b983\n click UniCustomEvent<UniSliderChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniSliderChangeEventDetail\n\n\n###### UniSliderChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | number | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/slider/slider.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/slider/slider\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/slider/slider\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n uni-app-x\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n 显示当前value\r\n \r\n \r\n \r\n\r\n 设置步进:step=10跳动\r\n \r\n \r\n 0\r\n 100\r\n \r\n \r\n \r\n\r\n 浮点步进:step=0.01跳动\r\n \r\n \r\n \r\n\r\n 设置最小/最大值\r\n \r\n \r\n \r\n\r\n 不同颜色和大小的滑块\r\n \r\n \r\n \r\n 暗黑模式\r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n sliderValue: 50,\r\n sliderBlockSize: 20,\r\n sliderBackgroundColor: \"#000000\",\r\n sliderActiveColor: \"#FFCC33\",\r\n sliderBlockColor: \"#8A6DE9\",\r\n // 组件属性 autotest\r\n show_value_boolean: false,\r\n disabled_boolean: false,\r\n min_input: 0,\r\n max_input: 100,\r\n step_input: 1,\r\n value_input: 0,\r\n activeColor_input: \"#007aff\",\r\n backgroundColor_input: \"#e9e9e9\",\r\n block_size_input: 28,\r\n block_color_input: \"#ffffff\",\r\n valueColor: \"#888888\",\r\n };\r\n },\r\n methods: {\r\n sliderChange(e : UniSliderChangeEvent) {\r\n console.log(\"value 发生变化:\" + e.detail.value);\r\n },\r\n slider_click() {\r\n console.log(\"组件被点击时触发\");\r\n },\r\n slider_touchstart() {\r\n console.log(\"手指触摸动作开始\");\r\n },\r\n slider_touchmove() {\r\n console.log(\"手指触摸后移动\");\r\n },\r\n slider_touchcancel() {\r\n console.log(\"手指触摸动作被打断,如来电提醒,弹窗\");\r\n },\r\n slider_touchend() {\r\n console.log(\"手指触摸动作结束\");\r\n },\r\n slider_tap() {\r\n console.log(\"手指触摸后马上离开\");\r\n },\r\n slider_longpress() {\r\n console.log(\r\n \"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\"\r\n );\r\n },\r\n slider_change() {\r\n console.log(\"完成一次拖动后触发的事件,event.detail = {value: value}\");\r\n },\r\n slider_changing() {\r\n console.log(\"拖动过程中触发的事件,event.detail = {value: value}\");\r\n },\r\n change_show_value_boolean(checked : boolean) {\r\n this.show_value_boolean = checked;\r\n },\r\n change_disabled_boolean(checked : boolean) {\r\n this.disabled_boolean = checked;\r\n },\r\n confirm_min_input(value : number) {\r\n this.min_input = value;\r\n },\r\n confirm_max_input(value : number) {\r\n this.max_input = value;\r\n },\r\n confirm_step_input(value : number) {\r\n this.step_input = value;\r\n },\r\n confirm_value_input(value : number) {\r\n this.value_input = value;\r\n },\r\n confirm_activeColor_input(value : string) {\r\n this.activeColor_input = value;\r\n },\r\n confirm_backgroundColor_input(value : string) {\r\n this.backgroundColor_input = value;\r\n },\r\n confirm_block_size_input(value : number) {\r\n this.block_size_input = value;\r\n },\r\n confirm_block_color_input(value : string) {\r\n this.block_color_input = value;\r\n },\r\n confirm_value_color_input(value : string) {\r\n this.valueColor = value;\r\n },\r\n },\r\n };\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.slider)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/slider.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/slider.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=slider&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=slider&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=slider&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=slider&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=slider)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=slider&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"switch":{"name":"## switch","description":"> 组件类型:UniSwitchElement \n\n 开关选择器","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| checked | boolean | - | | 是否选中 |\n| type | string | - | | 样式,有效值:switch, checkbox |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| switch | | |\n@| checkbox | | |\n| backgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的关闭状态背景颜色 |\n| activeBackgroundColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的开启状态背景颜色 |\n| foreColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的滑块背景颜色 |\n| activeForeColor | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的开启状态下的滑块背景颜色 |\n| disabled | boolean | - | | 是否禁用 |\n| @change | (event: [UniSwitchChangeEvent](#uniswitchchangeevent)) => void | - | | checked 改变时触发 change 事件,event.detail={ value:checked} |\n| ~~color~~ | string([string.ColorString](/uts/data-type.md#ide-string)) | - | | switch 的颜色,同 css 的 color (使用foreColor替代) |","event":"\n### 事件\n#### UniSwitchChangeEvent\n\n```mermaid\ngraph LR\n \nUniSwitchChangeEvent -- Extends --> UniCustomEvent<UniSwitchChangeEventDetail>\n style UniCustomEvent<UniSwitchChangeEventDetail> color:#42b983\n click UniCustomEvent<UniSwitchChangeEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniSwitchChangeEventDetail\n\n\n###### UniSwitchChangeEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | boolean | 是 | - | - | - |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/switch/switch.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/switch/switch\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/switch/switch\n\n>Template\n```vue\n\r\n \r\n \r\n 默认样式\r\n \r\n \r\n \r\n \r\n 暗黑样式\r\n \r\n \r\n \r\n \r\n 禁用样式\r\n \r\n \r\n \r\n \r\n 不同颜色和尺寸的switch\r\n \r\n \r\n \r\n \r\n 推荐展示样式\r\n \r\n \r\n \r\n 开启中\r\n \r\n \r\n \r\n 关闭\r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'switch 开关',\r\n checked: true,\r\n color: '#FFCC33',\r\n clickCheckedValue: true,\r\n testVerifyEvent: false,\r\n }\r\n },\r\n methods: {\r\n switch1Change: function (e : UniSwitchChangeEvent) {\r\n this.clickCheckedValue = e.detail.value\r\n console.log('switch1 发生 change 事件,携带值为', e.detail.value)\r\n\r\n // 仅测试\r\n this.testVerifyEvent = (e.type == 'change' && (e.target?.tagName ?? '') == \"SWITCH\")\r\n },\r\n switch2Change: function (e : UniSwitchChangeEvent) {\r\n console.log('switch2 发生 change 事件,携带值为', e.detail.value)\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.switch)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/switch.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/switch.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=switch&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=switch&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=switch&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=switch&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=switch)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=switch&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"textarea":{"name":"## textarea","description":"> 组件类型:[UniTextareaElement](/dom/unitextareaelement.md) \n\n 多行输入框","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| name | string | - | | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| disabled | boolean | false | | 是否禁用 |\n| value | string | \"\" | | 输入框的初始内容 |\n| placeholder | string | \"\" | | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | | 指定 placeholder 的样式,目前仅支持color,font-size和font-weight |\n| placeholder-class | string([string.ClassString](/uts/data-type.md#ide-string)) | \"\" | | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | \"不限制长度\" | | 最大输入长度,0和正数为合法值,非法值的时候不限制最大长度 |\n| auto-focus | boolean | false | | 自动获取焦点,与`focus`属性对比,此属性只会首次生效。 |\n| focus | boolean | false | | 获取焦点 |\n| confirm-type | return \\| send \\| search \\| next \\| go \\| done | \"return\" | | 设置键盘右下角按钮的文字 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| return | | 换行 |\n@| send | | 发送 |\n@| search | | 搜索 |\n@| next | | 下一个 |\n@| go | | 前往 |\n@| done | | 完成 |\n| cursor | number | 0 | | 指定focus时的光标位置 |\n| confirm-hold | boolean | false | | 点击键盘右下角按钮时是否保持键盘不收起 |\n| auto-height | boolean | false | | 是否自动增高,设置auto-height时,style.height不生效 |\n| fixed | boolean | - | | 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true |\n| cursor-spacing | number | 0 | | 指定光标与键盘的距离,单位 px 。取 textarea 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 |\n| cursor-color | string([string.ColorString](/uts/data-type.md#ide-string)) | \"\" | | 指定光标颜色 |\n| show-confirm-bar | boolean | - | | 是否显示键盘上方带有”完成“按钮那一栏 |\n| selection-start | number | -1 | | 光标起始位置,自动聚集时有效,需与selection-end搭配使用 |\n| selection-end | number | -1 | | 光标结束位置,自动聚集时有效,需与selection-satrt搭配使用 |\n| adjust-position | boolean | true | | 键盘弹起时,是否自动上推页面 |\n| inputmode | none \\| text \\| decimal \\| numeric \\| tel \\| search \\| email \\| url | \"text\" | | 是一个枚举属性,它提供了用户在编辑元素或其内容时可能输入的数据类型的提示。在符合条件的高版本webview里,uni-app的 web 和 app-vue 平台中可使用本属性。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| none | | 无虚拟键盘。在应用程序或者站点需要实现自己的键盘输入控件时很有用。 |\n@| text | | 使用用户本地区域设置的标准文本输入键盘。 |\n@| decimal | | 小数输入键盘,包含数字和分隔符(通常是“ . ”或者“ , ”),设备可能也可能不显示减号键。 |\n@| numeric | | 数字输入键盘,所需要的就是 0 到 9 的数字,设备可能也可能不显示减号键。 |\n@| tel | | 电话输入键盘,包含 0 到 9 的数字、星号(*)和井号(#)键。表单输入里面的电话输入通常应该使用 \\ 。 |\n@| search | | 为搜索输入优化的虚拟键盘,比如,返回键可能被重新标记为“搜索”,也可能还有其他的优化。 |\n@| email | | 为邮件地址输入优化的虚拟键盘,通常包含\"@\"符号和其他优化。表单里面的邮件地址输入应该使用 \\ 。 |\n@| url | | 为网址输入优化的虚拟键盘,比如,“/”键会更加明显、历史记录访问等。表单里面的网址输入通常应该使用 \\ 。 |\n| hold-keyboard | boolean | false | | focus时,点击页面的时候不收起键盘 |\n| @confirm | (event: [UniInputConfirmEvent](#uniinputconfirmevent)) => void | - | | 点击完成时, 触发 confirm 事件,event.detail = {value: value} |\n| @input | (event: [UniInputEvent](#uniinputevent)) => void | - | | 当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上 |\n| @linechange | (event: [UniTextareaLineChangeEvent](#unitextarealinechangeevent)) => void | - | | 输入框行数变化时调用,event.detail = {height: 0, heightRpx: 0, lineCount: 0} |\n| @blur | (event: [UniTextareaBlurEvent](#unitextareablurevent)) => void | - | | 输入框失去焦点时触发,event.detail = {value, cursor} |\n| @keyboardheightchange | (event: [UniInputKeyboardHeightChangeEvent](#uniinputkeyboardheightchangeevent)) => void | - | | 键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration} |\n| @focus | (event: [UniTextareaFocusEvent](#unitextareafocusevent)) => void | - | | 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度,在基础库 1.9.90 起支持 |\n| disabled | boolean | - | | - |\n| disable-default-padding | boolean | - | | - |\n| adjust-keyboard-to | boolean | - | | *(boolean)*
键盘对齐位置 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| cursor | | |\n@| bottom | | |","event":"\n### 事件\n#### UniInputConfirmEvent\n\n```mermaid\ngraph LR\n \nUniInputConfirmEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputConfirmEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n\n\n#### UniInputEvent\n\n```mermaid\ngraph LR\n \nUniInputEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 光标的位置 |\n@| keyCode | number | 是 | - | - | 输入字符的Unicode值 |\n\n\n#### UniTextareaLineChangeEvent\n\n```mermaid\ngraph LR\n \nUniTextareaLineChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniTextareaLineChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniTextareaLineChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| lineCount | number | 是 | - | - | 行数 |\n@| heightRpx | number | 是 | - | - | textarea的高度 |\n@| height | number | 是 | - | - | textarea的高度 |\n\n\n#### UniTextareaBlurEvent\n\n```mermaid\ngraph LR\n \nUniTextareaBlurEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniTextareaBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniTextareaBlurEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| value | string | 是 | - | - | 输入框内容 |\n@| cursor | number | 是 | - | - | 选择区域的起始位置 |\n\n\n#### UniInputKeyboardHeightChangeEvent\n\n```mermaid\ngraph LR\n \nUniInputKeyboardHeightChangeEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniInputKeyboardHeightChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | - | 键盘高度 |\n@| duration | number | 是 | - | - | 持续时间 |\n\n\n#### UniTextareaFocusEvent\n\n```mermaid\ngraph LR\n \nUniTextareaFocusEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniTextareaFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniTextareaFocusEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| height | number | 是 | - | | 键盘高度 |\n@| value | string | 是 | - | - | 输入框内容 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/textarea/textarea.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/textarea/textarea\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/textarea/textarea\n\n>Template\n```vue\n\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n maxlength 输入最大长度为10\r\n \r\n \r\n \r\n \r\n\r\n \r\n cursor-spacing、placeholder-class、placeholder-style例子\r\n \r\n \r\n \r\n \r\n \r\n 设置输入框聚焦时光标的起始位置和结束位置(点击生效)\r\n \r\n \r\n \r\n \r\n\r\n \r\n 设置hold-keyboard\r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n 同时存在 v-model 和 value\r\n \r\n \r\n \r\n \r\n\r\n \r\n 设置adjust-position\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types'\r\n export default {\r\n data() {\r\n return {\r\n adjust_position_boolean: false,\r\n show_confirm_bar_boolean: false,\r\n fixed_boolean: false,\r\n auto_height_boolean: false,\r\n confirm_hold_boolean: false,\r\n focus_boolean: true,\r\n auto_focus_boolean: false,\r\n default_value: \"1\\n2\\n3\\n4\\n5\\n6\",\r\n inputmode_enum: [{ \"value\": 1, \"name\": \"text\" }, { \"value\": 2, \"name\": \"decimal\" }, { \"value\": 3, \"name\": \"numeric\" }, { \"value\": 4, \"name\": \"tel\" }, { \"value\": 5, \"name\": \"search\" }, { \"value\": 6, \"name\": \"email\" }, { \"value\": 7, \"name\": \"url\" }, { \"value\": 0, \"name\": \"none\" }] as ItemType[],\r\n confirm_type_list: [{ \"value\": 0, \"name\": \"return\" }, { \"value\": 1, \"name\": \"done\" }, { \"value\": 2, \"name\": \"send\" }, { \"value\": 3, \"name\": \"search\" }, { \"value\": 4, \"name\": \"next\" }, { \"value\": 5, \"name\": \"go\" }] as ItemType[],\r\n cursor_color: \"#3393E2\",\r\n cursor: 0,\r\n inputmode_enum_current: 0,\r\n confirm_type_current: 0,\r\n placeholder_value: \"请输入\",\r\n defaultModel: '123',\r\n textareaMaxLengthValue: \"\",\r\n selectionStart: -1,\r\n selectionEnd: -1,\r\n hold_keyboard: false,\r\n adjust_position: false\r\n }\r\n },\r\n\r\n methods: {\r\n textarea_click() { console.log(\"组件被点击时触发\") },\r\n textarea_touchstart() { console.log(\"手指触摸动作开始\") },\r\n textarea_touchmove() { console.log(\"手指触摸后移动\") },\r\n textarea_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n textarea_touchend() { console.log(\"手指触摸动作结束\") },\r\n textarea_tap() { console.log(\"手指触摸后马上离开\") },\r\n textarea_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n textarea_confirm() { console.log(\"点击完成时, 触发 confirm 事件,event.detail = {value: value}\") },\r\n textarea_input() { console.log(\"当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上\") },\r\n textarea_linechange() { console.log(\"输入框行数变化时调用,event.detail = {height: 0, height: 0, lineCount: 0}\") },\r\n textarea_blur() { console.log(\"输入框失去焦点时触发,event.detail = {value, cursor}\") },\r\n textarea_keyboardheightchange() { console.log(\"键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration}\") },\r\n textarea_focus() { console.log(\"输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\") },\r\n change_adjust_position_boolean(checked : boolean) { this.adjust_position_boolean = checked },\r\n change_show_confirm_bar_boolean(checked : boolean) { this.show_confirm_bar_boolean = checked },\r\n change_fixed_boolean(checked : boolean) { this.fixed_boolean = checked },\r\n change_auto_height_boolean(checked : boolean) { this.auto_height_boolean = checked },\r\n change_confirm_hold_boolean(checked : boolean) { this.confirm_hold_boolean = checked },\r\n change_focus_boolean(checked : boolean) { this.focus_boolean = checked },\r\n change_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked },\r\n change_cursor_color_boolean(checked : boolean) { if (checked) { this.cursor_color = \"transparent\" } else { this.cursor_color = \"#3393E2\" } },\r\n radio_change_inputmode_enum(checked : number) { this.inputmode_enum_current = checked },\r\n radio_change_confirm_type(checked : number) { this.confirm_type_current = checked },\r\n setSelection: function (selectionStart : number, selectionEnd : number) {\r\n uni.getElementById(\"textarea-instance-2\")?.focus()\r\n this.selectionStart = selectionStart;\r\n this.selectionEnd = selectionEnd;\r\n },\r\n onSelectionBlurChange() {\r\n this.selectionEnd = 0;\r\n },\r\n changeHoldKeyboard(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.hold_keyboard = checked;\r\n },\r\n changeAdjustPosition(event : UniSwitchChangeEvent) {\r\n const checked = event.detail.value;\r\n this.adjust_position = checked;\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form-component.textarea)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/textarea.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/textarea.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=textarea&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=textarea&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=textarea&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=textarea&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=textarea)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=textarea&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"navigator":{"name":"## navigator","description":"> 组件类型:UniNavigatorElement \n\n 页面链接","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| target | string | - | | 在哪个目标上发生跳转,默认当前应用 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| self | | |\n@| miniProgram | | |\n| url | string([string.PageURIString](/uts/data-type.md#ide-string)) | - | | 当前应用内的跳转链接 |\n| open-type | string | \"navigate\" | | 跳转方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| navigate | | 对应 uni.navigateTo 或 navigateToMiniProgram 的功能 |\n@| redirect | | 对应 uni.redirectTo 的功能 |\n@| switchTab | | 对应 uni.switchTab 的功能 |\n@| reLaunch | | 对应 uni.reLaunch 的功能 |\n@| navigateBack | | 对应 uni.navigateBack 的功能 |\n@| exit | | |\n| delta | number | - | | 当 open-type 为 navigateBack 时有效,表示回退的层数 |\n| app-id | string | - | | 当target=\"miniProgram\"时有效,要打开的小程序 appId |\n| path | string | - | | 当target=\"miniProgram\"时有效,打开的页面路径,如果为空则打开首页 |\n| extra-data | object | - | | 当target=\"miniProgram\"时有效,需要传递给目标应用的数据,目标应用可在 App.onLaunch(),App.onShow() 中获取到这份数据 |\n| version | string | - | | 当target=\"miniProgram\"时有效,要打开的小程序版本,有效值 develop(开发版),trial(体验版),release(正式版),仅在当前小程序为开发版或体验版时此参数有效;如果当前小程序是体验版或正式版,则打开的小程序必定是正式版 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| develop | | |\n@| trial | | |\n@| release | | |\n| animation-type | string | \"pop-in/out\" | | 当 open-type=\"navigateTo\" 或 open-type=\"navigateBack\" 时有效,窗口的显示/关闭的动画类型。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| auto | - | 自动选择动画效果 |\n@| none | - | 无动画效果 |\n@| slide-in-right | - | 从右侧横向滑动效果 |\n@| slide-in-left | - | 左侧横向滑动效果 |\n@| slide-in-top | - | 从上侧竖向滑动效果 |\n@| slide-in-bottom | - | 从下侧竖向滑动效果 |\n@| fade-in | - | 从透明到不透明逐渐显示效果 |\n@| zoom-out | - | 从小到大逐渐放大显示效果 |\n@| zoom-fade-out | - | 从小到大逐渐放大并且从透明到不透明逐渐显示效果 |\n@| pop-in | - | 从右侧平移入栈动画效果 |\n@| slide-out-right | - | 横向向右侧滑出屏幕动画 |\n@| slide-out-left | - | 横向向左侧滑出屏幕动画 |\n@| slide-out-top | - | 竖向向上侧滑出屏幕动画 |\n@| slide-out-bottom | - | 竖向向下侧滑出屏幕动画 |\n@| fade-out | - | 从不透明到透明逐渐隐藏动画 |\n@| zoom-in | - | 从大逐渐缩小关闭动画 |\n@| zoom-fade-in | - | 从大逐渐缩小并且从不透明到透明逐渐隐藏关闭动画 |\n@| pop-out | - | 从右侧平移出栈动画效果 |\n| animation-duration | number | 300 | | 当 open-type=\"navigateTo\" 或 open-type=\"navigateBack\" 时有效,窗口的显示/关闭动画的持续时间。 |\n| hover-class | string | - | | 指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果 |\n| hover-stop-propagation | boolean | - | | 指定是否阻止本节点的祖先节点出现点击态 |\n| hover-start-time | number | - | | 按住后多久出现点击态,单位毫秒 |\n| hover-stay-time | number | - | | 手指松开后点击态保留时间,单位毫秒 |\n| render-link | boolean | true | | 是否给 navigator 组件加一层 a 标签控制 ssr 渲染 |\n| short-link | string | - | | - |\n| bindsuccess | string | - | | - |\n| bindfail | string | - | | - |\n| bindcomplete | string | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/navigator/navigator.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/navigator/navigator\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/navigator/navigator\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 两端对齐样式测试\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'navigator'\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.navigation.navigator)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/navigator.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=navigator&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=navigator&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=navigator&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=navigator&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=navigator)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=navigator&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"image":{"name":"## image","description":"> 组件类型:[UniImageElement](/dom/uniimageelement.md) \n\n 图片","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| src | string([string.ImageURIString](/uts/data-type.md#ide-string)) | - | | 图片资源地址 |\n| mode | string | \"scaleToFill\" | | 图片裁剪、缩放的模式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| scaleToFill | | 不保持纵横比缩放图片,使图片的宽高完全拉伸至填满 image 元素 |\n@| aspectFit | | 保持纵横比缩放图片,使图片的长边能完全显示出来。也就是说,可以完整地将图片显示出来。 |\n@| aspectFill | | 保持纵横比缩放图片,只保证图片的短边能完全显示出来。也就是说,图片通常只在水平或垂直方向是完整的,另一个方向将会发生截取 |\n@| widthFix | | 宽度不变,高度自动变化,保持原图宽高比不变 |\n@| heightFix | | 高度不变,宽度自动变化,保持原图宽高比不变 |\n@| top | | 不缩放图片,只显示图片的顶部区域 |\n@| bottom | | 不缩放图片,只显示图片的底部区域 |\n@| center | | 不缩放图片,只显示图片的中间区域 |\n@| left | | 不缩放图片,只显示图片的左边区域 |\n@| right | | 不缩放图片,只显示图片的右边区域 |\n@| top left | | 不缩放图片,只显示图片的左上边区域 |\n@| top right | | 不缩放图片,只显示图片的右上边区域 |\n@| bottom left | | 不缩放图片,只显示图片的左下边区域 |\n@| bottom right | | 不缩放图片,只显示图片的右下边区域 |\n| lazy-load | boolean | false | | 图片懒加载。只针对page与scroll-view下的image有效。 安卓默认懒加载不支持修改 |\n| fade-show | boolean | false | | 图片显示动画效果 |\n| webp | boolean | true | | 是否支持 webP 格式 |\n| show-menu-by-longpress | boolean | false | | 开启长按图片显示识别小程序码菜单 |\n| draggable | boolean | false | | 鼠标长按是否能拖动图片(仅H5平台) |\n| @error | (event: [UniImageErrorEvent](#uniimageerrorevent)) => void | - | | 图片加载错误时触发,event.detail = { errMsg } |\n| @load | (event: [UniImageLoadEvent](#uniimageloadevent)) => void | - | | 图片加载完成时触发,event.detail = { width: '图片宽度px', height: '图片高度px' } |","event":"\n### 事件\n#### UniImageErrorEvent\n\n```mermaid\ngraph LR\n \nUniImageErrorEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniImageErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniImageErrorEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| errMsg | string | 是 | - | - | 错误信息 |\n\n\n#### UniImageLoadEvent\n\n```mermaid\ngraph LR\n \nUniImageLoadEvent -- Extends --> UniEvent\n style UniEvent color:#42b983\n click UniEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unievent\"\n```\n##### UniImageLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniImageLoadEventDetail** | 是 | - | - | |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| width | number | 是 | - | - | 图片宽度 |\n@| height | number | 是 | - | - | 图片高度 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/image/image.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/image/image\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/image/image\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'image',\r\n imageSrc: \"/static/test-image/logo.png\" as string.ImageURIString,\r\n loadError: false,\r\n // 自动化测试\r\n autoTest: false,\r\n setCookieImage: \"\",\r\n verifyCookieImage: \"\",\r\n eventLoad: null as UTSJSONObject | null,\r\n eventError: null as UTSJSONObject | null\r\n }\r\n },\r\n methods: {\r\n error(event : ImageErrorEvent) {\r\n this.loadError = true\r\n console.log(event.type, event.detail);\r\n if (this.autoTest) {\r\n this.eventError = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n // \"errMsg\": event.detail.errMsg\r\n };\r\n }\r\n },\r\n load(event : ImageLoadEvent) {\r\n console.log(event.type, event.detail);\r\n if (this.autoTest) {\r\n this.eventLoad = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"width\": event.detail.width,\r\n \"height\": event.detail.height\r\n };\r\n }\r\n },\r\n imageFormat() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-format'\r\n });\r\n },\r\n imageMode() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-mode'\r\n });\r\n },\r\n imagePath() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-path'\r\n });\r\n },\r\n imageLarge() {\r\n uni.navigateTo({\r\n url: '/pages/component/image/image-large'\r\n });\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.image)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/image.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/image.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=image&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=image&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=image&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=image&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=image)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=image&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"video":{"name":"## video","description":"> 组件类型:[UniVideoElement](/dom/univideoelement.md) \n\n 视频","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| loop | boolean | false | | 是否循环播放 |\n| src | string([string.VideoURIString](/uts/data-type.md#ide-string)) | - | | 视频资源地址 |\n| initial-time | number | 0 | | 指定视频初始播放位置 |\n| duration | number | - | | 指定视频长度 |\n| controls | boolean | true | | 是否显示默认播放控件(播放/暂停按钮、播放进度、时间) |\n| danmu-list | array | - | | 弹幕列表 |\n| danmu-btn | boolean | false | | 是否显示弹幕按钮,只在初始化时有效,不能动态变更 |\n| enable-danmu | boolean | false | | 是否展示弹幕,只在初始化时有效,不能动态变更 |\n| autoplay | boolean | false | | 是否自动播放 |\n| muted | boolean | false | | 是否静音播放 |\n| page-gesture | boolean | false | | 在非全屏模式下,是否开启亮度与音量调节手势 |\n| direction | number | - | | 设置全屏时视频的方向,不指定则根据宽高比自动判断。有效值为 0(正常竖向), 90(屏幕逆时针90度), -90(屏幕顺时针90度) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| 0 | | |\n@| 90 | | |\n@| -90 | | |\n| show-progress | boolean | true | | 若不设置,宽度大于240时才会显示 |\n| show-fullscreen-btn | boolean | true | | 是否显示全屏按钮 |\n| show-play-btn | boolean | true | | 是否显示视频底部控制栏的播放按钮 |\n| show-center-play-btn | boolean | true | | 是否显示视频中间的播放按钮 |\n| show-loading | boolean | true | | 是否显示loading控件 |\n| enable-progress-gesture | boolean | true | | 是否开启控制进度的手势 |\n| object-fit | string | \"contain\" | | 当视频大小与 video 容器大小不一致时,视频的表现形式。 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| contain | | 包含 |\n@| fill | | 填充 |\n@| cover | | 覆盖 |\n| poster | string | - | | 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效 |\n| show-mute-btn | boolean | false | | 是否显示静音按钮 |\n| title | string | - | | 视频的标题,全屏时在顶部展示 |\n| play-btn-position | string | - | | 播放按钮的位置 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| bottom | | |\n@| center | | |\n| enable-play-gesture | boolean | false | | 是否开启播放手势,即双击切换播放、暂停 |\n| auto-pause-if-navigate | boolean | - | | 当跳转到其它页面时,是否自动暂停本页面的视频 |\n| auto-pause-if-open-native | boolean | - | | 当跳转到其它小程序宿主原生页面时,是否自动暂停本页面的视频 |\n| vslide-gesture | boolean | false | | 在非全屏模式下,是否开启亮度与音量调节手势(同 page-gesture) |\n| vslide-gesture-in-fullscreen | boolean | true | | 在全屏模式下,是否开启亮度与音量调节手势 |\n| ad-unit-id | string | - | | 视频前贴广告单元ID |\n| poster-for-crawler | string | - | | 用于给搜索等场景作为视频封面展示,建议使用无播放 icon 的视频封面图,只支持网络地址 |\n| codec | string | \"hardware\" | | 解码器选择 |\n| http-cache | boolean | false | | 是否对 http、https 视频源开启本地缓存 |\n| play-strategy | number | 0 | | 播放策略 |\n| is-live | boolean | - | | 是否为直播源 |\n| @loadedmetadata | (event: [UniVideoLoadedMetadataEvent](#univideoloadedmetadataevent)) => void | - | | 视频元数据加载完成时触发 |\n| @play | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当开始/继续播放时触发 |\n| @pause | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当暂停播放时触发 |\n| @ended | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 当播放到视频末尾时触发 |\n| @timeupdate | (event: [UniVideoTimeUpdateEvent](#univideotimeupdateevent)) => void | - | | 播放进度变化时触发,event.detail = { currentTime, duration }。触发频率 250ms 一次 |\n| @fullscreenchange | (event: [UniVideoFullScreenChangeEvent](#univideofullscreenchangeevent)) => void | - | | 当视频进入和退出全屏时触发,event.detail = { fullScreen, direction },direction取为 vertical 或 horizontal |\n| @waiting | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 视频出现缓冲时触发 |\n| @error | (event: [UniVideoErrorEvent](#univideoerrorevent)) => void | - | | 播放出错时触发 |\n| @progress | (event: [UniVideoProgressEvent](#univideoprogressevent)) => void | - | | 加载进度变化时触发,只支持一段加载。event.detail = { buffered },百分比 |\n| @fullscreenclick | (event: [UniVideoFullScreenClickEvent](#univideofullscreenclickevent)) => void | - | | 视频全屏播放时点击屏幕触发。event.detail = { screenX, screenY, screenWidth, screenHeight } |\n| @controlstoggle | (event: [UniVideoControlsToggleEvent](#univideocontrolstoggleevent)) => void | - | | 切换 controls 显示隐藏时触发。event.detail = { show } |\n| show-bottom-progress | boolean | - | | - |\n| show-casting-button | boolean | - | | - |\n| picture-in-picture-mode | string/Array | - | | *(string/Array)*
设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: \\[\"push\", \"pop\"] |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| [] | | |\n@| push | | |\n@| pop | | |\n| picture-in-picture-show-progress | boolean | - | | - |\n| picture-in-picture-init-position= | string | - | | - |\n| enable-auto-rotation | boolean | - | | - |\n| show-screen-lock-button | boolean | - | | - |\n| show-snapshot-button | boolean | - | | - |\n| show-background-playback-button | boolean | - | | - |\n| background-poster | string | - | | - |\n| referrer-policy | string | - | | *(string)*
格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| origin | | |\n@| no-referrer | | |\n| is-drm | boolean | - | | - |\n| provision-url | string | - | | - |\n| certificate-url | string | - | | - |\n| license-url | string | - | | - |\n| preferred-peak-bit-rate | number | - | | - |\n| @enterpictureinpicture | eventhandler | - | | - |\n| @leavepictureinpicture | eventhandler | - | | - |\n| @seekcomplete | eventhandler | - | | - |\n| @castinguserselect | eventhandler | - | | - |\n| @castingstatechange | eventhandler | - | | - |\n| @castinginterrupt | eventhandler | - | | - |","event":"\n### 事件\n#### UniVideoTimeUpdateEvent\ntimeupdate 事件
播放进度变化时触发\n```mermaid\ngraph LR\n \nUniVideoTimeUpdateEvent -- Extends --> UniVideoEvent\n style UniVideoEvent color:#42b983\n click UniVideoEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#univideoevent\"\n```\n##### UniVideoTimeUpdateEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoTimeUpdateEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| currentTime | number | 是 | - | - | 当前进度 |\n@| duration | number | 是 | - | - | 总进度 |\n\n\n#### UniVideoFullScreenChangeEvent\nfullscreenchange 事件
当视频进入和退出全屏是触发\n```mermaid\ngraph LR\n \nUniVideoFullScreenChangeEvent -- Extends --> UniVideoEvent\n style UniVideoEvent color:#42b983\n click UniVideoEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#univideoevent\"\n```\n##### UniVideoFullScreenChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoFullScreenChangeEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| fullScreen | boolean | 是 | - | - | 是否全屏 |\n@| direction | string | 是 | - | - | 横竖屏,取值 vertical 或 horizontal |\n\n\n#### UniVideoErrorEvent\nerror 事件
视频播放出错时触发\n```mermaid\ngraph LR\n \nUniVideoErrorEvent -- Extends --> UniVideoEvent\n style UniVideoEvent color:#42b983\n click UniVideoEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#univideoevent\"\n```\n##### UniVideoErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **VideoError** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| errCode | number | 是 | - | - | 统一错误码
100001 网络错误
200001 内部错误
300001 SDK错误 |\n@@| 合法值 | 兼容性 | 描述 |\n@@| :- | :-: | :- |\n@@| 100001 | - | - |\n@@| 200001 | - | - |\n@@| 300001 | - | - |\n@| errSubject | string | 是 | - | - | 统一错误主题(模块)名称 |\n@| data | any | 否 | - | - | 错误信息中包含的数据 |\n@| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) | 否 | - | - | 源错误信息,可以包含多个错误,详见SourceError |\n@| errMsg | string | 是 | - | - | - |\n\n\n#### UniVideoProgressEvent\nprogress 事件
加载进度变化时触发\n```mermaid\ngraph LR\n \nUniVideoProgressEvent -- Extends --> UniVideoEvent\n style UniVideoEvent color:#42b983\n click UniVideoEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#univideoevent\"\n```\n##### UniVideoProgressEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoProgressEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| buffered | number | 是 | - | - | 加载进度百分比 |\n\n\n#### UniVideoFullScreenClickEvent\nfullscreenclick 事件
视频播放全屏播放时点击事件\n```mermaid\ngraph LR\n \nUniVideoFullScreenClickEvent -- Extends --> UniVideoEvent\n style UniVideoEvent color:#42b983\n click UniVideoEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#univideoevent\"\n```\n##### UniVideoFullScreenClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoFullScreenClickEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| screenX | number | 是 | - | - | 点击点相对于屏幕左侧边缘的 X 轴坐标 |\n@| screenY | number | 是 | - | - | 点击点相对于屏幕顶部边缘的 Y 轴坐标 |\n@| screenWidth | number | 是 | - | - | 屏幕总宽度 |\n@| screenHeight | number | 是 | - | - | 屏幕总高度 |\n\n\n#### UniVideoControlsToggleEvent\ncontrolstoggle 事件
切换播放控件显示隐藏时触发\n```mermaid\ngraph LR\n \nUniVideoControlsToggleEvent -- Extends --> UniVideoEvent\n style UniVideoEvent color:#42b983\n click UniVideoEvent \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#univideoevent\"\n```\n##### UniVideoControlsToggleEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **UniVideoControlsToggleEventDetail** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| show | boolean | 是 | - | - | 是否显示 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/video/video.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/video/video\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/video/video\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 子组件实现快进、快退、发送弹幕功能(全屏后显示)\r\n \r\n \r\n \r\n \r\n API示例\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 属性示例\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n import { ItemType } from '@/components/enum-data/enum-data-types';\r\n // #ifdef APP-ANDROID\r\n import ViewGroup from 'android.view.ViewGroup';\r\n // #endif\r\n export default {\r\n onReady() {\r\n this.videoContext = uni.createVideoContext('video');\r\n // this.videoContext = uni.createVideoContext('video', this);\r\n },\r\n data() {\r\n return {\r\n videoContext: null as VideoContext | null,\r\n // 属性\r\n src: \"https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4\",\r\n autoplay: false,\r\n loop: false,\r\n muted: false,\r\n initialTime: 0,\r\n duration: 0,\r\n controls: true,\r\n danmuList: [{\r\n text: '要显示的文本',\r\n color: '#FF0000',\r\n time: 3\r\n }, {\r\n text: '要显示的文本2',\r\n color: '#31ff23',\r\n time: 5\r\n }, {\r\n text: '要显示的文本3',\r\n color: '#f13ef8',\r\n time: 7\r\n }, {\r\n text: '要显示的文本4',\r\n color: '#4972f8',\r\n time: 9\r\n }, {\r\n text: '要显示的文本5',\r\n color: '#000000',\r\n time: 11\r\n }] as Array,\r\n danmuBtn: false,\r\n enableDanmu: true,\r\n pageGesture: false,\r\n direction: -1,\r\n directionItemTypes: [{ \"value\": 0, \"name\": \"0(正常竖向)\" }, { \"value\": 1, \"name\": \"90(屏幕逆时针90度)\" }, { \"value\": 2, \"name\": \"-90(屏幕顺时针90度)\" }] as ItemType[],\r\n directionItems: [0, 90, -90],\r\n showProgress: true,\r\n showFullscreenBtn: true,\r\n showPlayBtn: true,\r\n showCenterPlayBtn: true,\r\n showLoading: true,\r\n enableProgressGesture: true,\r\n objectFit: \"contain\",\r\n objectFitItemTypes: [{ \"value\": 0, \"name\": \"contain(包含)\" }, { \"value\": 1, \"name\": \"fill(填充)\" }, { \"value\": 2, \"name\": \"cover(覆盖)\" }] as ItemType[],\r\n objectFitItems: [\"contain\", \"fill\", \"cover\"],\r\n poster: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-android.png\",\r\n showMuteBtn: false,\r\n title: \"video-component\",\r\n enablePlayGesture: false,\r\n vslideGesture: false,\r\n vslideGestureInFullscreen: true,\r\n codec: \"hardware\",\r\n codecItemTypes: [{ \"value\": 0, \"name\": \"hardware(硬解码)\" }, { \"value\": 1, \"name\": \"software(软解码)\" }] as ItemType[],\r\n codecItems: [\"hardware\", \"software\"],\r\n httpCache: true,\r\n playStrategy: 0,\r\n playStrategyItemTypes: [{ \"value\": 0, \"name\": \"0(普通模式)\" }, { \"value\": 1, \"name\": \"1(平滑播放模式)\" }, { \"value\": 1, \"name\": \"2(M3U8优化模式)\" }] as ItemType[],\r\n playStrategyItems: [0, 1, 2],\r\n header: {\r\n 'User-Agent': 'User-Agent test',\r\n 'header': 'header test',\r\n 'cookie': 'cookie test'\r\n } as UTSJSONObject,\r\n // API\r\n pos: 0,\r\n requestFullScreenOptions: null as RequestFullScreenOptions | null,\r\n danmu: {\r\n text: '要显示的文本',\r\n color: '#FF0000'\r\n } as Danmu,\r\n rate: 1,\r\n rateItemTypes: [{ \"value\": 0, \"name\": \"0.5\" }, { \"value\": 1, \"name\": \"0.8\" }, { \"value\": 2, \"name\": \"1.0\" }, { \"value\": 3, \"name\": \"1.25\" }, { \"value\": 4, \"name\": \"1.5\" }] as ItemType[],\r\n rateItems: [0.5, 0.8, 1.0, 1.25, 1.5],\r\n subCompEnable: false,\r\n subCompShow: false,\r\n curPos: 0,\r\n endPos: 0,\r\n // 自动化测试\r\n autoTest: false,\r\n isPlaying: false,\r\n isPause: false,\r\n isError: false,\r\n eventPlay: null as UTSJSONObject | null,\r\n eventPause: null as UTSJSONObject | null,\r\n eventEnded: null as UTSJSONObject | null,\r\n eventTimeupdate: null as UTSJSONObject | null,\r\n eventFullscreenchange: null as UTSJSONObject | null,\r\n eventWaiting: null as UTSJSONObject | null,\r\n eventError: null as UTSJSONObject | null,\r\n eventProgress: null as UTSJSONObject | null,\r\n eventFullscreenclick: null as UTSJSONObject | null,\r\n eventControlstoggle: null as UTSJSONObject | null\r\n }\r\n },\r\n onLoad() {\r\n },\r\n methods: {\r\n // API\r\n play: function () {\r\n console.log(\"play\");\r\n this.videoContext?.play();\r\n },\r\n pause: function () {\r\n console.log(\"pause\");\r\n (uni.getElementById(\"video\") as UniVideoElement).pause(); //as写法测试。注意id不对时as会崩溃\r\n // this.videoContext?.pause();\r\n },\r\n seek: function (pos : number) {\r\n console.log(\"seek -> \" + pos);\r\n this.videoContext?.seek(pos);\r\n },\r\n onSeekInput: function (event : UniInputEvent) {\r\n this.pos = parseInt(event.detail.value);\r\n },\r\n requestFullScreen: function () {\r\n console.log(\"requestFullScreen -> \" + this.requestFullScreenOptions);\r\n this.videoContext?.requestFullScreen(this.requestFullScreenOptions);\r\n },\r\n exitFullScreen: function () {\r\n console.log(\"exitFullScreen\");\r\n this.videoContext?.exitFullScreen();\r\n },\r\n stop: function () {\r\n console.log(\"stop\");\r\n uni.getElementById(\"video\")?.stop(); //泛型写法测试\r\n // this.videoContext?.stop();\r\n },\r\n sendDanmu: function () {\r\n console.log(\"sendDanmu -> \" + this.danmu);\r\n this.videoContext?.sendDanmu(this.danmu);\r\n },\r\n onSendDanmuInput: function (event : UniInputEvent) {\r\n let json = JSON.parse(event.detail.value)\r\n if (json == null) return;\r\n this.danmu = json as Danmu;\r\n },\r\n playbackRate: function () {\r\n console.log(\"playbackRate -> \" + this.rate);\r\n this.videoContext?.playbackRate(this.rate);\r\n },\r\n onPlaybackRateChange: function (value : number) {\r\n this.rate = this.rateItems[value];\r\n },\r\n fastBackward: function () {\r\n let pos = this.curPos - 15;\r\n if (pos < 0) pos = 0;\r\n this.seek(pos);\r\n },\r\n fastForward: function () {\r\n let pos = this.curPos + 15;\r\n if (pos > this.endPos) pos = this.endPos;\r\n this.seek(pos);\r\n },\r\n onSendDanmuConfirm: function (event : UniInputConfirmEvent) {\r\n this.videoContext?.sendDanmu({\r\n text: event.detail.value,\r\n color: '#ff0000'\r\n } as Danmu);\r\n },\r\n onSendDanmuKeyboardHeightChange: function (event : UniInputKeyboardHeightChangeEvent) {\r\n const element = uni.getElementById('input-send-danmu') as UniElement;\r\n if (event.detail.height.toInt() == 0) {\r\n element.style.setProperty('bottom', '50px');\r\n } else {\r\n element.style.setProperty('bottom', event.detail.height + element.getBoundingClientRect().height);\r\n }\r\n },\r\n onSendDanmuBlur: function (_ : UniInputBlurEvent) {\r\n (uni.getElementById('input-send-danmu') as UniElement).style.setProperty('bottom', '50px');\r\n },\r\n // 属性\r\n onSrcComfirm: function (event : UniInputConfirmEvent) {\r\n let value = event.detail.value;\r\n if (value == '') return;\r\n this.src = value;\r\n console.log(\"src -> \" + this.src)\r\n },\r\n onAutoplayChange: function (value : boolean) {\r\n this.autoplay = value;\r\n console.log(\"autoplay -> \" + this.autoplay)\r\n },\r\n onLoopChange: function (value : boolean) {\r\n this.loop = value;\r\n console.log(\"loop -> \" + this.loop)\r\n },\r\n onMutedChange: function (value : boolean) {\r\n this.muted = value;\r\n console.log(\"muted -> \" + this.muted)\r\n },\r\n onInitialTimeComfirm: function (event : UniInputConfirmEvent) {\r\n let value = parseInt(event.detail.value)\r\n if (isNaN(value)) value = 0;\r\n this.initialTime = value;\r\n console.log(\"initialTime -> \" + this.initialTime)\r\n },\r\n onDurationComfirm: function (event : UniInputConfirmEvent) {\r\n let value = parseInt(event.detail.value)\r\n if (isNaN(value)) value = 0;\r\n this.duration = value;\r\n console.log(\"duration -> \" + this.duration)\r\n },\r\n onControlsChange: function (value : boolean) {\r\n this.controls = value;\r\n console.log(\"controls -> \" + this.controls)\r\n },\r\n onEnableDanmuChange: function (value : boolean) {\r\n this.enableDanmu = value;\r\n console.log(\"enableDanmu -> \" + this.enableDanmu)\r\n },\r\n onDanmuBtnChange: function (value : boolean) {\r\n this.danmuBtn = value;\r\n console.log(\"danmuBtn -> \" + this.danmuBtn)\r\n },\r\n onPageGestureChange: function (value : boolean) {\r\n this.pageGesture = value;\r\n console.log(\"pageGesture -> \" + this.pageGesture)\r\n },\r\n onRequestFullScreenDirectionChange: function (value : number) {\r\n let direction = this.directionItems[value];\r\n this.requestFullScreenOptions = {\r\n direction\r\n } as RequestFullScreenOptions;\r\n },\r\n onDirectionChange: function (value : number) {\r\n this.direction = this.directionItems[value];\r\n console.log(\"direction -> \" + this.direction)\r\n },\r\n onShowProgressChange: function (value : boolean) {\r\n this.showProgress = value;\r\n console.log(\"showProgress -> \" + this.showProgress)\r\n },\r\n onShowFullscreenBtnChange: function (value : boolean) {\r\n this.showFullscreenBtn = value;\r\n console.log(\"showFullscreenBtn -> \" + this.showFullscreenBtn)\r\n },\r\n onShowPlayBtnChange: function (value : boolean) {\r\n this.showPlayBtn = value;\r\n console.log(\"showPlayBtn -> \" + this.showPlayBtn)\r\n },\r\n onShowCenterPlayBtnChange: function (value : boolean) {\r\n this.showCenterPlayBtn = value;\r\n console.log(\"showCenterPlayBtn -> \" + this.showCenterPlayBtn)\r\n },\r\n onShowLoadingChange: function (value : boolean) {\r\n this.showLoading = value;\r\n console.log(\"showLoading -> \" + this.showLoading)\r\n },\r\n onEnableProgressGestureChange: function (value : boolean) {\r\n this.enableProgressGesture = value;\r\n console.log(\"enableProgressGesture -> \" + this.enableProgressGesture)\r\n },\r\n onObjectFitChange: function (value : number) {\r\n this.objectFit = this.objectFitItems[value];\r\n console.log(\"objectFit -> \" + this.objectFit)\r\n },\r\n onPosterComfirm: function (event : UniInputConfirmEvent) {\r\n let value = event.detail.value;\r\n if (value == '') return;\r\n this.poster = value;\r\n console.log(\"poster -> \" + this.poster)\r\n },\r\n onShowMuteBtnChange: function (value : boolean) {\r\n this.showMuteBtn = value;\r\n console.log(\"showMuteBtn -> \" + this.showMuteBtn)\r\n },\r\n onTitleComfirm: function (event : UniInputConfirmEvent) {\r\n let value = event.detail.value;\r\n if (value == '') return;\r\n this.title = value;\r\n console.log(\"title -> \" + this.title)\r\n },\r\n onEnablePlayGestureChange: function (value : boolean) {\r\n this.enablePlayGesture = value;\r\n console.log(\"enablePlayGesture -> \" + this.enablePlayGesture)\r\n },\r\n onVslideGestureChange: function (value : boolean) {\r\n this.vslideGesture = value;\r\n console.log(\"vslideGesture -> \" + this.vslideGesture)\r\n },\r\n onVslideGestureInFullscreenChange: function (value : boolean) {\r\n this.vslideGestureInFullscreen = value;\r\n console.log(\"vslideGestureInFullscreen -> \" + this.vslideGestureInFullscreen)\r\n },\r\n onCodecChange: function (value : number) {\r\n this.codec = this.codecItems[value];\r\n console.log(\"codec -> \" + this.codec)\r\n },\r\n onHttpCacheChange: function (value : boolean) {\r\n this.httpCache = value;\r\n console.log(\"httpCache -> \" + this.httpCache)\r\n },\r\n onPlayStrategyChange: function (value : number) {\r\n this.playStrategy = this.playStrategyItems[value];\r\n console.log(\"playStrategy -> \" + this.playStrategy)\r\n },\r\n onHeaderComfirm: function (event : UniInputConfirmEvent) {\r\n let json = JSON.parse(event.detail.value)\r\n if (json == null) return;\r\n this.header = json as UTSJSONObject;\r\n console.log(\"header -> \" + JSON.stringify(this.header))\r\n },\r\n onSubCompEnableChange: function (event : UniSwitchChangeEvent) {\r\n this.subCompEnable = event.detail.value;\r\n },\r\n // 事件\r\n onPlay: function (res : UniEvent) {\r\n console.log(res.type);\r\n this.isPlaying = true;\r\n this.isPause = false;\r\n if (this.autoTest) {\r\n this.eventPlay = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onPause: function (res : UniEvent) {\r\n console.log(res.type);\r\n this.isPlaying = false;\r\n this.isPause = true;\r\n if (this.autoTest) {\r\n this.eventPause = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onEnded: function (res : UniEvent) {\r\n console.log(res.type);\r\n if (this.autoTest) {\r\n this.eventEnded = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onTimeUpdate: function (res : UniVideoTimeUpdateEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n this.curPos = res.detail.currentTime;\r\n this.endPos = res.detail.duration;\r\n if (this.autoTest) {\r\n this.eventTimeupdate = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"currentTime\": Math.trunc(res.detail.currentTime),\r\n \"duration\": Math.trunc(res.detail.duration)\r\n };\r\n }\r\n },\r\n onFullScreenChange: function (res : UniVideoFullScreenChangeEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n this.subCompShow = res.detail.fullScreen;\r\n if (this.autoTest) {\r\n this.eventFullscreenchange = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"fullScreen\": res.detail.fullScreen,\r\n \"direction\": res.detail.direction\r\n };\r\n }\r\n },\r\n onWaiting: function (res : UniEvent) {\r\n console.log(res.type);\r\n if (this.autoTest) {\r\n this.eventWaiting = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type\r\n };\r\n }\r\n },\r\n onError: function (res : UniVideoErrorEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n this.isError = true;\r\n if (this.autoTest) {\r\n this.eventError = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"errCode\": res.detail.errCode\r\n };\r\n }\r\n },\r\n onProgress: function (res : UniVideoProgressEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n if (this.autoTest) {\r\n this.eventProgress = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"isBufferedValid\": res.detail.buffered >= 0\r\n };\r\n }\r\n },\r\n onFullScreenClick: function (res : UniVideoFullScreenClickEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n if (this.autoTest) {\r\n this.eventFullscreenclick = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"screenX\": Math.trunc(res.detail.screenX),\r\n \"screenY\": Math.trunc(res.detail.screenY),\r\n \"screenWidth\": Math.trunc(res.detail.screenWidth),\r\n \"screenHeight\": Math.trunc(res.detail.screenHeight)\r\n };\r\n }\r\n },\r\n onControlsToggle: function (res : UniVideoControlsToggleEvent) {\r\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\r\n if (this.autoTest) {\r\n this.eventControlstoggle = {\r\n \"tagName\": res.target?.tagName,\r\n \"type\": res.type,\r\n \"show\": res.detail.show\r\n };\r\n }\r\n },\r\n // 自动化测试\r\n downloadSource() {\r\n uni.downloadFile({\r\n url: 'https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4',\r\n success: (res) => {\r\n this.src = res.tempFilePath;\r\n },\r\n fail: (_) => {\r\n this.isError = true;\r\n }\r\n })\r\n },\r\n // #ifdef APP-ANDROID\r\n hasSubComponent() : boolean {\r\n const view = uni.getElementById('video')?.getAndroidView();\r\n return view == null ? false : view.getChildAt(0) instanceof ViewGroup;\r\n }\r\n // #endif\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n支持所有组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.video)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/video.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/video.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=video&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=video&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=video&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=video&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=video)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=video&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"animation-view":{"name":"## animation-view","description":"Lottie 动画\n> 本 Component 是 uni ext component,需下载插件:[animation-view](https://ext.dcloud.net.cn/plugin?name=uni-animation-view)\n","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| path | string | \"\" | | 动画资源地址,目前只支持绝对路径 |\n| loop | boolean | false | | 动画是否循环播放 |\n| autoplay | boolean | false | | 动画是否自动播放 |\n| action | string | \"stop\" | | 动画操作,可取值 play、pause、stop |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| play | | 播放 |\n@| pause | | 暂停 |\n@| stop | | 停止 |\n| hidden | boolean | false | | 是否隐藏动画 |\n| @ended | (event: [UniEvent](/component/common.md#unievent)) => void | - | | - |","event":"","example":"","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.animation-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/animation-view.html)\n- [插件市场](https://ext.dcloud.net.cn/plugin?id=10674)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=animation-view&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=animation-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=animation-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=animation-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=animation-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=animation-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=animation-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"live-player":{"name":"## live-player","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| src | string([string.UniLivePlayerURIString](/uts/data-type.md#ide-string)) | - | | 音视频地址。目前仅支持 flv, rtmp 格式 |\n| mode | string | - | | live(直播),RTC(实时通话) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| RTC | | |\n@| live | | |\n| autoplay | boolean | - | | 自动播放 |\n| muted | boolean | - | | 是否静音 |\n| orientation | string | - | | 画面方向,可选值有 vertical,horizontal |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| vertical | | |\n@| horizontal | | |\n| object-fit | string | - | | 填充模式,可选值有 contain,fillCrop |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| contain | | |\n@| fillCrop | | |\n| background-mute | boolean | - | | 进入后台时是否静音 |\n| min-cache | string | - | | 最小缓冲区,单位s |\n| max-cache | string | - | | 最大缓冲区,单位s |\n| @statechange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 播放状态变化事件,detail = {code} |\n| @fullscreenchange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 全屏变化事件,detail = {direction, fullScreen} |\n| @netstatus | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 网络状态通知,detail = {info} |\n| sound-mode | string | - | | *(string)*
声音输出方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| speaker | | |\n@| ear | | |\n| auto-pause-if-navigate | boolean | - | | - |\n| auto-pause-if-open-native | boolean | - | | - |\n| picture-in-picture-mode | string/Array | - | | *(string/Array)*
设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: \\[\"push\", \"pop\"] |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| [] | | |\n@| push | | |\n@| pop | | |\n| picture-in-picture-init-position= | string | - | | - |\n| enable-auto-rotation | boolean | - | | - |\n| referrer-policy | string | - | | *(string)*
格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| origin | | |\n@| no-referrer | | |\n| enable-casting | boolean | - | | - |\n| @audiovolumenotify | eventhandler | - | | - |\n| @enterpictureinpicture | eventhandler | - | | - |\n| @leavepictureinpicture | eventhandler | - | | - |\n| @castinguserselect | eventhandler | - | | - |\n| @castingstatechange | eventhandler | - | | - |\n| @castinginterrupt | eventhandler | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.live.live-player)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/live-player.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html)"},"live-pusher":{"name":"## live-pusher","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| url | string | - | | 推流地址。目前仅支持 flv, rtmp 格式 |\n| mode | string | - | | SD(标清), HD(高清), FHD(超清), RTC(实时通话) |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| RTC | | |\n@| SD | | |\n@| HD | | |\n@| FHD | | |\n@| QVGA | | |\n@| HVGA | | |\n| autopush | boolean | - | | 自动推流 |\n| muted | boolean | - | | 是否静音 |\n| enable-camera | boolean | - | | 开启摄像头 |\n| auto-focus | boolean | - | | 自动获取焦点 |\n| orientation | string | - | | 画面方向,可选值有 vertical,horizontal |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| vertical | | |\n@| horizontal | | |\n| beauty | number | - | | 美颜 |\n| aspect | number | - | | 美白 |\n| min-bitrate | string | - | | 最小码率 |\n| max-bitrate | string | - | | 最大码率 |\n| waiting-image | string | - | | 进入后台时推流的等待画面 |\n| waiting-image-md5 | string | - | | 等待画面资源的MD5值 |\n| background-mute | boolean | - | | 进入后台时是否静音 |\n| @statechange | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 播放状态变化事件,detail = {code} |\n| @error | Any | - | | - |\n| @netstatus | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 网络状态通知,detail = {info} |\n| enableVideoCustomRender | boolean | - | | - |\n| whiteness | number | - | | - |\n| audio-quality | string | - | | - |\n| waiting-image-hash | string | - | | - |\n| zoom | boolean | - | | - |\n| device-position | string | - | | - |\n| mirror | boolean | - | | - |\n| remote-mirror | boolean | - | | - |\n| local-mirror | string | - | | *(string)*
控制本地预览画面是否镜像 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| auto | | |\n@| enable | | |\n@| disable | | |\n| audio-reverb-type | number | - | | *(number)*
音频混响类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| 0 | | |\n@| 1 | | |\n@| 2 | | |\n@| 3 | | |\n@| 4 | | |\n@| 5 | | |\n@| 6 | | |\n@| 7 | | |\n| enable-mic | boolean | - | | - |\n| enable-agc | boolean | - | | - |\n| enable-ans | boolean | - | | - |\n| audio-volume-type | string | - | | *(string)*
音量类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| auto | | |\n@| media | | |\n@| voicecall | | |\n| video-width | number | - | | - |\n| video-height | number | - | | - |\n| beauty-style | string | - | | *(string)*
设置美颜类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| smooth | | |\n@| nature | | |\n| filter | string | - | | *(string)*
设置色彩滤镜 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| standard | | |\n@| pink | | |\n@| nostalgia | | |\n@| blues | | |\n@| romantic | | |\n@| cool | | |\n@| fresher | | |\n@| solor | | |\n@| aestheticism | | |\n@| whitening | | |\n@| cerisered | | |\n| picture-in-picture-mode | string/Array | - | | *(string/Array)*
设置小窗模式: push, pop,空字符串或通过数组形式设置多种模式(如: \\[\"push\", \"pop\"] |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| [] | | |\n@| push | | |\n@| pop | | |\n| voice-changer-type | number | - | | - |\n| custom-effect | boolean | - | | - |\n| skin-whiteness | number | - | | - |\n| skin-smoothness | number | - | | - |\n| face-thinness | number | - | | - |\n| eye-bigness | number | - | | - |\n| fps | number | - | | - |\n| @bgmstart | eventhandle | - | | - |\n| @bgmprogress | eventhandle | - | | - |\n| @bgmcomplete | eventhandle | - | | - |\n| @audiovolumenotify | eventhandle | - | | - |\n| @enterpictureinpicture | eventhandler | - | | - |\n| @leavepictureinpicture | eventhandler | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.media.live.live-pusher)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/live-pusher.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/live-pusher.html)"},"map":{"name":"## map","description":"地图","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 4.31 | 4.31 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| longitude | number | - | | 中心经度 |\n| latitude | number | - | | 中心纬度 |\n| scale | number | - | | 缩放级别,web端取值范围为5-18 , app端取值范围为3-20 |\n| min-scale | number | 3 | | 最小缩放级别 |\n| max-scale | number | 20 | | 最大缩放级别 |\n| layer-style | string | \"1\" | | 个性化地图(如实现地图暗黑模式) |\n| markers | array | - | | 标记点 |\n| covers | array | - | | 即将移除,请使用 markers |\n| polyline | array | - | | 路线 |\n| polygons | array | - | | 多边形 |\n| circles | array | - | | 圆 |\n| controls | array | - | | 控件 |\n| include-points | array | - | | 缩放视野以包含所有给定的坐标点 |\n| show-location | boolean | - | | 显示带有方向的当前定位点 |\n| enable-3D | boolean | false | | 是否显示3D楼块 |\n| show-compass | boolean | false | | 是否显示指南针 |\n| enable-zoom | boolean | true | | 是否支持缩放 |\n| enable-scroll | boolean | true | | 是否支持拖动 |\n| enable-rotate | boolean | false | | 是否支持旋转 |\n| rotate | number | 0 | | 旋转角度(范围0-360)地图正北和设备 y 轴角度的夹角 |\n| skew | number | 0 | | 倾斜角度,范围 0 ~ 40 , 关于 z 轴的倾角 |\n| enable-overlooking | boolean | false | | 是否开启俯视(是否开启手势修改倾斜角度) |\n| enable-satellite | boolean | false | | 是否开启卫星图 |\n| enable-traffic | boolean | false | | 是否开启实时路况 |\n| enable-poi | boolean | false | | 是否展示 POI 点 |\n| enable-building | boolean | false | | 是否展示建筑物 |\n| enable-indoorMap | boolean | false | | 是否展示室内地图 |\n| @markertap | (event: [UniMapMarkerTapEvent](#unimapmarkertapevent)) => void | - | | 点击标记点时触发 |\n| @callouttap | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 点击标记点对应的气泡时触发 |\n| @controltap | (event: [UniMapControlTapEvent](#unimapcontroltapevent)) => void | - | | 点击控件时触发 |\n| @regionchange | (event: [UniMapRegionChangeEvent](#unimapregionchangeevent)) => void | - | | 视野发生变化时触发 |\n| @updated | (event: [UniMapUpdatedEvent](#unimapupdatedevent)) => void | - | | 在地图渲染更新完成时触发 |\n| @tap | (event: [UniMapTapEvent](#unimaptapevent)) => void | - | | 点击地图时触发 |\n| @anchorpointtap | (event: [UniMapAnchorPointTapEvent](#unimapanchorpointtapevent)) => void | - | | 点击定位标时触发 |\n| @poitap | (event: [UniMapPoiTapEvent](#unimappoitapevent)) => void | - | | 点击地图poi点时触发 |\n| subkey | string | - | | - |\n| show-scale | boolean | - | | - |\n| enable-auto-max-overlooking | boolean | - | | - |\n| setting | object | - | | - |\n| @labeltap | eventhandle | - | | - |\n| @polylinetap | eventhandle | - | | - |\n| @abilitysuccess | eventhandle | - | | - |\n| @abilityfail | eventhandle | - | | - |\n| @authsuccess | eventhandle | - | | - |\n| @interpolatepoint | eventhandle | - | | - |\n| @error | eventhandle | - | | - |\n| ~~theme~~ | string | \"normal\" | | 主题(satellite 或 normal) |","event":"\n### 事件\n#### UniMapMarkerTapEvent\n\n```mermaid\ngraph LR\n \nUniMapMarkerTapEvent -- Extends --> UniCustomEvent<UniMapMarkerTapEventDetail>\n style UniCustomEvent<UniMapMarkerTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapMarkerTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapMarkerTapEventDetail\n\n\n###### UniMapMarkerTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| markerId | number | 否 | - | - | |\n\n\n#### UniMapControlTapEvent\n\n```mermaid\ngraph LR\n \nUniMapControlTapEvent -- Extends --> UniCustomEvent<UniMapControlTapEventDetail>\n style UniCustomEvent<UniMapControlTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapControlTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapControlTapEventDetail\n\n\n###### UniMapControlTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| controlId | number | 否 | - | - | |\n\n\n#### UniMapRegionChangeEvent\n\n```mermaid\ngraph LR\n \nUniMapRegionChangeEvent -- Extends --> UniCustomEvent<>\n style UniCustomEvent<> color:#42b983\n click UniCustomEvent<> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapRegionChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| causedBy | string | 否 | - | - | |\n\n\n#### UniMapUpdatedEvent\n\n```mermaid\ngraph LR\n \nUniMapUpdatedEvent -- Extends --> UniCustomEvent<UniMapUpdatedEventDetail>\n style UniCustomEvent<UniMapUpdatedEventDetail> color:#42b983\n click UniCustomEvent<UniMapUpdatedEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n#### UniMapTapEvent\n\n```mermaid\ngraph LR\n \nUniMapTapEvent -- Extends --> UniCustomEvent<UniMapTapEventDetail>\n style UniCustomEvent<UniMapTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapTapEventDetail\n\n\n###### UniMapTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 否 | - | - | |\n| longitude | number | 否 | - | - | |\n\n\n#### UniMapAnchorPointTapEvent\n\n```mermaid\ngraph LR\n \nUniMapAnchorPointTapEvent -- Extends --> UniCustomEvent<UniMapAnchorPointTapEventDetail>\n style UniCustomEvent<UniMapAnchorPointTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapAnchorPointTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapAnchorPointTapEventDetail\n\n\n###### UniMapAnchorPointTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 否 | - | - | |\n| longitude | number | 否 | - | - | |\n\n\n#### UniMapPoiTapEvent\n\n```mermaid\ngraph LR\n \nUniMapPoiTapEvent -- Extends --> UniCustomEvent<UniMapPoiTapEventDetail>\n style UniCustomEvent<UniMapPoiTapEventDetail> color:#42b983\n click UniCustomEvent<UniMapPoiTapEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniMapPoiTapEventDetail\n\n\n###### UniMapPoiTapEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| latitude | number | 否 | - | - | |\n| longitude | number | 否 | - | - | |\n| name | string | 否 | - | - | |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/map/map.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/map/map\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/map/map\n\n>Template\n```vue\n\n \n \n \n 注意:需要正确配置地图服务商的Key才能正常显示地图组件\n \n 属性示例\n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n 方法示例\n \n \n \n \n \n \n \n\n \n \n\n\n\n\n\n\n```\n\n>Script\n```uts\n\n type TypeJestResult = {\n translateMarkerMsg : string,\n animationEnd : boolean,\n centerPoints : LocationObject,\n southwest : LocationObject,\n northeast : LocationObject,\n moveToLocationMsg : string,\n scale : number\n }\n\n const testMarkers :Marker[]= [{\n id: 0,\n latitude: 39.989631,\n longitude: 116.481018,\n title: '方恒国际 阜通东大街6号',\n iconPath: '../../../static/location.png',\n rotate: 0,\n width: 20,\n height: 20,\n anchor: {\n x: 0.5,\n y: 1\n } ,\n callout: {\n content: '方恒国际 阜通东大街6号',\n color: '#00BFFF',\n fontSize: 10,\n borderRadius: 4,\n borderWidth: 1,\n borderColor: '#333300',\n bgColor: '#CCFF99',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 1,\n latitude: 39.9086920000,\n longitude: 116.3974770000,\n title: '天安门',\n // zIndex: '1',\n iconPath: '../../../static/location.png',\n width: 40,\n height: 40,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '首都北京\\n天安门',\n color: '#00BFFF',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#CCFF11',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 2,\n latitude: 39.894793,\n longitude: 116.321592,\n title: '北京西站',\n iconPath: '../../../static/location.png',\n width: 40,\n height: 40,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '北京西站',\n color: '#ffffff',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#ff5500',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 3,\n latitude: 39.902344,\n longitude: 116.484822,\n title: '北京东站',\n iconPath: '../../../static/location.png',\n width: 20,\n height: 20,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '北京东站',\n color: '#ffffff',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#ff5500',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n {\n id: 4,\n latitude: 39.865011,\n longitude: 116.379007,\n title: '北京南站',\n iconPath: '../../../static/location.png',\n width: 40,\n height: 40,\n anchor: {\n x: 0.5,\n y: 1\n },\n callout: {\n content: '北京南站',\n color: '#ffffff',\n fontSize: 12,\n borderRadius: 10,\n borderWidth: 2,\n borderColor: '#333300',\n bgColor: '#00aa00',\n padding: 5,\n display: 'ALWAYS'\n } as MapMarkerCallout\n },\n ];\n\n\n const testPolyline: Polyline[] = [{\n points: [{\n latitude: 39.925539,\n longitude: 116.279037\n },\n {\n latitude: 39.925539,\n longitude: 116.520285\n }],\n color: '#FFCCFF',\n width: 7,\n dottedLine: true,\n arrowLine: true,\n borderColor: '#000000',\n borderWidth: 2\n },\n {\n points: [{\n latitude: 39.938698,\n longitude: 116.275177\n },\n {\n latitude: 39.966069,\n longitude: 116.289253\n },\n {\n latitude: 39.944226,\n longitude: 116.306076\n },\n {\n latitude: 39.966069,\n longitude: 116.322899\n },\n {\n latitude: 39.938698,\n longitude: 116.336975\n }],\n color: '#CCFFFF',\n width: 5,\n dottedLine: false,\n arrowLine: true,\n borderColor: '#CC0000',\n borderWidth: 3\n }\n ];\n\n const testPolygons : Polygon[] = [{\n points: [{\n latitude: 39.781892,\n longitude: 116.293413\n },\n {\n latitude: 39.787600,\n longitude: 116.391842\n },\n {\n latitude: 39.733187,\n longitude: 116.417932\n },\n {\n latitude: 39.704653,\n longitude: 116.338255\n }],\n fillColor: '#FFCCFF',\n strokeWidth: 3,\n strokeColor: '#CC99CC',\n zIndex: 11\n },\n {\n points: [{\n latitude: 39.887600,\n longitude: 116.518932\n },\n {\n latitude: 39.781892,\n longitude: 116.518932\n },\n {\n latitude: 39.781892,\n longitude: 116.428932\n },\n {\n latitude: 39.887600,\n longitude: 116.428932\n }\n ],\n fillColor: '#CCFFFF',\n strokeWidth: 5,\n strokeColor: '#CC0000',\n zIndex: 3\n }\n ];\n\n const testCircles: Circle[] = [{\n latitude: 39.996441,\n longitude: 116.411146,\n radius: 15000,\n strokeWidth: 5,\n color: '#CCFFFF',\n fillColor: '#CC0000'\n },\n {\n latitude: 40.096441,\n longitude: 116.511146,\n radius: 12000,\n strokeWidth: 3,\n color: '#CCFFFF',\n fillColor: '#FFCCFF'\n },\n {\n latitude: 39.896441,\n longitude: 116.311146,\n radius: 9000,\n strokeWidth: 1,\n color: '#CCFFFF',\n fillColor: '#CC0000'\n }\n ];\n\n const testIncludePoints :LocationObject[] = [{\n latitude: 39.989631,\n longitude: 116.481018,\n },\n {\n latitude: 39.9086920000,\n longitude: 116.3974770000,\n }\n ];\n\n\n const mapContext = ref(null as MapContext | null);\n const location = ref({ longitude: 116.39742, latitude: 39.909 } as LocationObject);\n const rotate = ref(0);\n const skew = ref(0);\n // 自动化测试\n const autoTest = ref(false);\n const updateAutoTest = (value : boolean) => {\n autoTest.value = value\n }\n\n\n const jestResult = reactive({\n translateMarkerMsg: \"\",\n animationEnd: false,\n centerPoints: {\n latitude: 0,\n longitude: 0\n },\n southwest: {\n latitude: 0,\n longitude: 0\n },\n northeast: {\n latitude: 0,\n longitude: 0\n },\n moveToLocationMsg: \"\",\n scale: 0,\n } as TypeJestResult);\n\n\n onReady(() => {\n mapContext.value = uni.createMapContext(\"map1\", getCurrentInstance()!.proxy!)\n });\n\n const scale = ref(13);\n const confirm_scale_input = (value : number) => {\n scale.value = value\n };\n\n const controls = ref([] as Control[]);\n const addControls = () => {\n controls.value = [{\n id: 1,\n position: {\n left: 5,\n top: 180,\n width: 30,\n height: 30\n } as ControlPosition,\n iconPath: '../../../static/uni.png',\n clickable: true\n } as Control]\n }\n\n const showLocation = ref(false);\n const enable3D = ref(false);\n const showCompass = ref(false);\n const enableOverlooking = ref(false);\n const enableRotate = ref(false);\n const enableZoom = ref(true);\n const enableScroll = ref(true);\n const enableSatellite = ref(false);\n const enableTraffic = ref(false);\n const change_show_location = (checked : boolean) => {\n showLocation.value = checked\n }\n\n const change_enable_3d = (checked : boolean) => {\n enable3D.value = checked\n }\n\n const change_show_campass = (checked : boolean) => {\n showCompass.value = checked\n }\n\n const change_enable_overlooking = (checked : boolean) => {\n enableOverlooking.value = checked\n }\n\n const change_enable_rotate = (checked : boolean) => {\n enableRotate.value = checked\n }\n\n const change_enable_zoom = (checked : boolean) => {\n enableZoom.value = checked\n }\n\n const change_enable_scroll = (checked : boolean) => {\n enableScroll.value = checked\n }\n\n const change_enable_satellite = (checked : boolean) => {\n enableSatellite.value = checked\n }\n\n const change_enable_traffic = (checked : boolean) => {\n enableTraffic.value = checked\n }\n\n const includePoints = ref([] as LocationObject[]);\n const includePoint = () => {\n includePoints.value = testIncludePoints;\n };\n\n\n let markers = ref([] as Marker[]);\n const addMarkers = () => {\n scale.value = 11\n const temp = JSON.parse(JSON.stringify(testMarkers))!\n markers.value = temp\n };\n\n const removeMarker = () => {\n // #ifdef APP\n mapContext.value?.removeMarkers({markerIds:[4]})\n // #endif\n // #ifdef WEB\n const index = markers.value.findIndex((marker: Marker):boolean=>{\n return marker.id == 4\n });\n if (index != -1) {\n delete markers.value[index].label;\n markers.value.splice(index, 1);\n } else {\n uni.showToast({\n title: '未找到该标记点',\n icon: 'none'\n });\n }\n // #endif\n };\n\n // #ifdef WEB\n const addMarkersLabel = () => {\n markers.value.forEach((marker, index) => {\n marker.label = {\n content: 'Hello Label' + (index + 1),\n color: '#aa00ff',\n fontSize: 12,\n x: 5,\n y: 0,\n borderColor: '#333300',\n borderWidth: 2,\n borderRadius: 20,\n bgColor: '#aaffff',\n padding: 10\n };\n });\n };\n // #endif\n\n\n const polyline = ref([] as Polyline[]);\n const addPolyline = () => {\n scale.value = 11;\n polyline.value = JSON.parse(JSON.stringify(testPolyline))!;\n };\n const removePolyline = () => {\n if (polyline.value.length > 1) {\n polyline.value = JSON.parse(JSON.stringify(testPolyline))!.splice(0, 1);\n }\n };\n\n\n const polygons = ref([] as Polygon[]);\n const addPolygons = () => {\n scale.value = 10;\n polygons.value = JSON.parse(JSON.stringify(testPolygons))!;\n };\n const removePolygon = () => {\n if (polygons.value.length > 1) {\n polygons.value = JSON.parse(JSON.stringify(testPolygons))!.splice(0, 1);\n }\n };\n\n\n const circles = ref([] as Circle[]);\n const addCircles = () => {\n scale.value = 10;\n circles.value = JSON.parse(JSON.stringify(testCircles))!;\n };\n const removeCircle = () => {\n if (circles.value.length > 1) {\n circles.value = JSON.parse(JSON.stringify(testCircles))!.slice(1);\n }\n };\n\n const handleGetCenterLocation = () => {\n mapContext.value?.getCenterLocation({\n success: ret => {\n // console.log('getCenterLocation',ret);\n jestResult.centerPoints = ret;\n if (!autoTest.value) {\n uni.showModal({\n content: JSON.stringify(ret)\n });\n }\n }\n });\n };\n\n const handleGetRegion = () => {\n mapContext.value?.getRegion({\n success: ret => {\n // console.log('getRegion',JSON.stringify(ret));\n jestResult.southwest = ret.southwest;\n jestResult.northeast = ret.northeast\n if (!autoTest.value) {\n uni.showModal({\n content: JSON.stringify(ret)\n });\n }\n }\n });\n };\n\n\n const handleTranslateMarker = () => {\n mapContext.value?.translateMarker({\n markerId: 1,\n destination: {\n latitude: 39.989631,\n longitude: 116.481018\n },\n autoRotate: true,\n rotate: 10,\n duration: 2000,\n moveWithRotate: true,\n // #ifdef WEB\n animationEnd: () => {\n console.log('动画结束');\n jestResult.animationEnd = true;\n },\n // #endif\n success: ret => {\n console.log('handleTranslateMarker',JSON.stringify(ret));\n const result = ret as UTSJSONObject\n jestResult.translateMarkerMsg = result[\"errMsg\"] as string;\n },\n fail: error => {\n console.log(error)\n }\n });\n mapContext.value?.translateMarker({\n markerId: 2,\n destination: {\n latitude: 39.902344,\n longitude: 116.484822,\n },\n autoRotate: true,\n rotate: 0,\n duration: 2000,\n success: ret => {\n console.log('handleTranslateMarker', JSON.stringify(ret));\n },\n fail: error => {\n console.log(error)\n }\n });\n };\n\n\n const handleGetScale = () => {\n mapContext.value?.getScale({\n success: res => {\n // console.log('getScale',res);\n scale.value = res.scale\n jestResult.scale = res.scale\n if (!autoTest.value) {\n uni.showModal({\n content: '当前地图的缩放级别为:' + res.scale\n });\n }\n },\n fail: error => {\n console.log(error)\n },\n });\n };\n\n const handleMoveToLocation = () => {\n mapContext.value?.moveToLocation({\n latitude: 39.909,\n longitude: 116.39742,\n success: res => {\n console.log('moveToLocation',res);\n const result = res as UTSJSONObject\n jestResult.moveToLocationMsg = result[\"errMsg\"] as string;\n\n if (!autoTest.value) {\n uni.showModal({\n content: JSON.stringify(res)\n });\n }\n },\n fail: error => {\n console.log(error)\n }\n });\n };\n\n const handleMoveToMyLocation = () => {\n mapContext.value?.moveToLocation({\n success: res => {\n uni.showModal({\n content: '地图中心已经移动到当前位置'\n })\n },\n fail: error => {\n console.log(error);\n }\n })\n }\n\n const maptap = (e : UniMapTapEvent) => {\n // console.log('点击地图时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n const onmarkertap = (e : UniMapMarkerTapEvent) => {\n // console.log('点击标记点时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n const oncontroltap = (e : UniMapControlTapEvent) => {\n // console.log('点击控件时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n const oncallouttap = (e : UniEvent) => {\n // console.log('点击标记点对应的气泡时触发',e)\n uni.showModal({\n content: JSON.stringify(e)\n });\n };\n\n const onupdated = (e : UniMapUpdatedEvent) => {\n console.log('在地图渲染更新完成时触发', e)\n };\n\n const onregionchange = (e : UniMapRegionChangeEvent) => {\n console.log('视野发生变化时触发', e.detail)\n };\n\n const onpoitap = (e : UniMapPoiTapEvent) => {\n // console.log('点击地图poi点时触发',e)\n uni.showModal({\n content: JSON.stringify(e.detail)\n });\n };\n\n defineExpose({\n jestResult,\n autoTest,\n updateAutoTest,\n addControls,\n addMarkers,\n // #ifdef WEB\n addMarkersLabel,\n // #endif\n removeMarker,\n addPolyline,\n removePolyline,\n addPolygons,\n removePolygon,\n addCircles,\n removeCircle,\n includePoint,\n handleGetCenterLocation,\n handleGetRegion,\n handleTranslateMarker,\n handleMoveToLocation,\n handleGetScale\n })\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.map.map)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/map.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/map.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=map&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=map&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=map&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=map&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=map)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=map&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"canvas":{"name":"## canvas","description":"> 组件类型:[UniCanvasElement](/dom/unicanvaselement.md) \n\n 画布","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.21 | 4.25 | 4.25 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | - |\n| canvas-id | string | - | | - |\n| disable-scroll | boolean | - | | - |\n| @touchstart | eventhandle | - | | - |\n| @touchmove | eventhandle | - | | - |\n| @touchend | eventhandle | - | | - |\n| @touchcancel | eventhandle | - | | - |\n| @longtap | eventhandle | - | | - |\n| @error | eventhandle | - | | - |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/canvas/canvas.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/canvas/canvas\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/canvas/canvas\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n testToBlobResult: {{testToBlobResult}}\r\n \r\n \r\n \r\n 0\">\r\n canvasToDataURL:\r\n {{dataBase64.slice(0,22)}}...\r\n \r\n \r\n \r\n \r\n \r\n CanvasContext API 演示\r\n \r\n \r\n \r\n\r\n \r\n 获取 CanvasContext 结果:\r\n {{testCanvasContext}}\r\n \r\n \r\n 测试 ToDataURL 结果:\r\n {{testToDataURLResult}}\r\n \r\n\r\n \r\n 测试 createImage 结果:\r\n {{testCreateImage}}\r\n \r\n\r\n \r\n 测试 createPath2D 结果:\r\n {{testCreatePath2D}}\r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\r\n\n```\n\n>Script\n```uts\n\r\n function hidpi(canvas : UniCanvasElement) {\r\n const context = canvas.getContext(\"2d\")!;\r\n const dpr = uni.getDeviceInfo().devicePixelRatio ?? 1;\r\n canvas.width = canvas.offsetWidth * dpr;\r\n canvas.height = canvas.offsetHeight * dpr;\r\n context.scale(dpr, dpr);\r\n }\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'Context2D',\r\n canvas: null as UniCanvasElement | null,\r\n canvasContext: null as CanvasContext | null,\r\n renderingContext: null as CanvasRenderingContext2D | null,\r\n canvasWidth: 0,\r\n canvasHeight: 0,\r\n dataBase64: '',\r\n taskId: 0,\r\n lastTime: 0,\r\n frameCount: 0,\r\n // 仅测试\r\n testCanvasContext: false,\r\n testToBlobResult: false,\r\n testToDataURLResult: false,\r\n testCreateCanvasContextAsyncSuccess: false,\r\n testCreateImage: false,\r\n testCreatePath2D: false,\r\n testFrameCount: 0\r\n }\r\n },\r\n onReady() {\r\n // HBuilderX 4.25+\r\n // 异步调用方式, 跨平台写法\r\n uni.createCanvasContextAsync({\r\n id: 'canvas',\r\n component: this,\r\n success: (context : CanvasContext) => {\r\n this.canvasContext = context;\r\n this.renderingContext = context.getContext('2d')!;\r\n this.canvas = this.renderingContext!.canvas;\r\n\r\n hidpi(this.canvas!);\r\n this.canvasWidth = this.canvas!.width;\r\n this.canvasHeight = this.canvas!.height;\r\n\r\n // #ifdef WEB\r\n context.toBlob((blob : Blob) => {\r\n this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg')\r\n }, 'image/jpeg', 0.95)\r\n // #endif\r\n this.testToDataURLResult = context.toDataURL().startsWith('data:image/png;base64')\r\n this.testCanvasContext = true\r\n }\r\n })\r\n\r\n // 同步调用方式,仅支持 app/web\r\n // let canvas = uni.getElementById(\"canvas\") as UniCanvasElement\r\n // this.renderingContext = canvas.getContext(\"2d\")\r\n // hidpi(canvas);\r\n // this.canvas = canvas;\r\n // this.canvasWidth = canvas.width;\r\n // this.canvasHeight = canvas.height;\r\n },\r\n onUnload() {\r\n if (this.taskId > 0) {\r\n this.stopAnimationFrame()\r\n }\r\n },\r\n methods: {\r\n // #ifdef WEB\r\n canvasToBlob() {\r\n this.canvasContext!.toBlob((blob : Blob) => {\r\n this.testToBlobResult = (blob.size > 0 && blob.type == 'image/jpeg')\r\n }, 'image/jpeg', 0.95)\r\n },\r\n // #endif\r\n canvasToDataURL() {\r\n this.dataBase64 = this.canvasContext!.toDataURL()\r\n },\r\n onCreateImage() {\r\n this.renderingContext!.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\r\n let image = this.canvasContext!.createImage();\r\n image.src = \"../../static/logo.png\"\r\n image.onload = () => {\r\n this.testCreateImage = true\r\n this.renderingContext?.drawImage(image, 0, 0, 100, 100);\r\n }\r\n },\r\n onCreatePath2D() {\r\n this.renderingContext!.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\r\n const context = this.renderingContext!\r\n let path2D = this.canvasContext!.createPath2D()\r\n this.testCreatePath2D = true\r\n const amplitude = 64;\r\n const wavelength = 64;\r\n for (let i = 0; i < 5; i++) {\r\n const x1 = 0 + (i * wavelength);\r\n const y1 = 128;\r\n const x2 = x1 + wavelength / 4;\r\n const y2 = y1 - amplitude;\r\n const x3 = x1 + 3 * wavelength / 4;\r\n const y3 = y1 + amplitude;\r\n const x4 = x1 + wavelength;\r\n const y4 = y1;\r\n context.moveTo(x1, y1);\r\n path2D.bezierCurveTo(x2, y2, x3, y3, x4, y4);\r\n }\r\n context.stroke(path2D);\r\n },\r\n startAnimationFrame() {\r\n this.taskId = this.canvasContext!.requestAnimationFrame((timestamp : number) => {\r\n this.testFrameCount++\r\n this.updateFPS(timestamp)\r\n this.startAnimationFrame()\r\n })\r\n },\r\n stopAnimationFrame() {\r\n this.canvasContext!.cancelAnimationFrame(this.taskId)\r\n this.taskId = 0\r\n },\r\n updateFPS(timestamp : number) {\r\n this.frameCount++\r\n if (timestamp - this.lastTime >= 1000) {\r\n const timeOfFrame = (1000 / this.frameCount)\r\n this.renderingContext!.clearRect(0, 0, this.canvasWidth, this.canvasHeight)\r\n this.renderingContext!.fillText(`${this.frameCount} / ${timeOfFrame.toFixed(3)}ms`, 10, 18)\r\n this.frameCount = 0\r\n this.lastTime = timestamp\r\n }\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.canvas.canvas)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/canvas.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=canvas&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=canvas&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=canvas&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=canvas&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=canvas)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=canvas&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"ad":{"name":"## ad","description":"广告","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | 4.31 | 4.31 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| adpid | string | - | | 广告位id,在uniAD官网申请广告位 |\n| @load | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 广告加载成功的回调 |\n| @close | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 广告关闭的回调 |\n| @error | (e:[UniAdErrorEvent](#uniaderrorevent)) => void | - | | 广告加载失败的回调 |\n| unit-id | string | - | | - |\n| ad-intervals | number | - | | - |\n| ad-type | string | - | | - |\n| ad-theme | string | - | | - |","event":"\n### 事件\n#### UniAdErrorEvent\n\n\n##### UniAdErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| detail | **IUniAdError** | 是 | - | - | - |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| errCode | number | 是 | - | - | 错误码
- -5001 广告位标识adpid为空,请传入有效的adpid
- -5002 无效的广告位标识adpid,请使用正确的adpid
- -5003 广告位未开通广告,请在广告平台申请并确保已审核通过
- -5004 无广告模块,打包时请配置要使用的广告模块
- -5005 广告加载失败,请稍后重试
- -5006 广告已经展示过了,请重新加载
- -5007 广告不可用或已过期,请重新请求
- -5008 广告不可用或已过期,请重新请求
- -5009 广告类型不符,请检查后再试
- -5011 打包或开通的渠道,不支持此类型广告
- -5013 广告播放失败,请重新加载 |\n@| errSubject | string | 是 | - | - | 统一错误主题(模块)名称 |\n@| data | any | 否 | - | - | 错误信息中包含的数据 |\n@| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) | 否 | - | - | 源错误信息,可以包含多个错误,详见SourceError |\n@| errMsg | string | 是 | - | - | - |\n| bubbles | boolean | 是 | - | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | - | 是否可以取消 |\n| type | string | 是 | - | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - | 当前组件 |\n| timeStamp | Long | 是 | - | - | 事件发生时的时间戳 |\n\n\n##### UniAdErrorEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| stopPropagation | () => void | 是 | - | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | - | 阻止当前事件的默认行为 |\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/ad/ad.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n\n::: preview\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/ad/ad\n```uvue\n\r\n \r\n \r\n \r\n 信息流广告加载失败,请退出当前页面重试。\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.ad.ad)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/ad.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/ad.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=ad&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=ad&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=ad&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=ad&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=ad)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=ad&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"web-view":{"name":"## web-view","description":"> 组件类型:[UniWebViewElement](/dom/uniwebviewelement.md) \n\n 承载网页的容器","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.9 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| src | string([string.HTMLURIString](/uts/data-type.md#ide-string)) | - | | webview 指向网页的链接 |\n| allow | string | - | | 用于为 [iframe](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/iframe) 指定其[特征策略](https://developer.mozilla.org/zh-CN/docs/Web/HTTP/策略特征) |\n| sandbox | string | - | | 该属性对呈现在 [iframe](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/iframe) 框架中的内容启用一些额外的限制条件。 |\n| fullscreen | boolean | - | | 是否铺满整个页面,默认值:`true`。 |\n| webview-styles | **WebViewStyles** | {\"progress\":{\"color\":\"#00FF00\"}} | | webview 网络地址页面加载进度条样式 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| progress | [WebViewProgressStyles](#webviewprogressstyles-values) \\\\| boolean | 是 | false | - | 网络地址页面加载进度条样式,设置为 false 时表示不显示加载进度条。 |\n@\n| horizontalScrollBarAccess | boolean | true | | 设置是否显示横向滚动条 |\n| verticalScrollBarAccess | boolean | true | | 设置是否显示纵向滚动条 |\n| @message | (event: [UniWebViewMessageEvent](#uniwebviewmessageevent)) => void | - | | 网页向应用 postMessage 时触发。e.detail = { data } |\n| @error | (event: [UniWebViewErrorEvent](#uniwebviewerrorevent)) => void | - | | 网页加载错误时触发。e.detail = { errSubject, errCode, errMsg, url, fullUrl, src } |\n| @load | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | | 网页加载完成后触发。e.detail = { url, src } |\n| @loading | (event: [UniWebViewLoadingEvent](#uniwebviewloadingevent)) => void | - | | 网页加载中触发。e.detail = { url, src } |\n| @download | (event: [UniWebViewDownloadEvent](#uniwebviewdownloadevent)) => void | - | | 点击网页中可下载链接时触发。e.detail = { url, userAgent, contentDisposition, mimetype, contentLength } |\n| ~~@loaded~~ | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | | 网页加载完成后触发。e.detail = { url, src }。已废弃,请改用load |","event":"\n### 事件\n#### UniWebViewMessageEvent\n\n```mermaid\ngraph LR\n \nUniWebViewMessageEvent -- Extends --> UniCustomEvent<UniWebViewMessageEventDetail>\n style UniCustomEvent<UniWebViewMessageEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewMessageEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewMessageEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值message |\n\n\n##### UniWebViewMessageEventDetail\n\n\n###### UniWebViewMessageEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| data | UTSJSONObject[\\] | 是 | - | - | 消息包含的数据,4.13版本之前类型为Map\\ \\| null,4.13版本(含)之后类型为Array\\ |\n\n\n#### UniWebViewErrorEvent\n\n```mermaid\ngraph LR\n \nUniWebViewErrorEvent -- Extends --> UniCustomEvent<UniWebViewErrorEventDetail>\n style UniCustomEvent<UniWebViewErrorEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewErrorEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值error |\n\n\n##### UniWebViewErrorEventDetail\n\n\n###### UniWebViewErrorEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| errSubject | string | 是 | - | - | 统一错误主题(模块)名称,固定值uni-web-view |\n| errCode | number | 是 | - | - | 统一错误码
100001 ssl error
100002 page error
100003 http error |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| 100001 | - | - |\n@| 100002 | - | - |\n@| 100003 | - | - |\n| errMsg | string | 是 | - | - | 统一错误描述信息 |\n| url | string | 是 | - | - | 加载错误的网页链接,非完整链接,仅包含scheme://authority部分,4.13版本起支持 |\n| fullUrl | string | 是 | - | - | 加载错误的网页链接,完整链接,4.13版本起支持 |\n| src | string | 是 | - | - | 加载错误的网页链接,完整链接,4.13版本起支持 |\n\n\n#### UniWebViewLoadEvent\n\n```mermaid\ngraph LR\n \nUniWebViewLoadEvent -- Extends --> UniCustomEvent<UniWebViewLoadEventDetail>\n style UniCustomEvent<UniWebViewLoadEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewLoadEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值load |\n\n\n##### UniWebViewLoadEventDetail\n\n\n###### UniWebViewLoadEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| ~~url~~ | string | 是 | - | - | 加载完成的网页链接 |\n| src | string | 是 | - | - | 加载完成的网页链接,4.13版本起支持 |\n\n\n#### UniWebViewLoadingEvent\n\n```mermaid\ngraph LR\n \nUniWebViewLoadingEvent -- Extends --> UniCustomEvent<UniWebViewLoadingEventDetail>\n style UniCustomEvent<UniWebViewLoadingEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewLoadingEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewLoadingEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值loading |\n\n\n##### UniWebViewLoadingEventDetail\n\n\n###### UniWebViewLoadingEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| ~~url~~ | string | 是 | - | - | 加载中的网页链接 |\n| src | string | 是 | - | - | 加载中的网页链接,4.13版本起支持 |\n\n\n#### UniWebViewDownloadEvent\n\n```mermaid\ngraph LR\n \nUniWebViewDownloadEvent -- Extends --> UniCustomEvent<UniWebViewDownloadEventDetail>\n style UniCustomEvent<UniWebViewDownloadEventDetail> color:#42b983\n click UniCustomEvent<UniWebViewDownloadEventDetail> \"https://doc.dcloud.net.cn/uni-app-x/component/common.html#unicustomevent\"\n```\n##### UniWebViewDownloadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| type | string | 是 | - | - | 事件类型,固定值download |\n\n\n##### UniWebViewDownloadEventDetail\n\n\n###### UniWebViewDownloadEventDetail 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| url | string | 是 | - | - | 下载链接 |\n| userAgent | string | 是 | - | - | 用户代理 |\n| contentDisposition | string | 是 | - | - | 指示回复的内容该以何种形式展示,是以内联的形式(即网页或者页面的一部分),还是以附件的形式下载并保存到本地 |\n| mimetype | string | 是 | - | - | 媒体类型 |\n| contentLength | number | 是 | - | - | 文件大小 |\n\n","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/web-view/web-view.uvue) \n::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/web-view/web-view\n\n> appRedirect https://hellouniappx.dcloud.net.cn/appredirect.html?path=pages/component/web-view/web-view\n\n>Template\n```vue\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 显示横向滚动条\r\n \r\n \r\n \r\n 显示竖向滚动条\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n 前进、后退功能在Windows端需要打自定义基座,MAC端需要配置Xcode环境后进行真机运行或者打自定义基座\r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```\n\n>Script\n```uts\n\r\n // #ifdef APP\r\n import { canWebViewGoBack, canWebViewGoForward, hasNativeView } from '@/uni_modules/uts-get-native-view';\r\n // #endif\r\n export default {\r\n data() {\r\n return {\r\n src: 'https://www.dcloud.io',\r\n webview_styles: {\r\n progress: {\r\n color: '#FF3333'\r\n }\r\n },\r\n webviewContext: null as WebviewContext | null,\r\n webviewElement: null as UniWebViewElement | null,\r\n loadError: false,\r\n horizontalScrollBarAccess: true,\r\n verticalScrollBarAccess: true,\r\n canGoBack: false,\r\n canGoForward: false,\r\n // 自动化测试\r\n autoTest: false,\r\n eventLoading: null as UTSJSONObject | null,\r\n eventLoad: null as UTSJSONObject | null,\r\n eventError: null as UTSJSONObject | null,\r\n pointerEvents: 'auto',\r\n isTouchEnable: false\r\n }\r\n },\r\n onReady() {\r\n // #ifdef APP\r\n // TODO web 实现createWebviewContext\r\n this.webviewContext = uni.createWebviewContext('web-view', this)\r\n this.webviewElement = uni.getElementById('web-view') as UniWebViewElement //推荐使用element,功能更丰富\r\n // console.log('url: ',this.webviewElement?.getAttribute(\"src\"));\r\n // this.webviewElement?.setAttribute(\"src\",\"https://ext.dcloud.net.cn/\")\r\n // #endif\r\n },\r\n methods: {\r\n getPackageName() : string {\r\n let packageName : string = \"\"\r\n\r\n // #ifdef APP-IOS\r\n const res = uni.getAppBaseInfo();\r\n packageName = res.bundleId\r\n // #endif\r\n\r\n return packageName\r\n },\r\n isProd() : boolean {\r\n if (this.getPackageName() == 'io.dcloud.hellouniappx') {\r\n return true\r\n }\r\n return false\r\n },\r\n back() {\r\n this.webviewContext?.back();\r\n },\r\n forward() {\r\n this.webviewContext?.forward();\r\n },\r\n reload() {\r\n this.webviewContext?.reload();\r\n // this.webviewElement?.reload();\r\n },\r\n stop() {\r\n this.webviewContext?.stop();\r\n },\r\n nativeToWeb() {\r\n this.webviewContext?.evalJS(\"alert('hello uni-app x')\");\r\n },\r\n message(event : UniWebViewMessageEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n },\r\n error(event : UniWebViewErrorEvent) {\r\n this.loadError = true\r\n console.log(JSON.stringify(event.detail));\r\n if (this.autoTest) {\r\n this.eventError = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"errCode\": event.detail.errCode,\r\n \"errMsg\": event.detail.errMsg,\r\n \"url\": event.detail.url,\r\n \"fullUrl\": event.detail.fullUrl,\r\n \"src\": event.detail.src\r\n };\r\n }\r\n },\r\n loading(event : UniWebViewLoadingEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n if (this.autoTest) {\r\n this.eventLoading = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"src\": event.detail.src\r\n };\r\n }\r\n },\r\n load(event : UniWebViewLoadEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n // #ifdef APP\r\n this.canGoBack = canWebViewGoBack('web-view');\r\n this.canGoForward = canWebViewGoForward('web-view');\r\n // #endif\r\n if (this.autoTest) {\r\n this.eventLoad = {\r\n \"tagName\": event.target?.tagName,\r\n \"type\": event.type,\r\n \"src\": event.detail.src\r\n };\r\n }\r\n },\r\n download(event : UniWebViewDownloadEvent) {\r\n console.log(JSON.stringify(event.detail));\r\n uni.showModal({\r\n content: \"下载链接: \" + event.detail.url + \"\\n文件大小: \" + event.detail.contentLength / 1024 + \"KB\",\r\n showCancel: false\r\n });\r\n },\r\n confirm(event : UniInputConfirmEvent) {\r\n let url = event.detail.value;\r\n if (!url.startsWith('https://') && !url.startsWith('http://')) {\r\n url = 'https://' + url;\r\n }\r\n this.src = url;\r\n },\r\n changeHorizontalScrollBarAccess(event : UniSwitchChangeEvent) {\r\n this.horizontalScrollBarAccess = event.detail.value;\r\n },\r\n changeVerticalScrollBarAccess(event : UniSwitchChangeEvent) {\r\n this.verticalScrollBarAccess = event.detail.value;\r\n },\r\n // 自动化测试\r\n touchstart(event : UniTouchEvent) {\r\n if (this.autoTest) {\r\n this.isTouchEnable = event.touches[0].clientX > 0 && event.touches[0].clientY > 0;\r\n }\r\n },\r\n tap(event : UniPointerEvent) {\r\n if (this.autoTest) {\r\n this.isTouchEnable = event.clientX > 0 && event.clientY > 0;\r\n }\r\n },\r\n getWindowInfo() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n //自动化测试专用\r\n checkNativeWebView() : boolean {\r\n // #ifdef APP\r\n return hasNativeView('web-view')\r\n // #endif\r\n // #ifdef WEB\r\n return true\r\n // #endif\r\n }\r\n }\r\n }\r\n\n```\n\n:::","children":"### 子组件 @children-tags\n不可以嵌套组件","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.web-view.web-view)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/web-view.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=web-view&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=web-view&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=web-view&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=web-view&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=web-view)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=web-view&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"page-meta":{"name":"## page-meta","description":"页面元数据,用于设置页面的一些属性,如背景色、下拉刷新等","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| background-text-style | string | - | | 下拉背景字体、loading 图的样式,仅支持 dark 和 light |\n| background-color | string | - | | 窗口的背景色,必须为十六进制颜色值 |\n| background-color-top | string | - | | 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 |\n| background-color-bottom | string | - | | 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 |\n| scroll-top | string | - | | 滚动位置,可以使用 px 或者 rpx 为单位,在被设置时,页面会滚动到对应位置 |\n| scroll-duration | number | - | | 滚动动画时长 |\n| page-style | string | - | | 页面根节点样式,页面根节点是所有页面节点的祖先节点,相当于 HTML 中的 body 节点 |\n| root-font-size | string | - | | 页面的根字体大小,页面中的所有 rem 单位,将使用这个字体大小作为参考值,即 1rem 等于这个字体大小 |\n| enable-pull-down-refresh | boolean | - | | 是否开启下拉刷新 |\n| @resize | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 页面尺寸变化时会触发 resize 事件, event.detail = { size: { windowWidth, windowHeight } } |\n| @scroll | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 页面滚动时会触发 scroll 事件, event.detail = { scrollTop } |\n| @scrolldone | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 如果通过改变 scroll-top 属性来使页面滚动,页面滚动结束后会触发 scrolldone 事件 |\n| root-background-color | string | - | | - |\n| page-font-size | string | - | | - |\n| page-orientation | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.page-meta.page-meta)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/page-meta.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/page-meta.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=page-meta&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=page-meta&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=page-meta&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=page-meta&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=page-meta)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=page-meta&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"navigation-bar":{"name":"## navigation-bar","description":"页面导航条配置节点","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| title | string | - | | 导航条标题 |\n| title-icon | string | - | | 标题icon |\n| titleIcon-radius | string | - | | 标题icon圆角 |\n| subtitle-text | string | - | | - |\n| subtitle-size | string | - | | - |\n| subtitle-color | string | - | | - |\n| subtitle-overflow | string | - | | - |\n| title-align | string | - | | - |\n| background-image | string | - | | - |\n| background-repeat | string | - | | - |\n| blur-effect | string | - | | - |\n| loading | string | - | | 是否在导航条显示 loading 加载提示 |\n| front-color | string | - | | 导航条前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 |\n| background-color | string | - | | 导航条背景颜色值,有效值为十六进制颜色 |\n| color-animation-duration | number | - | | 改变导航栏颜色时的动画时长,默认为 0 (即没有动画效果) |\n| color-animation-timing-func | string | - | | 改变导航栏颜色时的动画方式,支持 linear 、 easeIn 、 easeOut 和 easeInOut |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.page-meta.navigation-bar)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/navigation-bar.html)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/navigation-bar.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=navigation-bar&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=navigation-bar&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=navigation-bar&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=navigation-bar&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=navigation-bar)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=navigation-bar&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"custom-tab-bar":{"name":"## custom-tab-bar","description":"自定义tabBar","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.24 | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| direction | string | - | | 选项的排列方向 |\n| show-icon | boolean | - | | 是否显示icon |\n| selected | number | - | | 选中的tabBar选项索引值 |\n| @onTabItemTap | (event: [OnTabItemTapOption](#ontabitemtapoption)) => void | - | | 点击自定义 tabBar 触发事件,detail = {index, pagePath, text} |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.page-meta.custom-tab-bar)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/component/custom-tab-bar.html)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=custom-tab-bar&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=custom-tab-bar&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=custom-tab-bar&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=custom-tab-bar&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=custom-tab-bar&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=custom-tab-bar)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=custom-tab-bar&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"},"unicloud-db":{"name":"## unicloud-db","description":"> 组件类型:[UniCloudDBElement](#uniclouddbelement) \n\n 是一个数据库查询组件,它将clientDB的API封装为组件,进一步减少开发者使用所需的代码量。","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | 3.93 | 4.11 |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| v-slot:default | string | - | | {data, loading, hasMore, pagination, error} |\n| collection | string([string.DBCollectionString](/uts/data-type.md#ide-string)) | - | | 表名 |\n| field | string([string.DBFieldString](/uts/data-type.md#ide-string)) | - | | 查询字段,多个字段用 `,` 分割 |\n| where | string([string.JQLString](/uts/data-type.md#ide-string)) | - | | 查询条件 |\n| orderby | string | - | | 排序字段及正序倒叙设置 |\n| groupby | string | - | | 对数据进行分组 |\n| group-field | string | - | | 对数据进行分组统计 |\n| distinct | boolean | - | | 是否对数据查询结果中重复的记录进行去重 |\n| page-data | string | - | | add 多次查询的集合, replace 当前查询的集合 |\n| page-current | number | - | | 当前页 |\n| page-size | number | - | | 每页数据数量 |\n| getone | boolean | - | | 指定查询结果是否返回数组第一条数据,默认 false。在false情况下返回的是数组,即便只有一条结果,也需要\\[0]方式获取。在true下,直接返回结果数据,少一层数组 |\n| getcount | boolean | - | | 是否查询总数量 |\n| gettree | boolean | - | | 是否查询树状结构数据 |\n| startwith | string | - | | gettree的第一层级条件,此初始条件可以省略,不传startWith时默认从最顶级开始查询 |\n| limitlevel | number | - | | gettree查询返回的树的最大层级。超过设定层级的节点不会返回。默认10级,最大15,最小1 |\n| manual | boolean | - | | 是否手动加载数据,默认为 false,页面onLoad时自动联网加载数据 |\n| loadtime | string | - | | 加载数据时机,默认auto,可选值 auto\\|onready\\|manual |\n| @load | (data : Array\\, ended : boolean, pagination : [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | - | | 成功回调。如联网返回结果后,想修改下数据再渲染界面,则在本方法里对data进行修改 |\n| @error | (event: [UniEvent](/component/common.md#unievent)) => void | - | | 失败回调 |\n| ~~action~~ | string([string.ClientDBActionString](/uts/data-type.md#ide-string)) | - | | 云端执行数据库查询的前或后,触发某个action函数操作,进行预处理或后处理(推荐改用JQL触发器) |","event":"","example":"### 示例\n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha//pages/component/unicloud-db/unicloud-db.uvue) \n>\n> 该 API 不支持 Web,请运行 hello uni-app x 到 App 平台体验 \n```uvue\n\r\n \r\n \r\n 0\" ref=\"listView\" class=\"list\" :scroll-y=\"true\" @scrolltolower=\"loadMore()\">\r\n \r\n \r\n {{item}}\r\n \r\n \r\n ❌\r\n \r\n \r\n \r\n Loading...\r\n {{error.errMsg}}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n\r\n\r\n\n\n```","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.unicloud.unicloud-db)\n- [unicloud-db组件教程](https://doc.dcloud.net.cn/uniCloud/unicloud-db.html)\n- [微信小程序文档](https://developers.weixin.qq.com/doc/search.html?source=enter&query=unicloud-db&doc_type=miniprogram)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=unicloud-db&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=unicloud-db&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=unicloud-db&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=unicloud-db&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=unicloud-db)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=unicloud-db&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)","component_type":"### UniCloudDBElement\n\n#### UniCloudDBElement 的属性值\n| 名称 | 类型 | 必填 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| dataList | Array\\ | 是 | - | 已加载的数据 |\n#### UniCloudDBElement 的方法\n##### loadData(options?: UTSJSONObject \\| null): void @loaddata\n加载数据\n当 \\ 组件的 manual 属性设为 true 或者 loadtime 属性设置为 manual 时,不会在页面初始化时联网查询数据,此时需要通过本方法在需要的时候手动加载数据。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| options | **UniCloudDBComponentLoadDataOptions** | 否 | - | - | 可选参数 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| clear | boolean | 否 | false | - | 是否清空数据 |\n@| current | number | 否 | - | - | 当前第几页 |\n@| success | (res?: T) => void | 否 | - | - | 成功回调 |\n@| fail | (err?: any) => void | 否 | - | - | 失败回调 |\n@| complete | () => void | 否 | - | - | 完成回调 | \n\n\n###### loadData 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### loadMore(): void @loadmore\n加载更多数据\n在列表的加载下一页场景下,使用ref方式访问组件方法,加载更多数据,每加载成功一次,当前页 +1\n\n\n###### loadMore 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### add(value: UTSJSONObject, options?: UTSJSONObject \\| null): void @add\n新增数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| value | UTSJSONObject | 是 | - | - | 新增数据. |\n| options | **UniCloudDBComponentAddOptions** | 否 | - | - | 可选参数 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| showToast | boolean | 否 | true | - | 是否显示 Toast |\n@| toastTitle | string | 否 | - | - | Toast 标题 |\n@| needLoading | boolean | 否 | true | - | 是否需要 Loading |\n@| loadingTitle | string | 否 | - | - | Loading 标题 |\n@| success | (res?: T) => void | 否 | - | - | 成功回调 |\n@| fail | (err?: any) => void | 否 | - | - | 失败回调 |\n@| complete | () => void | 否 | - | - | 完成回调 | \n\n\n###### add 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### remove(): void @remove\n移除数据\n\n\n###### remove 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### remove(): void @remove\n移除数据\n\n\n###### remove 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n\n##### update(id: string, value: UTSJSONObject, options?: UTSJSONObject \\| null): void @update\n更新数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :- | :-: | :- |\n| id | string | 是 | - | - | 数据库字段的唯一标识. |\n| value | UTSJSONObject | 是 | - | - | 需要修改的新数据. |\n| options | **UniCloudDBComponentUpdateOptions** | 否 | - | - | 可选参数 |\n@| 名称 | 类型 | 必备 | 默认值 | 兼容性 | 描述 |\n@| :- | :- | :- | :- | :-: | :- |\n@| showToast | boolean | 否 | true | - | 是否显示更新后 Toast |\n@| toastTitle | string | 否 | \"\" | - | 更新成功后 Toast 标题 |\n@| confirmTitle | string | 否 | - | - | 确认框标题 |\n@| confirmContent | string | 否 | - | - | 确认框内容 |\n@| needConfirm | boolean | 否 | true | - | 是否显示更新确认框 |\n@| needLoading | boolean | 否 | true | - | 是否需要 Loading |\n@| loadingTitle | string | 否 | - | - | Loading 标题 |\n@| success | (res?: T) => void | 否 | - | - | 成功回调 |\n@| fail | (err?: any) => void | 否 | - | - | 失败回调 |\n@| complete | () => void | 否 | - | - | 完成回调 | \n\n\n###### update 兼容性 \n| Web | Android | iOS |\n| :- | :- | :- |\n| - | - | - |\n\n"},"double-tap-gesture-handler":{"name":"## double-tap-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.double-tap-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/double-tap-gesture-handler.html)"},"force-press-gesture-handler":{"name":"## force-press-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| pressure | | 压力大小 |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.force-press-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/force-press-gesture-handler.html)"},"horizontal-drag-gesture-handler":{"name":"## horizontal-drag-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| deltaX | | 相对上一次,X 轴方向移动的坐标 |\n@| deltaY | | 相对上一次,Y 轴方向移动的坐标 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.horizontal-drag-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/horizontal-drag-gesture-handler.html)"},"long-press-gesture-handler":{"name":"## long-press-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| translationX | | 相对于初始触摸点的 X 轴偏移量 |\n@| translationY | | 相对于初始触摸点的 Y 轴偏移量 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.long-press-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/long-press-gesture-handler.html)"},"pan-gesture-handler":{"name":"## pan-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| deltaX | | 相对上一次,X 轴方向移动的坐标 |\n@| deltaY | | 相对上一次,Y 轴方向移动的坐标 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.pan-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/pan-gesture-handler.html)"},"scale-gesture-handler":{"name":"## scale-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| focalX | | 中心点相对于全局的X坐标 |\n@| focalY | | 中心点相对于全局的Y坐标 |\n@| focalDeltaX | | 相对上一次,中心点在X轴方向移动的坐标 |\n@| focalDeltaY | | 相对上一次,中心点在Y轴方向移动的坐标 |\n@| scale | | 放大或缩小的比例 |\n@| horizontalScale | | scale的横向分量 |\n@| verticalScale | | scale的纵向分量 |\n@| rotation | | 旋转角(单位:弧度) |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n@| pointerCount | | 跟踪的手指数 |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.scale-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/scale-gesture-handler.html)"},"tap-gesture-handler":{"name":"## tap-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.tap-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/tap-gesture-handler.html)"},"vertical-drag-gesture-handler":{"name":"## vertical-drag-gesture-handler","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| tag | string | - | | - |\n| worklet:ongesture | eventhandler | - | | *(eventhandler)*
手势识别成功的回调 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| state | | 手势状态 |\n@| absoluteX | | 相对于全局的 X 坐标 |\n@| absoluteY | | 相对于全局的 Y 坐标 |\n@| deltaX | | 相对上一次,X 轴方向移动的坐标 |\n@| deltaY | | 相对上一次,Y 轴方向移动的坐标 |\n@| velocityX | | 手指离开屏幕时的横向速度(pixel per second) |\n@| velocityY | | 手指离开屏幕时的纵向速度(pixel per second) |\n| worklet:should-response-on-move | callback | - | | - |\n| worklet:should-accept-gesture | callback | - | | - |\n| simultaneous-handlers | Array.<string> | - | | - |\n| native-view | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.vertical-drag-gesture-handler)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/vertical-drag-gesture-handler.html)"},"draggable-sheet":{"name":"## draggable-sheet","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| initial-child-size | number | - | | - |\n| min-child-size | number | - | | - |\n| max-child-size | number | - | | - |\n| snap | boolean | - | | - |\n| snap-sizes | Array.<number> | - | | - |\n| worklet:onsizeupdate | worklet | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.draggable-sheet)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/draggable-sheet.html)"},"grid-builder":{"name":"## grid-builder","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| padding | Array | - | | - |\n| list | Array | - | | - |\n| child-count | Array | - | | - |\n| type | string | - | | *(string)*
布局方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| aligned | | |\n@| masonry | | |\n| cross-axis-count | number | - | | - |\n| max-cross-axis-extent | number | - | | - |\n| main-axis-gap | number | - | | - |\n| cross-axis-gap | number | - | | - |\n| @itembuild | eventhandle | - | | - |\n| @itemdispose | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.grid-builder)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/grid-builder.html)"},"grid-view":{"name":"## grid-view","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| type | string | - | | *(string)*
布局方式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| aligned | | |\n@| masonry | | |\n| cross-axis-count | number | - | | - |\n| max-cross-axis-extent | number | - | | - |\n| main-axis-gap | number | - | | - |\n| cross-axis-gap | number | - | | - |\n| padding | Array | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.grid-view)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/grid-view.html)"},"list-builder":{"name":"## list-builder","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| padding | Array | - | | - |\n| type | string | - | | *(string)*
类型,默认为定高模式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| static | | |\n@| dynamic | | |\n| list | Array | - | | - |\n| child-count | Array | - | | - |\n| child-height | Array | - | | - |\n| @itembuild | eventhandle | - | | - |\n| @itemdispose | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.list-builder)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/list-builder.html)"},"open-container":{"name":"## open-container","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| closed-color | string | - | | - |\n| closed-elevation | number | - | | - |\n| closed-border-radius | number | - | | - |\n| middle-color | string | - | | - |\n| open-color | string | - | | - |\n| open-elevation | number | - | | - |\n| open-border-radius | number | - | | - |\n| transition-duration | number | - | | - |\n| transition-type | string | - | | *(string)*
动画类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| fade | | |\n@| fadeThrough | | |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.open-container)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/open-container.html)"},"share-element":{"name":"## share-element","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| key | string | - | | - |\n| transform | boolean | - | | - |\n| duration | number | - | | - |\n| easing-function | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.share-element)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/share-element.html)"},"snapshot":{"name":"## snapshot","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| mode | string | - | | *(string)*
渲染模式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| view | | |\n@| picture | | |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.snapshot)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/snapshot.html)"},"span":{"name":"## span","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.skyline.span)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/span.html)"},"ad-custom":{"name":"## ad-custom","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| unit-id | string | - | | - |\n| ad-intervals | number | - | | - |\n| @load | eventhandle | - | | - |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.ad-custom)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/ad-custom.html)"},"official-account":{"name":"## official-account","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.official-account)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/official-account.html)"},"store-home":{"name":"## store-home","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| appid | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.store-home)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/store-home.html)"},"store-product":{"name":"## store-product","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| appid | string | - | | - |\n| product-id | string | - | | - |\n| product-promotion-link | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.open-ability.store-product)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/store-product.html)"},"aria-component":{"name":"## aria-component","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.aria-component)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/aria-component.html)"},"native-component":{"name":"## native-component","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.native-component)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/native-component.html)"},"channel-live":{"name":"## channel-live","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| feed-id | string | - | | - |\n| finder-user-name | string | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.channel-live)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/channel-live.html)"},"channel-video":{"name":"## channel-video","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| feed-id | string | - | | - |\n| finder-user-name | string | - | | - |\n| feed-token | string | - | | - |\n| autoplay | string | - | | - |\n| loop | boolean | - | | - |\n| muted | boolean | - | | - |\n| object-fit | boolean | - | | *(boolean)*
当视频大小与 video 容器大小不一致时,视频的表现形式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| contain | | |\n@| fill | | |\n@| cover | | |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.channel-video)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/channel-video.html)"},"voip-room":{"name":"## voip-room","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| openid | string | - | | - |\n| mode | string | - | | *(string)*
对话窗口类型 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| camera | | |\n@| video | | |\n| device-position | string | - | | *(string)*
摄像头方向,仅在 mode 为 camera 时有效 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| front | | |\n@| back | | |\n| object-fit | string | - | | *(string)*
画面与容器比例不一致时,画面的表现形式 |\n@| 合法值 | 兼容性 | 描述 |\n@| :- | :-: | :- |\n@| fill | | |\n@| contain | | |\n@| cover | | |\n| @error | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.voip-room)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/voip-room.html)"},"keyboard-accessory":{"name":"## keyboard-accessory","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.keyboard-accessory)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/keyboard-accessory.html)"},"page-container":{"name":"## page-container","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| show | boolean | - | | - |\n| duration | number | - | | - |\n| z-index | number | - | | - |\n| overlay | boolean | - | | - |\n| position | string | - | | - |\n| round | boolean | - | | - |\n| close-on-slide-down | boolean | - | | - |\n| overlay-style | string | - | | - |\n| custom-style | string | - | | - |\n| @beforeenter | eventhandle | - | | - |\n| @enter | eventhandle | - | | - |\n| @afterenter | eventhandle | - | | - |\n| @beforeleave | eventhandle | - | | - |\n| @leave | eventhandle | - | | - |\n| @afterleave | eventhandle | - | | - |\n| @clickoverlay | eventhandle | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.page-container)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html)"},"root-portal":{"name":"## root-portal","description":"","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| x | x | x |\n","attribute":"### 属性 \n| 名称 | 类型 | 默认值 | 兼容性 | 描述 |\n| :- | :- | :- | :-: | :- |\n| enable | boolean | - | | - |","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.root-portal)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/component/root-portal.html)"},"block":{"name":"## block","description":"block节点","compatibility":"\n### 兼容性\n| Web | Android | iOS |\n| :- | :- | :- |\n| 4.0 | x | 4.11 |\n","attribute":"","event":"","example":"","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.other.block)\n- [参见uni-app相关文档](https://uniapp.dcloud.io/tutorial/page.html#template-block)\n- [微信开放文档](https://developers.weixin.qq.com/miniprogram/dev/reference/wxml/conditional.html)\n- [支付宝小程序文档](https://open.alipay.com/portal/zhichi/search?keyword=block&pageIndex=1&pageSize=10&source=doc_top&type=all)\n- [百度小程序文档](https://smartprogram.baidu.com/forum/search?query=block&scope=devdocs&source=docs)\n- [抖音小程序文档](https://developer.open-douyin.com/search-page?keyword=block&secondType=all&type=1)\n- [飞书小程序文档](https://open.feishu.cn/search?from=header&page=1&pageSize=10&q=block&topicFilter=)\n- [钉钉小程序文档](https://open.dingtalk.com/search?keyword=block)\n- [QQ小程序文档](https://q.qq.com/wiki/develop/miniprogram/frame/)\n- [快手小程序文档](https://developers.kuaishou.com/page?keyword=block&from=docs)\n- [京东小程序文档](https://mp-docs.jd.com/doc/dev/framework/-1)\n- [华为快应用文档](https://developer.huawei.com/consumer/cn/doc/quickApp-References/webview-frame-overview-0000001124793625)\n- [360小程序文档](https://mp.360.cn/doc/miniprogram/dev/#/b770a184ff1f06c6b3393a0fd1132380)"}}
\ No newline at end of file
--
GitLab