From 767bdaface16d23c519555a6f15d9a936aab85ee Mon Sep 17 00:00:00 2001 From: git_robot Date: Thu, 29 Feb 2024 17:51:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20utsApiJson.json=E3=80=81ut?= =?UTF-8?q?sComJson.json=E3=80=81utsUnicloudApiJson.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/utils/utsApiJson.json | 2 +- docs/.vuepress/utils/utsComJson.json | 2 +- docs/.vuepress/utils/utsUnicloudApiJson.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/.vuepress/utils/utsApiJson.json b/docs/.vuepress/utils/utsApiJson.json index 0bc8cb2c..766362ca 100644 --- a/docs/.vuepress/utils/utsApiJson.json +++ b/docs/.vuepress/utils/utsApiJson.json @@ -1 +1 @@ -{"getApp":{"name":"## getApp() @getapp","description":"\n`getApp()` 函数用于获取当前应用实例,可通过应用实例调用 App.uvue methods 中定义的方法。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| any | \n","compatibility":"","tutorial":"\n### 参见\n[getApp](https://uniapp.dcloud.net.cn/tutorial/page.html#getapp)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-app)\n"},"get-app":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app/get-app.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app/get-app\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n import { state, setLifeCycleNum } from '@/store/index.uts'\n\n type MyGlobalData = {\n str : string,\n num : number,\n bool : boolean,\n obj : UTSJSONObject,\n null : string | null,\n arr : number[],\n mySet : string[],\n myMap : UTSJSONObject,\n func : () => string\n }\n\n export default {\n data() {\n return {\n originGlobalData: {\n str: '',\n num: 0,\n bool: false,\n obj: {\n str: '',\n num: 0,\n bool: false\n } as UTSJSONObject,\n null: null,\n arr: [] as number[],\n mySet: [] as string[],\n myMap: {},\n func: () : string => ''\n } as MyGlobalData,\n originGlobalDataFuncRes: '',\n newGlobalData: {\n str: '',\n num: 0,\n bool: false,\n obj: {\n str: '',\n num: 0,\n bool: false\n } as UTSJSONObject,\n null: null,\n arr: [] as number[],\n mySet: [] as string[],\n myMap: {},\n func: () : string => ''\n } as MyGlobalData,\n newGlobalDataFuncRes: '',\n lifeCycleNum: 0,\n }\n },\n onReady() {\n this.lifeCycleNum = state.lifeCycleNum\n },\n methods: {\n getGlobalData() {\n const app = getApp()\n\n this.originGlobalData.str = app.globalData.str\n this.originGlobalData.num = app.globalData.num\n this.originGlobalData.bool = app.globalData.bool\n this.originGlobalData.obj = app.globalData.obj\n this.originGlobalData.null = app.globalData.null\n this.originGlobalData.arr = app.globalData.arr\n app.globalData.mySet.forEach((value : string) => {\n this.originGlobalData.mySet.push(value)\n })\n app.globalData.myMap.forEach((value : any, key : string) => {\n this.originGlobalData.myMap[key] = value\n })\n this.originGlobalData.func = app.globalData.func\n this.originGlobalDataFuncRes = this.originGlobalData.func()\n },\n setGlobalData() {\n const app = getApp()\n\n app.globalData.str = 'new globalData str'\n app.globalData.num = 100\n app.globalData.bool = true\n app.globalData.obj = {\n str: 'new globalData obj str',\n num: 200,\n bool: true\n }\n app.globalData.null = 'not null'\n app.globalData.arr = [1, 2, 3]\n app.globalData.mySet = new Set(['a', 'b', 'c'])\n app.globalData.myMap = new Map([\n ['a', 1],\n ['b', 2],\n ['c', 3]\n ])\n app.globalData.func = () : string => {\n return 'new globalData func'\n }\n\n this.newGlobalData.str = app.globalData.str\n this.newGlobalData.num = app.globalData.num\n this.newGlobalData.bool = app.globalData.bool\n this.newGlobalData.obj = app.globalData.obj\n this.newGlobalData.null = app.globalData.null\n this.newGlobalData.arr = app.globalData.arr\n app.globalData.mySet.forEach((value : string) => {\n this.newGlobalData.mySet.push(value)\n })\n app.globalData.myMap.forEach((value : any, key : string) => {\n this.newGlobalData.myMap[key] = value\n })\n this.newGlobalData.func = app.globalData.func\n this.newGlobalDataFuncRes = this.newGlobalData.func()\n },\n _increasetLifeCycleNum: function () {\n const app = getApp()\n app.increasetLifeCycleNum()\n this.lifeCycleNum = state.lifeCycleNum\n },\n // 自动化测试\n setLifeCycleNum(num : number) {\n setLifeCycleNum(num)\n }\n },\n }\n\n```\n\n:::"},"getCurrentPages":{"name":"## getCurrentPages() @getcurrentpages","description":"\n`getCurrentPages()` 函数用于获取当前页面栈的实例,以数组形式按栈的顺序给出,数组中的元素为页面实例,第一个元素为首页,最后一个元素为当前页面。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[Page](#page-values)\\> | \n\n#### Page 的属性值 @page-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| route | string | 是 | - | 页面的路由地址 |\n| options | Map\\ | 是 | - | 页面的路由参数信息 |\n","compatibility":"","tutorial":"\n### 参见\n[getCurrentPages](https://uniapp.dcloud.net.cn/tutorial/page.html#getcurrentpages)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-current-pages)\n"},"get-current-pages":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-current-pages/get-current-pages.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-current-pages/get-current-pages\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n class Page {\n constructor(public route : string) {\n }\n }\n\n export default {\n data() {\n return {\n checked: false,\n pages: [] as Page[],\n }\n },\n methods: {\n _getCurrentPages: function () {\n this.pages.length = 0\n const pages = getCurrentPages()\n this.pages.push(new Page(pages[0].route))\n if (this.pages[0].route.includes('/tabBar/')) {\n this.checked = true\n }\n for (let i = 1; i < pages.length; i++) {\n this.pages.push(new Page(pages[i].route))\n if (pages[i].route.includes('/tabBar/')) {\n this.checked = false\n }\n }\n },\n },\n }\n\n```\n\n:::"},"$on":{"name":"## uni.$on(eventName, callback) @$on","description":"\n监听自定义事件。事件可以由 uni.$emit 触发。回调函数会接收 uni.$emit 传递的参数。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### $on 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$on](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$on)\n"},"$once":{"name":"## uni.$once(eventName, callback) @$once","description":"\n监听一个自定义事件。事件只触发一次,在第一次触发之后移除事件监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### $once 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$once](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$once)\n"},"$off":{"name":"## uni.$off(eventName, callback) @$off","description":"\n移除自定义事件监听器。如果没有指定事件名,则移除所有事件监听器。如果提供事件名,则移除该事件的所有监听器。如果提供了事件名和回调,则只移除这个回调的监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### $off 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$off](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$off)\n"},"$emit":{"name":"## uni.$emit(eventName, args?) @$emit","description":"\n触发自定义事件,附加的参数会传递给事件监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| args | any \\| null | 否 | - | |","returnValue":"","compatibility":"### $emit 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$emit](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$emit)\n"},"event-bus":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/event-bus/event-bus.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/event-bus/event-bus\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n log: [] as string[],\r\n }\r\n },\r\n methods: {\r\n fn(res : string) {\r\n this.log.push(res)\r\n },\r\n on() {\r\n uni.$on('test', this.fn)\r\n },\r\n once() {\r\n uni.$once('test', this.fn)\r\n },\r\n off() {\r\n uni.$off('test', this.fn)\r\n },\r\n emit() {\r\n uni.$emit('test', 'msg:' + Date.now())\r\n },\r\n clear() {\r\n this.log.length = 0\r\n },\r\n },\r\n }\r\n\n```\n\n:::"},"addInterceptor":{"name":"## uni.addInterceptor(name, interceptor) @addinterceptor","description":"\n添加拦截器","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | 需要拦截的 API 名称 |\n| interceptor | [Interceptor](#interceptor-values) | 是 | - | 拦截器 |\n#### Interceptor 的属性值 @interceptor-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| invoke | (...args?: any) => any \\| null | 否 | - | 拦截前触发 |\n| returnValue | (...args?: any) => any \\| null | 否 | - | 方法调用后触发,处理返回值 |\n| success | (...args?: any) => any \\| null | 否 | - | 成功回调拦截 |\n| fail | (...args?: any) => any \\| null | 否 | - | 失败回调拦截 |\n| complete | (...args?: any) => any \\| null | 否 | - | 完成回调拦截 |\n","returnValue":"","compatibility":"### addInterceptor 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.addInterceptor)\n"},"removeInterceptor":{"name":"## uni.removeInterceptor(name, interceptor?) @removeinterceptor","description":"\n删除拦截器","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | 需要删除拦截器的 API 名称 |\n| interceptor | [Interceptor](#interceptor-values) \\| null | 否 | - | 拦截器 |\n#### Interceptor 的属性值 @interceptor-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| invoke | (...args?: any) => any \\| null | 否 | - | 拦截前触发 |\n| returnValue | (...args?: any) => any \\| null | 否 | - | 方法调用后触发,处理返回值 |\n| success | (...args?: any) => any \\| null | 否 | - | 成功回调拦截 |\n| fail | (...args?: any) => any \\| null | 否 | - | 失败回调拦截 |\n| complete | (...args?: any) => any \\| null | 否 | - | 完成回调拦截 |\n","returnValue":"","compatibility":"### removeInterceptor 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.removeInterceptor)\n"},"interceptor":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/interceptor/interceptor.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/interceptor/interceptor\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n const interceptor = {\r\n invoke: function (options : NavigateToOptions) {\r\n console.log('拦截 navigateTo 接口传入参数为:', options)\r\n const url = './page2'\r\n uni.showToast({\r\n title: `重定向到页面:${url}`\r\n })\r\n options.url = url\r\n },\r\n success: function (res : NavigateBackSuccess) {\r\n console.log('拦截 navigateTo 接口 success 返回参数为:', res)\r\n },\r\n fail: function (err : NavigateToFail) {\r\n console.log('拦截 navigateTo 接口 fail 返回参数为:', err)\r\n },\r\n complete: function (res : NavigateToComplete) {\r\n console.log('拦截 navigateTo 接口 complete 返回参数为:', res)\r\n }\r\n } as Interceptor\r\n export default {\r\n data() {\r\n return {\r\n msg: \"会跳转到测试页面1\"\r\n }\r\n },\r\n beforeUnmount() {\r\n // 移除 navigateTo 所有拦截器\r\n uni.removeInterceptor('navigateTo')\r\n },\r\n methods: {\r\n addInterceptor() {\r\n uni.addInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '页面跳转已拦截'\r\n })\r\n this.msg = \",路由被劫持到测试页面2\"\r\n },\r\n removeInterceptor() {\r\n uni.removeInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '拦截器已移除'\r\n })\r\n this.msg = \"会跳转到测试页面1\"\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: './page1',\r\n success(res) {\r\n console.log('res:', res)\r\n },\r\n fail(err) {\r\n console.error('err:', err)\r\n },\r\n complete(res) {\r\n console.log('res:', res)\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"getLaunchOptionsSync":{"name":"## uni.getLaunchOptionsSync() @getlaunchoptionssync","description":"\n获取本次启动时的参数。返回值与App.onLaunch的回调参数一致\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [OnLaunchOptions](#onlaunchoptions-values) | \n\n#### OnLaunchOptions 的属性值 @onlaunchoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | - |\n","compatibility":"### getLaunchOptionsSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[getLaunchOptionsSync](https://doc.dcloud.net.cn/uni-app-x/api/get-launch-options-sync.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.get-launch-options-sync)\n"},"get-launch-options-sync":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-launch-options-sync/get-launch-options-sync.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-launch-options-sync/get-launch-options-sync\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\nexport default {\n data() {\n return {\n checked: false,\n homePagePath: 'pages/tabBar/component',\n launchOptionsPath: '',\n }\n },\n methods: {\n getLaunchOptionsSync() {\n const launchOptions = uni.getLaunchOptionsSync()\n this.launchOptionsPath = launchOptions.path\n\n if (launchOptions.path == this.homePagePath) {\n this.checked = true\n }\n },\n },\n}\n\n```\n\n:::"},"exit":{"name":"## uni.exit(options?) @exit","description":"\n退出当前应用","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ExitOptions](#exitoptions-values) \\| null | 否 | - | uni.exit参数定义 |\n#### ExitOptions 的属性值 @exitoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [ExitSuccess](#exitsuccess-values)) => void \\| null | 否 | - | uni.exit成功回调函数定义 |\n| fail | (res: [IExitError](#iexiterror-values)) => void \\| null | 否 | - | uni.exit失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.exit完成回调函数定义 |\n\n##### ExitSuccess 的属性值 @exitsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### IExitError 的属性值 @iexiterror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 12001 \\| 12002 | 是 | - | 错误码
- 12001: 系统不支持
- 12002: 未知错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### exit 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | x | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.exit)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/exit/exit.uvue) \n ```vue\n\n\n\n\n\n```"},"env":{"name":"## env","description":"","param":"### env 的属性值 @env-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| USER_DATA_PATH | string | 是 | - | 应用专属存储空间的外置存储空间根目录下的files目录 |\n| CACHE_PATH | string | 是 | - | 应用专属存储空间的外置存储空间根目录下的cache目录 |\n| SANDBOX_PATH | string | 是 | - | 应用专属存储空间的外置存储空间根目录(caches/files) |\n","compatibility":"#### env 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| USER_DATA_PATH | 3.99 | x | - |\n| CACHE_PATH | 3.99 | x | - |\n| SANDBOX_PATH | 3.99 | x | - |\n","returnValue":"","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.env)\n"},"navigateTo":{"name":"## uni.navigateTo(options) @navigateto","description":"\n保留当前页面,跳转到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [NavigateToOptions](#navigatetooptions-values) | 是 | - | - |\n#### NavigateToOptions 的属性值 @navigatetooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| animationType | string \\| null | 否 | - | 窗口显示的动画类型
- auto: 自动选择动画效果
- none: 无动画效果
- slide-in-right: 从右侧横向滑动效果
- slide-in-left: 左侧横向滑动效果
- slide-in-top: 从上侧竖向滑动效果
- slide-in-bottom: 从下侧竖向滑动效果
- fade-in: 从透明到不透明逐渐显示效果
- zoom-out: 从小到大逐渐放大显示效果
- zoom-fade-out: 从小到大逐渐放大并且从透明到不透明逐渐显示效果
- pop-in: 从右侧平移入栈动画效果
- UnionType => 'auto' \\| 'none' \\| 'slide-in-right' \\| 'slide-in-left' \\| 'slide-in-top' \\| 'slide-in-bottom' \\| 'fade-in' \\| 'zoom-out' \\| 'zoom-fade-out' \\| 'pop-in' |\n| animationDuration | number \\| null | 否 | - | 窗口显示动画的持续时间,单位为 ms |\n| events | any \\| null | 否 | - | 页面间通信接口,用于监听被打开页面发送到当前页面的数据 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [NavigateToError](#navigatetoerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateToError 的属性值 @navigatetoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 路由错误码 - 4: 框架内部异常 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateToOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| animationType | x | x | 4.0 |\n| animationDuration | x | x | 4.0 |\n| events | x | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### navigateTo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[navigateTo](http://uniapp.dcloud.io/api/router?id=navigateto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateTo)\n"},"reLaunch":{"name":"## uni.reLaunch(options) @relaunch","description":"\n关闭所有页面,打开到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ReLaunchOptions](#relaunchoptions-values) | 是 | - | - |\n#### ReLaunchOptions 的属性值 @relaunchoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [ReLaunchError](#relauncherror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ReLaunchError 的属性值 @relauncherror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ReLaunchOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### reLaunch 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[reLaunch](http://uniapp.dcloud.io/api/router?id=relaunch)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.reLaunch)\n"},"navigateBack":{"name":"## uni.navigateBack(options?) @navigateback","description":"\n关闭当前页面,返回上一页面或多级页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [NavigateBackOptions](#navigatebackoptions-values) \\| null | 否 | - | |\n#### NavigateBackOptions 的属性值 @navigatebackoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| delta | number \\| null | 否 | - | 返回的页面数,如果 delta 大于现有页面数,则返回到首页 |\n| animationType | string \\| null | 否 | - | 窗口关闭的动画类型
- auto: 自动选择动画效果
- none: 无动画效果
- slide-out-right: 横向向右侧滑出屏幕动画
- slide-out-left: 横向向左侧滑出屏幕动画
- slide-out-top: 竖向向上侧滑出屏幕动画
- slide-out-bottom: 竖向向下侧滑出屏幕动画
- fade-out: 从不透明到透明逐渐隐藏动画
- zoom-in: 从大逐渐缩小关闭动画
- zoom-fade-in: 从大逐渐缩小并且从不透明到透明逐渐隐藏关闭动画
- pop-out: 从右侧平移出栈动画效果
- UnionType => 'auto' \\| 'none' \\| 'slide-out-right' \\| 'slide-out-left' \\| 'slide-out-top' \\| 'slide-out-bottom' \\| 'fade-out' \\| 'zoom-in' \\| 'zoom-fade-in' \\| 'pop-out' |\n| animationDuration | number \\| null | 否 | - | 窗口关闭动画的持续时间,单位为 ms |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [NavigateBackError](#navigatebackerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateBackError 的属性值 @navigatebackerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateBackOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| delta | √ | x | 4.0 |\n| animationType | x | x | 4.0 |\n| animationDuration | x | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### navigateBack 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[navigateBack](http://uniapp.dcloud.io/api/router?id=navigateback)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateBack)\n"},"redirectTo":{"name":"## uni.redirectTo(options) @redirectto","description":"\n关闭当前页面,跳转到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RedirectToOptions](#redirecttooptions-values) | 是 | - | - |\n#### RedirectToOptions 的属性值 @redirecttooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [RedirectToError](#redirecttoerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### RedirectToError 的属性值 @redirecttoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### RedirectToOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### redirectTo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[redirectTo](http://uniapp.dcloud.io/api/router?id=redirectto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.redirectTo)\n"},"switchTab":{"name":"## uni.switchTab(options) @switchtab","description":"\n跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SwitchTabOptions](#switchtaboptions-values) | 是 | - | - |\n#### SwitchTabOptions 的属性值 @switchtaboptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的 tabBar 页面的路径,路径后不能带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SwitchTabError](#switchtaberror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SwitchTabError 的属性值 @switchtaberror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SwitchTabOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### switchTab 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[switchTab](http://uniapp.dcloud.io/api/router?id=switchtab)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.switchTab)\n"},"navigator":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/navigator/navigator.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/navigator/navigator\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n data() {\r\n return {\r\n onLoadTime: 0,\r\n onShowTime: 0,\r\n onReadyTime: 0,\r\n onHideTime: 0,\r\n }\r\n },\r\n onLoad() {\r\n this.onLoadTime = Date.now()\r\n console.log('onLoad', this.onLoadTime)\r\n },\r\n onShow() {\r\n this.onShowTime = Date.now()\r\n console.log('onShow', this.onShowTime)\r\n },\r\n onReady() {\r\n this.onReadyTime = Date.now()\r\n console.log('onReady', this.onReadyTime)\r\n },\r\n onHide() {\r\n this.onHideTime = Date.now()\r\n console.log('onHide', this.onHideTime)\r\n },\r\n onBackPress(options : OnBackPressOptions) : boolean | null {\r\n console.log('onBackPress', Date.now())\r\n console.log('onBackPress from', options.from)\r\n return null\r\n },\r\n onUnload() {\r\n console.log('onUnload', Date.now())\r\n },\r\n methods: {\r\n reLaunch() {\r\n uni.reLaunch({\r\n url: '/pages/tabBar/component',\r\n success(result) {\r\n console.log('reLaunch success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('reLaunch fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('reLaunch complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToErrorPage() {\r\n uni.navigateTo({\r\n url: '/pages/error-page/error-page',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n uni.showToast({\r\n title: error.errMsg,\r\n icon: 'none',\r\n })\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToDebounce() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath1() {\r\n uni.navigateTo({\r\n url: 'new-page/new-page-1?data=new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath2() {\r\n uni.navigateTo({\r\n url: './new-page/new-page-1?data=./new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath3() {\r\n uni.navigateTo({\r\n url: '../navigator/new-page/new-page-1?data=../navigator/new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBack() {\r\n uni.navigateBack({\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBackWithDelta1() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 1,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n navigateBackWithDelta100() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 100,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n redirectTo() {\r\n uni.redirectTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('redirectTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('redirectTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('redirectTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n switchTab() {\r\n uni.switchTab({\r\n url: '/pages/tabBar/template',\r\n success(result) {\r\n console.log('switchTab success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('switchTab fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('switchTab complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n },\r\n }\r\n\n```\n\n:::"},"setNavigationBarColor":{"name":"## uni.setNavigationBarColor(options) @setnavigationbarcolor","description":"\n设置导航条、状态栏颜色\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetNavigationBarColorOptions](#setnavigationbarcoloroptions-values) | 是 | - | - |\n#### SetNavigationBarColorOptions 的属性值 @setnavigationbarcoloroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| frontColor | \"#ffffff\" \\| \"#000000\" | 是 | - | 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 |\n| backgroundColor | string.ColorString | 是 | - | 背景颜色值,有效值为十六进制颜色 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [SetNavigationBarColorError](#setnavigationbarcolorerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarColorError 的属性值 @setnavigationbarcolorerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarColorOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| frontColor | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setNavigationBarColor 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[setNavigationBarColor](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-color.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-color)\n"},"set-navigation-bar-color":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-color/set-navigation-bar-color.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-color/set-navigation-bar-color\n>Template\n```vue\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n methods: {\r\n setNavigationBarColor1() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#ffffff',\r\n backgroundColor: '#00ff00',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n setNavigationBarColor2() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#000000',\r\n backgroundColor: '#ff0000',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n goNavbarLite() {\r\n uni.navigateTo({\r\n url: '/pages/template/navbar-lite/navbar-lite'\r\n })\r\n },\r\n goCustomNavigation() {\r\n uni.navigateTo({\r\n url: '/pages/API/set-navigation-bar-color/set-navigation-bar-color-custom-navigation'\r\n })\r\n }\r\n },\r\n }\r\n\n```\n\n:::"},"setNavigationBarTitle":{"name":"## uni.setNavigationBarTitle(options) @setnavigationbartitle","description":"\n动态设置当前页面的标题\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetNavigationBarTitleOptions](#setnavigationbartitleoptions-values) | 是 | - | - |\n#### SetNavigationBarTitleOptions 的属性值 @setnavigationbartitleoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 页面标题 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [SetNavigationBarTitleError](#setnavigationbartitleerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarTitleError 的属性值 @setnavigationbartitleerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarTitleOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| title | 3.97 | x | 4.0 |\n| success | 3.97 | x | 4.0 |\n| fail | 3.97 | x | 4.0 |\n| complete | 3.97 | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setNavigationBarTitle 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","tutorial":"\n### 参见\n[setNavigationBarTitle](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-title.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-title)\n"},"set-navigation-bar-title":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-title/set-navigation-bar-title.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-title/set-navigation-bar-title\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n import { state, setLifeCycleNum } from '@/store/index.uts'\n\n export default {\n data() {\n return {\n newTitle: 'new title',\n longTitle: 'long title long title long title long title long title long title long title long title long title long title'\n }\n },\n methods: {\n setNavigationBarNewTitle() {\n uni.setNavigationBarTitle({\n title: this.newTitle,\n success: () => {\n console.log('setNavigationBarTitle success')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n },\n fail: () => {\n console.log('setNavigationBarTitle fail')\n this.setLifeCycleNum(state.lifeCycleNum - 1)\n },\n complete: () => {\n console.log('setNavigationBarTitle complete')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n }\n })\n },\n setNavigationBarLongTitle() {\n uni.setNavigationBarTitle({\n title: this.longTitle,\n success() {\n console.log('setNavigationBarTitle success')\n },\n fail() {\n console.log('setNavigationBarTitle fail')\n },\n complete() {\n console.log('setNavigationBarTitle complete')\n }\n })\n },\n // 自动化测试\n getLifeCycleNum() : number {\n return state.lifeCycleNum\n },\n // 自动化测试\n setLifeCycleNum(num : number) {\n setLifeCycleNum(num)\n }\n },\n }\n\n```\n\n:::"},"showTabBar":{"name":"## uni.showTabBar(options?) @showtabbar","description":"\n显示 tabBar\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowTabBarOptions](#showtabbaroptions-values) \\| null | 否 | - | |\n#### ShowTabBarOptions 的属性值 @showtabbaroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| animation | boolean | 否 | - | 是否需要动画效果 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### showTabBar 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[showTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBar)\n"},"hideTabBar":{"name":"## uni.hideTabBar(options?) @hidetabbar","description":"\n隐藏 tabBar\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [HideTabBarOptions](#hidetabbaroptions-values) \\| null | 否 | - | |\n#### HideTabBarOptions 的属性值 @hidetabbaroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| animation | boolean | 否 | - | 是否需要动画效果 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### hideTabBar 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[hideTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBar)\n"},"showTabBarRedDot":{"name":"## uni.showTabBarRedDot(options) @showtabbarreddot","description":"\n显示 tabBar 某一项的右上角的红点\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowTabBarRedDotOptions](#showtabbarreddotoptions-values) | 是 | - | - |\n#### ShowTabBarRedDotOptions 的属性值 @showtabbarreddotoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### showTabBarRedDot 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[showTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBarRedDot)\n"},"hideTabBarRedDot":{"name":"## uni.hideTabBarRedDot(options) @hidetabbarreddot","description":"\n隐藏 tabBar 某一项的右上角的红点\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [HideTabBarRedDotOptions](#hidetabbarreddotoptions-values) | 是 | - | - |\n#### HideTabBarRedDotOptions 的属性值 @hidetabbarreddotoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### hideTabBarRedDot 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[hideTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBarRedDot)\n"},"setTabBarBadge":{"name":"## uni.setTabBarBadge(options) @settabbarbadge","description":"\n为 tabBar 某一项的右上角添加文本\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarBadgeOptions](#settabbarbadgeoptions-values) | 是 | - | - |\n#### SetTabBarBadgeOptions 的属性值 @settabbarbadgeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| text | string | 是 | - | 显示的文本,不超过 3 个半角字符 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setTabBarBadge 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[setTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarBadge)\n"},"removeTabBarBadge":{"name":"## uni.removeTabBarBadge(options) @removetabbarbadge","description":"\n移除 tabBar 某一项右上角的文本\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RemoveTabBarBadgeOptions](#removetabbarbadgeoptions-values) | 是 | - | - |\n#### RemoveTabBarBadgeOptions 的属性值 @removetabbarbadgeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### removeTabBarBadge 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[removeTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#removetabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.removeTabBarBadge)\n"},"setTabBarStyle":{"name":"## uni.setTabBarStyle(options) @settabbarstyle","description":"\n动态设置 tabBar 的整体样式\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarStyleOptions](#settabbarstyleoptions-values) | 是 | - | - |\n#### SetTabBarStyleOptions 的属性值 @settabbarstyleoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| color | string (string.ColorString) | 否 | - | tab 上的文字默认颜色 |\n| selectedColor | string (string.ColorString) | 否 | - | tab 上的文字选中时的颜色 |\n| backgroundColor | string (string.ColorString) | 否 | - | tab 的背景色 |\n| backgroundImage | string | 否 | - | 图片背景 |\n| backgroundRepeat | \"repeat\" \\| \"repeat-x\" \\| \"repeat-y\" \\| \"no-repeat\" | 否 | - | 背景图平铺方式
- repeat: 背景图片在垂直方向和水平方向平铺
- repeat-x: 背景图片在水平方向平铺,垂直方向拉伸
- repeat-y: 背景图片在垂直方向平铺,水平方向拉伸
- no-repeat: 背景图片在垂直方向和水平方向都拉伸 |\n| borderStyle | string | 否 | - | tabbar上边框的颜色 |\n| midButton | [MidButtonOptions](#midbuttonoptions-values) | 否 | - | tabbar 中间按钮 仅在 list 项为偶数时有效 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### MidButtonOptions 的属性值 @midbuttonoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| width | string | 否 | - | 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度。默认 80px |\n| height | string | 否 | - | 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果。默认 50px |\n| text | string | 否 | - | 中间按钮的文字 |\n| iconPath | string | 否 | - | 中间按钮的图片路径 |\n| iconWidth | string | 否 | - | 图片宽度(高度等比例缩放)。默认 24px |\n| backgroundImage | string | 否 | - | 中间按钮的背景图片路径 |\n| iconfont | [MidButtonIconFont](#midbuttoniconfont-values) | 否 | - | 字体图标,优先级高于 iconPath |\n\n###### MidButtonIconFont 的属性值 @midbuttoniconfont-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | 否 | - | 字库 Unicode 码 |\n| selectedText | string | 否 | - | 选中后字库 Unicode 码 |\n| fontSize | string | 否 | - | 字体图标字号(px) |\n| color | string | 否 | - | 字体图标颜色 |\n| selectedColor | string | 否 | - | 字体图标选中颜色 |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setTabBarStyle 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[setTabBarStyle](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarstyle)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarStyle)\n"},"setTabBarItem":{"name":"## uni.setTabBarItem(options) @settabbaritem","description":"\n动态设置 tabBar 某一项的内容\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarItemOptions](#settabbaritemoptions-values) | 是 | - | - |\n#### SetTabBarItemOptions 的属性值 @settabbaritemoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar 的哪一项,从左边算起,索引从0开始 |\n| text | string | 否 | - | tab 上按钮文字 |\n| iconPath | string | 否 | - | 图片路径 |\n| selectedIconPath | string | 否 | - | 选中时的图片路径 |\n| pagePath | string | 否 | - | 页面绝对路径 |\n| iconfont | [SetTabBarItemIconFontOptions](#settabbaritemiconfontoptions-values) | 否 | - | 字体图标,优先级高于 iconPath |\n| visible | boolean | 否 | - | tab 是否显示 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### SetTabBarItemIconFontOptions 的属性值 @settabbaritemiconfontoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | 是 | - | 字库 Unicode 码 |\n| selectedText | string | 是 | - | 选中后字库 Unicode 码 |\n| fontSize | string | 否 | - | 字体图标字号(px) |\n| color | string | 否 | - | 字体图标颜色 |\n| selectedColor | string | 否 | - | 字体图标选中颜色 |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setTabBarItem 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[setTabBarItem](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbaritem)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarItem)\n"},"startPullDownRefresh":{"name":"## uni.startPullDownRefresh(options?) @startpulldownrefresh","description":"\n开始下拉刷新\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [StartPullDownRefreshOptions](#startpulldownrefreshoptions-values) \\| null | 否 | - | |\n#### StartPullDownRefreshOptions 的属性值 @startpulldownrefreshoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [PullDownRefreshError](#pulldownrefresherror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### PullDownRefreshError 的属性值 @pulldownrefresherror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### startPullDownRefresh 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[startPullDownRefresh](https://uniapp.dcloud.io/uni-app-x/api/pull-down-refresh.html#startpulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.startPullDownRefresh)\n"},"stopPullDownRefresh":{"name":"## uni.stopPullDownRefresh() @stoppulldownrefresh","description":"\n停止当前页面下拉刷新\n","param":"","returnValue":"","compatibility":"### stopPullDownRefresh 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[stopPullDownRefresh](https://doc.dcloud.net.cn/uni-app-x/api/pull-down-refresh.html#stoppulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.stopPullDownRefresh)\n"},"pull-down-refresh":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/pull-down-refresh/pull-down-refresh.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/pull-down-refresh/pull-down-refresh\n>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tdata: [] as Array,\n\t\t\t\tloadMoreText: \"加载中...\",\n\t\t\t\tshowLoadMore: false,\n\t\t\t\tmax: 0\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\tthis.initData();\n\t\t},\n\t\tonReachBottom() {\n\t\t\tconsole.log(\"onReachBottom\");\n\t\t\tif (this.max > 40) {\n\t\t\t\tthis.loadMoreText = \"没有更多数据了!\"\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showLoadMore = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.setListData();\n\t\t\t}, 300);\n\t\t},\n\t\tonPullDownRefresh() {\n\t\t\tconsole.log('onPullDownRefresh');\n\t\t\tthis.initData();\n\t\t},\n\t\tmethods: {\n\t\t\tinitData(){\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.max = 0;\n\t\t\t\t\tthis.data = [];\n\t\t\t\t\tlet data:Array = [];\n\t\t\t\t\tthis.max += 20;\n\t\t\t\t\tfor (let i:number = this.max - 19; i < this.max + 1; i++) {\n\t\t\t\t\t\tdata.push(i)\n\t\t\t\t\t}\n\t\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t\t\tuni.stopPullDownRefresh();\n\t\t\t\t}, 300);\n\t\t\t},\n\t\t\tsetListData() {\n\t\t\t\tlet data:Array = [];\n\t\t\t\tthis.max += 10;\n\t\t\t\tfor (let i:number = this.max - 9; i < this.max + 1; i++) {\n\t\t\t\t\tdata.push(i)\n\t\t\t\t}\n\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t}\n\t\t}\n\t}\n\n```\n\n:::"},"pageScrollTo":{"name":"## uni.pageScrollTo(options) @pagescrollto","description":"\n将页面滚动到目标位置\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [PageScrollToOptions](#pagescrolltooptions-values) | 是 | - | - |\n#### PageScrollToOptions 的属性值 @pagescrolltooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| scrollTop | number \\| null | 否 | - | 滚动到页面的目标位置 |\n| selector | string \\| null | 否 | - | 选择器 |\n| offsetTop | number \\| null | 否 | - | 偏移距离,可以滚动到 selector 加偏移距离的位置 |\n| duration | number \\| null | 否 | - | 滚动动画的时长 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [PageScrollToError](#pagescrolltoerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### PageScrollToError 的属性值 @pagescrolltoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### PageScrollToOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| offsetTop | 3.91 | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### pageScrollTo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[pageScrollTo](https://doc.dcloud.net.cn/uni-app-x/api/page-scroll-to.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.page-scroll-to)\n"},"page-scroll-to":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/page-scroll-to/page-scroll-to.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/page-scroll-to/page-scroll-to\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'pageScrollTo',\n }\n },\n methods: {\n scrollTo() {\n uni.pageScrollTo({\n scrollTop: 100,\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n scrollToElement() {\n uni.pageScrollTo({\n selector: '.custom-element',\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n },\n }\n\n```\n\n:::"},"getElementById":{"name":"## uni.getElementById(id) @getelementbyid","description":"\n返回一个匹配特定 ID 的元素, 如果不存在,返回 null。\\\n如果需要获取指定的节点类型,需要使用 as 进行类型转换。\\\nID 区分大小写,且应该是唯一的。如果存在多个匹配的元素,则返回第一个匹配的元素。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | string.IDString \\| string | 是 | - | - |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [UniElement](/dom/unielement.md) \\| null | 否 | \n","compatibility":"### getElementById 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[getElementById](https://doc.dcloud.net.cn/uni-app-x/api/get-element.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.get-element.getElementById)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-element-by-id/get-element-by-id.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-element-by-id/get-element-by-id\n>Template\n```vue\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n checked: false,\r\n homePagePath: '/pages/tabBar/component',\r\n launchOptionsPath: '',\r\n }\r\n },\r\n methods: {\r\n getElementByNotExistId() : Element | null {\r\n return uni.getElementById('not-exist-id')\r\n },\r\n changePageHeadBackgroundColor() {\r\n const pageHead = uni.getElementById('page-head')!\r\n pageHead.style.setProperty('background-color', 'red')\r\n },\r\n changeTextColor() {\r\n const text = uni.getElementById('text')!\r\n text.style.setProperty('color', 'red')\r\n },\r\n changeViewStyle() {\r\n const view = uni.getElementById('view')\r\n if (view !== null) {\r\n view.style.setProperty('width', '90%')\r\n view.style.setProperty('height', '50px')\r\n view.style.setProperty('background-color', '#007AFF')\r\n }\r\n },\r\n goMultipleRootNode() {\r\n uni.navigateTo({ url: '/pages/API/get-element-by-id/get-element-by-id-multiple-root-node' })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"createSelectorQuery":{"name":"## uni.createSelectorQuery() @createselectorquery","description":"\n返回一个SelectorQuery对象实例\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n#### SelectorQuery 的方法 @selectorquery-values \n\n#### in(component?) @in\n\n将选择器的选取范围更改为自定义组件component内\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| component | any \\| null | 否 | - | |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n#### select(selector) @select\n\n在当前页面下选择第一个匹配选择器selector的节点\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| selector | string | 是 | - | - |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) | \n\n###### NodesRef 的方法 @nodesref-values \n\n##### boundingClientRect(callback?) @boundingclientrect\n\n添加节点的布局位置的查询请求,相对于显示区域,以像素为单位\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void \\| null | 否 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n##### scrollOffset(callback) @scrolloffset\n\n添加节点的滚动位置查询请求,以像素为单位\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n##### fields(fields, callback) @fields\n\n获取节点的相关信息,需要获取的字段在fields中指定\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fields | [NodeField](#nodefield-values) | 是 | - | - |\n| callback | (result: any) => void | 是 | - | |\n###### NodeField 的属性值 @nodefield-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | boolean \\| null | 否 | - | 是否返回节点 id |\n| dataset | boolean \\| null | 否 | - | 是否返回节点 dataset |\n| rect | boolean \\| null | 否 | - | 是否返回节点布局位置(left right top bottom) |\n| size | boolean \\| null | 否 | - | 是否返回节点尺寸(width height) |\n| scrollOffset | boolean \\| null | 否 | - | 是否返回节点的 scrollLeft scrollTop,节点必须是 scroll-view 或者 viewport |\n| properties | Array\\ \\| null | 否 | - | 指定属性名列表,返回节点对应属性名的当前属性值(只能获得组件文档中标注的常规属性值,id class style 和事件绑定的属性值不可获取) |\n| computedStyle | Array\\ \\| null | 否 | - | 指定样式名列表,返回节点对应样式名的当前值 |\n| context | boolean \\| null | 否 | - | 是否返回节点对应的 Context 对象 |\n\n###### NodeField 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| context | x | x | 4.0 |\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n##### context(callback) @context\n\n添加节点的 Context 对象查询请求\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n###### context 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| x | x | 4.0 |\n\n\n##### node(callback) @node\n\n获取 Node 节点实例。目前支持 Canvas 的获取。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n\n\n#### selectAll(selector) @selectall\n\n在当前页面下选择匹配选择器selector的所有节点\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| selector | string | 是 | - | - |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) | \n\n\n\n#### selectViewport() @selectviewport\n\n选择显示区域\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) | \n\n\n\n#### exec(callback) @exec\n\n执行所有的请求\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: Array\\) => void \\| null | 是 | - | - |\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [NodesRef](#nodesref-values) \\| null | 否 | \n\n\n","compatibility":"### createSelectorQuery 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[createSelectorQuery](https://doc.dcloud.net.cn/uni-app-x/api/nodes-info.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.nodes-info.createSelectorQuery)\n"},"nodes-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/nodes-info/nodes-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/nodes-info/nodes-info\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n type NodeInfoType = {\n left : number | null,\n top : number | null,\n right : number | null,\n bottom : number | null,\n width : number | null,\n height : number | null,\n }\n\n export default {\n data() {\n return {\n title: 'createSelectorQuery',\n nodeInfoList: [] as NodeInfoType[],\n // 仅用于自动化测试\n rootNodeInfo: null as NodeInfoType | null,\n //供自动化测试使用\n // resizeRectValid: false\n }\n },\n onResize() {\n //供自动化测试使用\n /* var rect12Element = uni.getElementById(\"rect-1-2\")\n if(rect12Element != null) {\n var domRect = rect12Element.getBoundingClientRect()\n if(domRect.width > 100) {\n this.resizeRectValid = true\n }\n } */\n },\n methods: {\n // 仅用于自动化测试\n getRootNodeInfo(selector: string) {\n uni.createSelectorQuery().select(selector).boundingClientRect().exec((ret) => {\n if (ret.length == 1) {\n const nodeInfo = ret[0] as NodeInfo;\n const nodeType = {\n left: nodeInfo.left,\n top: nodeInfo.top,\n right: nodeInfo.right,\n bottom: nodeInfo.bottom,\n width: nodeInfo.width,\n height: nodeInfo.height,\n } as NodeInfoType;\n this.rootNodeInfo = nodeType\n }\n })\n },\n getNodeInfo() {\n uni.createSelectorQuery().select('.rect1').boundingClientRect().exec((ret) => {\n this.nodeInfoList.length = 0\n const i = ret[0] as NodeInfo\n this.nodeInfoList.push({\n left: i.left,\n top: i.top,\n right: i.right,\n bottom: i.bottom,\n width: i.width,\n height: i.height,\n } as NodeInfoType)\n })\n },\n getAllNodeInfo() {\n uni.createSelectorQuery().selectAll('.rect').boundingClientRect().exec((ret) => {\n this.nodeInfoList.length = 0\n const array = ret[0] as NodeInfo[]\n array.forEach((i) => {\n this.nodeInfoList.push({\n left: i.left,\n top: i.top,\n right: i.right,\n bottom: i.bottom,\n width: i.width,\n height: i.height,\n } as NodeInfoType)\n })\n })\n }\n }\n }\n\n```\n\n:::"},"showActionSheet":{"name":"## uni.showActionSheet(options) @showactionsheet","description":"从底部向上弹出操作菜单","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowActionSheetOptions](#showactionsheetoptions-values) | 是 | - | uni.showActionSheet函数参数定义 |\n#### ShowActionSheetOptions 的属性值 @showactionsheetoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string \\| null | 否 | - | 菜单标题 |\n| alertText | string \\| null | 否 | - | 警示文案(同菜单标题, app无效) |\n| itemList | Array\\ | 是 | - | 按钮的文字数组 |\n| itemColor | string.ColorString \\| null | 否 | - | 按钮的文字颜色,字符串格式(iOS默认为系统控件颜色) |\n| popover | [Popover](#popover-values) \\| null | 否 | - | 大屏设备弹出原生选择按钮框的指示区域,默认居中显示 |\n| success | (res: [ShowActionSheetSuccess](#showactionsheetsuccess-values)) => void \\| null | 否 | - | uni.showActionSheet成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showActionSheet成功回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showActionSheet成功回调函数定义 |\n\n##### Popover 的属性值 @popover-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| top | number | 是 | - | 指示区域坐标,使用原生 navigationBar 时一般需要加上 navigationBar 的高度 |\n| left | number | 是 | - | 指示区域坐标 |\n| width | number | 是 | - | 指示区域宽度 |\n| height | number | 是 | - | 指示区域高度 |\n\n##### ShowActionSheetSuccess 的属性值 @showactionsheetsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tapIndex | number \\| null | 否 | - | 用户点击的按钮,从上到下的顺序,从0开始 |\n","returnValue":"","compatibility":"### showActionSheet 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showActionSheet]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showActionSheet)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/action-sheet/action-sheet.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/action-sheet/action-sheet\n>Template\n```vue\n\r\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 title: 'action-sheet',\r\n itemColorCustom: false,\r\n itemContentLarge: false,\r\n itemNumLargeSelect: false,\n showErrorToast:true,\r\n items: [{\r\n value: '标题',\r\n name: '有标题'\r\n },\r\n {\r\n value: '',\r\n name: '无标题'\r\n },\r\n {\r\n value: '超长标题测试内容,测试超过显示最大范围之后的样式-超长标题测试内容,测试超过显示最大范围之后的样式',\r\n name: '超长标题'\r\n }\r\n ] as ItemType[],\r\n current: 0,\r\n }\r\n },\n onLoad(){\n uni.showActionSheet({\n title: \"onLoad 调用示例,请手动取消\",\n itemList:['item1', 'item2'],\n })\n },\r\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\r\n radioChange(e : UniRadioGroupChangeEvent) {\r\n for (let i = 0; i < this.items.length; i++) {\r\n if (this.items[i].value === e.detail.value) {\r\n this.current = i;\r\n break;\r\n }\r\n }\r\n },\r\n itemContentLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemContentLarge = e.detail.value\r\n },\r\n itemColorChange: function (e : UniSwitchChangeEvent) {\r\n this.itemColorCustom = e.detail.value\r\n },\r\n itemNumLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemNumLargeSelect = e.detail.value\r\n },\r\n actionSheetTap() {\r\n\r\n let itemInfo = ['item1', 'item2', 'item3', 'item4']\r\n\r\n if (this.itemContentLarge) {\r\n itemInfo = ['两个黄鹂鸣翠柳,一行白鹭上青天。窗含西岭千秋雪,门泊东吴万里船', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西子,淡妆浓抹总相宜', '']\r\n }\n\n if (this.itemNumLargeSelect) {\r\n // 大量选项测试,不能超过6个元素 https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet\r\n itemInfo = []\n for (var i = 1; i <= 10; i++) {\r\n itemInfo.push('两个黄鹂鸣翠柳,一行白鹭上青天');\r\n }\r\n }\r\n\r\n const that = this\r\n if (this.itemColorCustom) {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n itemColor: \"#ff00ff\",\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\r\n console.log(e);\r\n }\r\n })\r\n } else {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\r\n console.log(e);\n if(this.showErrorToast){\n uni.showToast({\n title: e.errMsg,\n icon: \"none\"\n })\n }\n }\r\n })\r\n }\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"showLoading":{"name":"## uni.showLoading(options) @showloading","description":"显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowLoadingOptions](#showloadingoptions-values) | 是 | - | uni.showLoading参数定义 |\n#### ShowLoadingOptions 的属性值 @showloadingoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |\n| mask | boolean \\| null | 否 | - | 是否显示透明蒙层,防止触摸穿透,默认:false |\n| success | (res: ShowLoadingSuccess) => void \\| null | 否 | - | uni.showLoading成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showLoading失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showLoading完成回调函数定义 |\n","returnValue":"","compatibility":"### showLoading 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showLoading]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showLoading)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/loading/loading.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/loading/loading\n>Template\n```vue\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string\n name : string\n }\n export default {\n data() {\n return {\n title: 'loading',\n items: [\n {\n value: 'null',\n name: '无标题',\n },\n {\n value: '三秒后自动关闭',\n name: '普通标题',\n },\n {\n value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒后自动关闭',\n name: '长标题',\n },\n ] as ItemType[],\n current: 0,\n maskSelect: false,\n titleSelect: \"null\"\n }\n },\n onLoad(){\n uni.showLoading({\n \ttitle:'onLoad 调用示例,2秒后消失'\n })\n setTimeout(function() {\n uni.hideLoading()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n\n radioChange(e : UniRadioGroupChangeEvent) {\n const selected = this.items.find((item) : boolean => {\n return item.value == e.detail.value\n })\n if (selected != null) {\n this.titleSelect = selected.value\n }\n },\n maskChange: function (e : UniSwitchChangeEvent) {\n this.maskSelect = e.detail.value\n },\n showLoading: function () {\n\n console.log(this.titleSelect)\n if (this.titleSelect == \"null\") {\n uni.showLoading({\n title: \"\",\n mask: this.maskSelect\n });\n } else {\n uni.showLoading({\n title: this.titleSelect,\n mask: this.maskSelect\n });\n }\n setTimeout(() => {\n this.hideLoading();\n }, 3000);\n },\n hideLoading: function () {\n uni.hideLoading();\n }\n }\n }\n\n```\n\n:::"},"showModal":{"name":"## uni.showModal(options) @showmodal","description":"显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowModalOptions](#showmodaloptions-values) | 是 | - | uni.showModal 参数定义 |\n#### ShowModalOptions 的属性值 @showmodaloptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string \\| null | 否 | - | 提示的标题 |\n| content | string \\| null | 否 | - | 提示的内容 |\n| showCancel | boolean \\| null | 否 | true
是否显示取消按钮,默认为 true | |\n| cancelText | string \\| null | 否 | - | 取消按钮的文字,默认为\"取消\" |\n| cancelColor | string.ColorString \\| null | 否 | - | 取消按钮的文字颜色,默认为\"#000000\" |\n| confirmText | string \\| null | 否 | - | 确定按钮的文字,默认为\"确定\" |\n| confirmColor | string.ColorString \\| null | 否 | - | 确定按钮的文字颜色 |\n| editable | boolean \\| null | 否 | false
是否显示输入框 | |\n| placeholderText | string \\| null | 否 | - | 显示输入框时的提示文本 |\n| success | (res: [ShowModalSuccess](#showmodalsuccess-values)) => void \\| null | 否 | - | uni.showModal成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showModal失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showModal完成回调函数定义 |\n\n##### ShowModalSuccess 的属性值 @showmodalsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| confirm | boolean | 是 | - | 为 true 时,表示用户点击了确定按钮 |\n| cancel | boolean | 是 | - | 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) |\n| content | string \\| null | 否 | - | editable 为 true 时,用户输入的文本 |\n","returnValue":"","compatibility":"### showModal 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showModal]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showModal)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/modal/modal.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/modal/modal\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string,\n }\n export default {\n data() {\n return {\n title: 'modal',\n showCancelSelect: false,\n cancelTextSelect: false,\n confirmTextSelect: false,\n editableSelect: false,\n placeholderTextSelect: false,\n exeRet: \"\",\n items: [{\n value: '标题',\n name: '有标题'\n },\n {\n value: '',\n name: '无标题'\n },\n {\n value: '超长标题测试内容,测试超过显示最大范围之后的样式-超长标题测试内容,测试超过显示最大范围之后的样式',\n name: '超长标题'\n }\n ] as ItemType[],\n current: 0\n }\n },\n onLoad() {\n uni.showModal({\n title: \"onLoad 调用示例,请手动取消\",\n showCancel: false\n })\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n showCancelChange: function (e : UniSwitchChangeEvent) {\n this.showCancelSelect = e.detail.value\n },\n cancelTextChange: function (e : UniSwitchChangeEvent) {\n this.cancelTextSelect = e.detail.value\n },\n confirmTextChange: function (e : UniSwitchChangeEvent) {\n this.confirmTextSelect = e.detail.value\n },\n editableChange: function (e : UniSwitchChangeEvent) {\n this.editableSelect = e.detail.value\n },\n placeholderTextChange: function (e : UniSwitchChangeEvent) {\n this.placeholderTextSelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n modalTap: function () {\n let cancelTextVal : string\n let cancelColorVal = ''\n if (this.cancelTextSelect) {\n cancelTextVal = \"修改后的取消文本\"\n cancelColorVal = \"#ff00ff\"\n } else {\n cancelTextVal = \"取消\"\n }\n\n let confirmTextVal = '确定'\n let confirmColorVal = ''\n if (this.confirmTextSelect) {\n confirmTextVal = \"修改后的确定文本\"\n confirmColorVal = \"#00ffff\"\n }\n\n let placeholderTextVal = ''\n let contentVal = \"弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内\"\n if (this.placeholderTextSelect) {\n placeholderTextVal = \"定制提示信息\"\n contentVal = \"\"\n }\n uni.showModal({\n title: this.items[this.current].value,\n editable: this.editableSelect,\n placeholderText: placeholderTextVal,\n content: contentVal,\n showCancel: this.showCancelSelect,\n cancelText: cancelTextVal,\n cancelColor: cancelColorVal,\n confirmText: confirmTextVal,\n confirmColor: confirmColorVal,\n success: (res) => {\n this.exeRet = JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = JSON.stringify(res)\n }\n })\n }\n }\n }\n\n```\n\n:::"},"showToast":{"name":"## uni.showToast(options) @showtoast","description":"显示消息提示框","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowToastOptions](#showtoastoptions-values) | 是 | - | uni.showToast参数定义 |\n#### ShowToastOptions 的属性值 @showtoastoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |\n| icon | \"success\" \\| \"error\" \\| \"fail\" \\| \"exception\" \\| \"loading\" \\| \"none\" | 否 | - | icon值说明 success: 显示成功图标,error: 显示错误图标; fail: 显示错误图标,此时title文本无长度显示; exception: 显示异常图标,此时title文本无长度显示; loading: 显示加载图标;none: 不显示图标。 |\n| image | string.ImageURIString \\| null | 否 | - | 自定义图标的本地路径(app端暂不支持gif) |\n| mask | boolean \\| null | 否 | - | 是否显示透明蒙层,防止触摸穿透,默认:false |\n| duration | number \\| null | 否 | - | 提示的延迟时间,单位毫秒,默认:1500 |\n| position | \"top\" \\| \"center\" \\| \"bottom\" | 否 | - | position值说明(仅App生效) top: 居上显示; center: 居中显示;bottom: 居底显示 |\n| success | (res: ShowToastSuccess) => void \\| null | 否 | - | uni.showToast成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showToast失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showToast完成回调函数定义 |\n","returnValue":"","compatibility":"### showToast 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showToast]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showToast)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/toast/toast.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/toast/toast\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'toast',\n exeRet: ''\n }\n },\n onLoad() {\n uni.showToast({\n title: 'onLoad 调用示例,2秒后消失'\n })\n setTimeout(function () {\n uni.hideToast()\n }, 2000);\n },\n methods: {\n toast1Tap: function () {\n uni.showToast({\n title: \"默认\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toastTapIconError: function () {\n uni.showToast({\n title: \"默认\",\n icon: 'error',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast2Tap: function () {\n uni.showToast({\n title: \"duration 3000\",\n duration: 3000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast3Tap: function () {\n uni.showToast({\n title: \"loading\",\n icon: \"loading\",\n duration: 5000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast4Tap: function () {\n uni.showToast({\n title: \"logo\",\n image: \"/static/uni.png\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #ifdef APP-PLUS\n toast5Tap: function () {\n uni.showToast({\n title: \"显示一段轻提示\",\n position: 'bottom',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #endif\n hideToast: function () {\n uni.hideToast()\n }\n }\n }\n\n```\n\n:::"},"loadFontFace":{"name":"## uni.loadFontFace(options) @loadfontface","description":"\n动态加载网络字体\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [LoadFontFaceOptions](#loadfontfaceoptions-values) | 是 | - | - |\n#### LoadFontFaceOptions 的属性值 @loadfontfaceoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| global | boolean | 否 | - | 是否全局生效。微信小程序 '2.10.0'起支持全局生效,需在 app.vue 中调用。 |\n| family | string | 是 | - | 定义的字体名称 |\n| source | string | 是 | - | 字体资源的地址, App-Android 平台不支持 woff、woff2 格式字体文件 |\n| desc | [LoadFontFaceOptionDesc](#loadfontfaceoptiondesc-values) | 否 | - | 可选的字体描述符 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [LoadFontFaceError](#loadfontfaceerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### LoadFontFaceOptionDesc 的属性值 @loadfontfaceoptiondesc-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| style | string \\| null | 否 | - | |\n| weight | string \\| null | 否 | - | |\n| variant | string \\| null | 否 | - | |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### LoadFontFaceError 的属性值 @loadfontfaceerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 4 \\| 99 \\| 101 \\| 100001 \\| 100002 \\| 200001 \\| 300001 \\| 300002 | 是 | - | 错误码
- 4: 框架内部异常
- 99: page is not ready
- 101: 参数错误
- 100001: family is null
- 100002: source is null
- 200001: local font not found
- 300001: same source task is loading
- 300002: download fail |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### LoadFontFaceOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| global | √ | x | 4.0 |\n| family | √ | x | 4.0 |\n| source | √ | x | 4.0 |\n| desc | x | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### loadFontFace 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[loadFontFace](https://doc.dcloud.net.cn/uni-app-x/api/load-font-face.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.load-font-face)\n"},"load-font-face":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/load-font-face/load-font-face.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/load-font-face/load-font-face\n>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n uniIcon1: '\\ue100',\n uniIcon2: '\\ue101',\n }\n },\n onLoad() {\n uni.loadFontFace({\n global: true,\n family: 'UniFontFamily',\n source: \"url('/static/font/uni.ttf')\",\n success() {\n console.log('global loadFontFace uni.ttf success')\n },\n fail(error) {\n console.warn('global loadFontFace uni.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiTTF',\n source:\n \"url('https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf')\",\n success() {\n console.log('loadFontFace Remote AlimamaDaoLiTi.ttf success')\n },\n fail(error) {\n console.warn('loadFontFace Remote AlimamaDaoLiTi.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiOTF',\n source: \"url('/static/font/AlimamaDaoLiTi.otf')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.otf success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF',\n source: \"url('/static/font/AlimamaDaoLiTi.woff')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF2',\n source: \"url('/static/font/AlimamaDaoLiTi.woff2')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff2 success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg)\n },\n })\n },\n methods: {\n navigateToChild() {\n uni.navigateTo({\n url: '/pages/API/load-font-face/load-font-face-child',\n })\n },\n },\n }\n\n```\n\n:::"},"request":{"name":"## uni.request(param) @request","description":"发起网络请求。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| param | [RequestOptions\\](#requestoptions-values) | 是 | - | 网络请求参数 |\n#### RequestOptions\\ 的属性值 @requestoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器接口地址 |\n| data | any \\| null | 否 | null | 请求的参数 UTSJSONObject\\|string类型 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | 设置请求的 header,header 中不能设置 Referer |\n| method | Union \\| null | 否 | \"GET\" | 请求方法
- GET GET方法请求一个指定资源的表示形式,使用 GET 的请求应该只被用于获取数据。
- POST POST方法用于将实体提交到指定的资源,通常导致在服务器上的状态变化或副作用。
- PUT PUT方法用有效载荷请求替换目标资源的所有当前表示。
- PATCH PATCH方法用于对资源应用部分修改。
- DELETE DELETE方法删除指定的资源。
- HEAD HEAD方法请求一个与GET请求的响应相同的响应,但没有响应体。
- OPTIONS OPTIONS 方法用于描述目标资源的通信选项。 |\n| timeout | number \\| null | 否 | 60000 | 超时时间,单位 ms |\n| firstIpv4 | boolean \\| null | 否 | false | DNS解析时优先使用ipv4 |\n| success | (option: [RequestSuccess\\](#requestsuccess-values)) => void \\| null | 否 | null | 网络请求成功回调。 |\n| fail | (option: [RequestFail](#requestfail-values)) => void \\| null | 否 | null | 网络请求失败回调。 |\n| complete | (option: any) => void \\| null | 否 | null | 网络请求完成回调,成功或者失败都会调用。 |\n\n##### RequestSuccess\\ 的属性值 @requestsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | T \\| null | 否 | - | 开发者服务器返回的数据 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n| header | any | 是 | - | 开发者服务器返回的 HTTP Response Header |\n| cookies | Array\\ | 是 | - | 开发者服务器返回的 cookies,格式为字符串数组 |\n\n##### RequestFail 的属性值 @requestfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | 错误码
- 5 接口超时
- 1000 服务端系统错误
- 100001 json数据解析错误
- 100002 错误信息json解析失败
- 600003 网络中断
- 600009 URL格式不合法
- 602001 request系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestTask](#requesttask-values) | \n\n#### RequestTask 的方法 @requesttask-values \n\n#### abort() @abort\n中断网络请求。\n\n\n##### abort 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | x |\n\n\n##### 参见\n[abort](https://uniapp.dcloud.net.cn/api/request/request.html#request)\n","compatibility":"### request 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[request](https://uniapp.dcloud.net.cn/api/request/request.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.request)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request/request.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/request/request\n>Template\n```vue\n\r\n\r\n\n```\n>Script\n```uts\n\r\n const duration = 2000\r\n const methodMap = {\r\n \"GET\": \"/api/http/method/get\",\r\n \"POST\": \"/api/http/method/post\",\r\n \"PUT\": \"/api/http/method/put\",\r\n \"DELETE\": \"/api/http/method/delete\",\r\n \"PATCH\": \"/api/http/method/patch\",\r\n \"OPTIONS\": \"/api/http/method/options\",\r\n \"HEAD\": \"/api/http/method/head\"\r\n }\r\n\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'request',\r\n res: '',\r\n task: null as RequestTask | null,\r\n host: \"https://request.dcloud.net.cn\",\r\n url: \"/api/http/method/get\",\r\n method: \"GET\" as RequestMethod | null,\r\n data: null as any | null,\r\n header: null as UTSJSONObject | null,\r\n errorCodeUrls: [\r\n \"/api/http/statusCode/200\",\r\n \"/api/http/statusCode/204\",\r\n \"/api/http/statusCode/301\",\r\n \"/api/http/statusCode/302\",\r\n \"/api/http/statusCode/307\",\r\n \"/api/http/statusCode/400\",\r\n \"/api/http/statusCode/401\",\r\n \"/api/http/statusCode/403\",\r\n \"/api/http/statusCode/404\",\r\n \"/api/http/statusCode/405\",\r\n \"/api/http/statusCode/500\",\r\n \"/api/http/statusCode/502\",\r\n \"/api/http/statusCode/503\",\r\n \"/api/http/statusCode/504\",\r\n ],\r\n headerUrls: [\r\n \"/api/http/header/ua\",\r\n \"/api/http/header/referer\",\r\n \"/api/http/header/requestCookie\",\r\n \"/api/http/header/setCookie\",\r\n \"/api/http/header/deleteCookie\"\r\n ],\r\n contentTypeUrls: [\r\n \"/api/http/contentType/text/plain\",\r\n \"/api/http/contentType/text/html\",\r\n \"/api/http/contentType/text/xml\",\r\n \"/api/http/contentType/image/gif\",\r\n \"/api/http/contentType/image/jpeg\",\r\n \"/api/http/contentType/image/png\",\r\n \"/api/http/contentType/application/json\",\r\n \"/api/http/contentType/application/octetStream\",\r\n ],\r\n postUrls: [\r\n \"/api/http/contentType/json\",\r\n \"/api/http/contentType/xWwwFormUrlencoded\",\r\n ],\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n changeMethod(e : RequestMethod) {\r\n this.method = e;\r\n this.url = methodMap[e] as string;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrl(e : string) {\r\n this.method = \"GET\";\r\n this.url = e;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrlFromPost(e : string) {\r\n this.method = \"POST\";\r\n this.url = e;\r\n switch (e) {\r\n case \"/api/http/contentType/json\":\r\n this.header = {\r\n \"Content-Type\": \"application/json\"\r\n };\r\n this.data = {\r\n \"hello\": \"world\"\r\n };\r\n break;\r\n case \"/api/http/contentType/xWwwFormUrlencoded\":\r\n this.header = {\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n };\r\n this.data = \"hello=world\";\r\n break;\r\n }\r\n },\r\n sendRequest() {\r\n uni.showLoading({\r\n title: \"请求中...\"\r\n })\r\n this.task = uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\r\n console.log('request success', JSON.stringify(res.data))\r\n console.log('request success header is :', JSON.stringify(res.header))\r\n uni.showToast({\r\n title: '请求成功',\r\n icon: 'success',\r\n mask: true,\r\n duration: duration\r\n });\r\n this.res = '请求结果 : ' + JSON.stringify(res);\r\n },\r\n fail: (err) => {\r\n console.log('request fail', err);\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n complete: () => {\r\n uni.hideLoading()\r\n },\r\n });\r\n },\r\n //自动化测试例专用\r\n jest_request() {\r\n uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_request(needCookie : boolean) {\r\n uni.request({\r\n url: this.host + \"/api/http/header/requestCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\r\n const requestCookie = (res.data as UTSJSONObject).getJSON(\"data\")?.getAny(\"requestCookie\")\r\n console.log(\"requestCookie \", requestCookie);\r\n if (requestCookie instanceof Array) {\r\n this.jest_result = needCookie ? requestCookie.length > 0 : requestCookie.length == 0\r\n } else {\r\n this.jest_result = needCookie ? (requestCookie as UTSJSONObject).toMap().size > 0 : (requestCookie as UTSJSONObject).toMap().size == 0\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"uploadFile":{"name":"## uni.uploadFile(options) @uploadfile","description":"将本地资源上传到开发者服务器。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UploadFileOptions](#uploadfileoptions-values) | 是 | - | - |\n#### UploadFileOptions 的属性值 @uploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器 url |\n| filePath | string \\| null | 否 | null | 要上传文件资源的路径 |\n| name | string \\| null | 否 | null | 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 |\n| files | Array\\<[UploadFileOptionFiles](#uploadfileoptionfiles-values)\\> \\| null | 否 | null | 需要上传的文件列表。 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | HTTP 请求 Header, header 中不能设置 Referer |\n| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | HTTP 请求中其他额外的 form data |\n| timeout | number \\| null | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [UploadFileSuccess](#uploadfilesuccess-values)) => void \\| null | 否 | null | 成功返回的回调函数 |\n| fail | (result: [UploadFileFail](#uploadfilefail-values)) => void \\| null | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### UploadFileOptionFiles 的属性值 @uploadfileoptionfiles-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string \\| null | 否 | \"file\" | multipart 提交时,表单的项目名,默认为 file,如果 name 不填或填的值相同,可能导致服务端读取文件时只能读取到一个文件。 |\n| uri | string | 是 | - | 要上传文件资源的路径 |\n\n##### UploadFileSuccess 的属性值 @uploadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | string | 是 | - | 开发者服务器返回的数据 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### UploadFileFail 的属性值 @uploadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | 错误码
- 5 接口超时
- 1000 服务端系统错误
- 100001 json数据解析错误
- 100002 错误信息json解析失败
- 600003 网络中断
- 600009 URL格式不合法
- 602001 request系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UploadTask](#uploadtask-values) | \n\n#### UploadTask 的方法 @uploadtask-values \n\n#### abort() @abort\n中断上传任务。\n\n\n##### abort 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | x |\n\n\n##### 参见\n[abort](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监听上传进度变化。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnProgressUpdateResult](#onprogressupdateresult-values)) => void | 是 | - | - |\n###### OnProgressUpdateResult 的属性值 @onprogressupdateresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 上传进度百分比 |\n| totalBytesSent | number | 是 | - | 已经上传的数据长度,单位 Bytes |\n| totalBytesExpectedToSend | number | 是 | - | 预期需要上传的数据总长度,单位 Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | - |\n\n\n##### 参见\n[onProgressUpdate](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n","compatibility":"### uploadFile 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[uploadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.upload-file)\n"},"upload-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/upload-file/upload-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/upload-file/upload-file\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'uploadFile',\r\n imageSrc: '',\r\n task: null as UploadTask | null,\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n chooseImage: function () {\r\n uni.chooseImage({\r\n count: 1,\r\n sizeType: ['compressed'],\r\n sourceType: ['album'],\r\n success: (res) => {\r\n console.log('chooseImage success, temp path is', res.tempFilePaths[0])\r\n var imageSrc = res.tempFilePaths[0]\r\n uni.showLoading({\r\n title: '上传中'\r\n })\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,非真实的接口地址\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: (res) => {\r\n console.log('uploadImage success, res is:', res)\r\n uni.hideLoading();\r\n uni.showToast({\r\n title: '上传成功',\r\n icon: 'success',\r\n duration: 1000\r\n })\r\n this.imageSrc = imageSrc\r\n },\r\n fail: (err) => {\r\n console.log('uploadImage fail', err);\r\n uni.hideLoading();\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n });\r\n },\r\n fail: (err) => {\r\n console.log('chooseImage fail', err)\r\n }\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_uploadFile() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,非真实的接口地址\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_upload(needCookie : boolean) {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://request.dcloud.net.cn/api/http/header/upload',\r\n filePath: imageSrc,\r\n name: 'file',\r\n success: (res : UploadFileSuccess) => {\r\n const data = JSON.parseObject(res.data)\r\n const errCode = data?.getNumber(\"errCode\")\r\n if (errCode != null && errCode == 1000) {\r\n this.jest_result = needCookie ? false : true;\r\n } else {\r\n this.jest_result = needCookie ? true : false;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_files_upload() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload',\r\n files: [\r\n {\r\n name: \"file1\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles,\r\n {\r\n name: \"file2\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles\r\n ],\r\n success: (res : UploadFileSuccess) => {\r\n if (res.statusCode == 200) {\r\n this.jest_result = true;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"downloadFile":{"name":"## uni.downloadFile(options) @downloadfile","description":"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [DownloadFileOptions](#downloadfileoptions-values) | 是 | - | - |\n#### DownloadFileOptions 的属性值 @downloadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 下载资源的 url |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |\n| filePath | string \\| null | 否 | null | 指定文件下载路径
支持相对路径与绝对路径,例:
`/imgs/pic.png`、`/storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/temp/imgs/pic.png`
并且支持指定下载目录,例:
`/imgs/` |\n| timeout | number \\| null | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [DownloadFileSuccess](#downloadfilesuccess-values)) => void \\| null | 否 | null | 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} |\n| fail | (result: [DownloadFileFail](#downloadfilefail-values)) => void \\| null | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### DownloadFileSuccess 的属性值 @downloadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFilePath | string | 是 | - | 临时文件路径,下载后的文件会存储到一个临时文件 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### DownloadFileFail 的属性值 @downloadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | 错误码
- 5 接口超时
- 1000 服务端系统错误
- 100001 json数据解析错误
- 100002 错误信息json解析失败
- 600003 网络中断
- 600009 URL格式不合法
- 602001 request系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [DownloadTask](#downloadtask-values) | \n\n#### DownloadTask 的方法 @downloadtask-values \n\n#### abort() @abort\n中断下载任务。\n\n\n##### abort 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | x |\n\n\n##### 参见\n[abort](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监听下载进度变化。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnProgressDownloadResult](#onprogressdownloadresult-values)) => void | 是 | - | - |\n###### OnProgressDownloadResult 的属性值 @onprogressdownloadresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 下载进度百分比 |\n| totalBytesWritten | number | 是 | - | 已经下载的数据长度,单位 Bytes |\n| totalBytesExpectedToWrite | number | 是 | - | 预期需要下载的数据总长度,单位 Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | - |\n\n\n##### 参见\n[onProgressUpdate](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n","compatibility":"### downloadFile 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[downloadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.download-file)\n"},"download-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/download-file/download-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/download-file/download-file\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'downloadFile',\r\n imageSrc: '',\r\n task: null as DownloadTask | null,\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n // this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n downloadImage: function () {\r\n uni.showLoading({\r\n title: '下载中'\r\n })\r\n var self = this\r\n this.task = uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: (res) => {\r\n console.log('downloadFile success, res is', res.tempFilePath)\r\n self.imageSrc = res.tempFilePath;\r\n uni.hideLoading();\r\n },\r\n fail: (err) => {\r\n console.log('downloadFile fail, err is:', err)\r\n uni.hideLoading();\r\n }\r\n });\r\n this.task?.onProgressUpdate((update) => {\r\n console.log(\"progress : \", update.progress);\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_downloadFile() {\r\n uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: () => {\r\n this.jest_result = true\r\n },\r\n fail: () => {\r\n this.jest_result = false\r\n }\r\n });\r\n },\n\n jest_set_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(true)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n\n jest_delete_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(false)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_cookie_download(needCookie: boolean){\n uni.downloadFile({\n url: \"https://request.dcloud.net.cn/api/http/header/download\",\n success: () => {\n this.jest_result = needCookie ? true : false;\n },\n fail: () => {\n this.jest_result = needCookie ? false : true;\n }\n });\n }\r\n }\r\n }\r\n\n```\n\n:::"},"getNetworkType":{"name":"## uni.getNetworkType(options) @getnetworktype","description":"获取网络类型","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetNetworkTypeOptions](#getnetworktypeoptions-values) | 是 | - | - |\n#### GetNetworkTypeOptions 的属性值 @getnetworktypeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetNetworkTypeSuccess](#getnetworktypesuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetNetworkTypeSuccess 的属性值 @getnetworktypesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| networkType | string | 是 | - | 网络类型 |\n","returnValue":"","compatibility":"### getNetworkType 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getNetworkType](http://uniapp.dcloud.io/api/system/network?id=getnetworktype)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.get-network-type)\n"},"get-network-type":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-network-type/get-network-type.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-network-type/get-network-type\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'getNetworkType',\r\n hasNetworkType: false,\r\n networkType: '',\r\n connectedWifi: '',\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload: function () {\r\n this.networkType = '';\r\n this.hasNetworkType = false;\r\n },\r\n methods: {\r\n getNetworkType: function () {\r\n uni.getNetworkType({\r\n success: (res) => {\r\n console.log(res)\r\n this.hasNetworkType = true;\r\n this.networkType = res.networkType\r\n },\r\n fail: () => {\r\n uni.showModal({\r\n content: '获取失败!',\r\n showCancel: false\r\n })\r\n }\r\n })\r\n },\r\n clear: function () {\r\n this.hasNetworkType = false;\r\n this.networkType = '';\r\n this.connectedWifi = '';\r\n },\r\n //自动化测试例专用\r\n jest_getNetworkType() {\r\n uni.getNetworkType({\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"connectSocket":{"name":"## connectSocket(options) @connectsocket","description":"创建一个 WebSocket 连接。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ConnectSocketOptions](#connectsocketoptions-values) | 是 | - | - |\n#### ConnectSocketOptions 的属性值 @connectsocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | 如果属性名存在,且类型为UTSJSONObject返回对应的结果,不存在返回null |\n| protocols | Array\\ \\| null | 否 | null | 子协议数组 |\n| success | (result: [ConnectSocketSuccess](#connectsocketsuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [ConnectSocketFail](#connectsocketfail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ConnectSocketSuccess 的属性值 @connectsocketsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ConnectSocketFail 的属性值 @connectsocketfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 错误码 - 600009 URL格式不合法 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SocketTask](#sockettask-values) | \n\n#### SocketTask 的方法 @sockettask-values \n\n#### send(options) @send\n通过 WebSocket 连接发送数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - |\n###### SendSocketMessageOptions 的属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | 错误码
- 10001 发送数据超限,发送队列不能超过16M大小。
- 10002 websocket未连接
- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n##### send 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[send](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send)\n\n#### close(options) @close\n关闭 WebSocket 连接\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CloseSocketOptions](#closesocketoptions-values) | 是 | - | - |\n###### CloseSocketOptions 的属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number \\| null | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string \\| null | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n##### close 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[close](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close)\n\n#### onOpen(callback) @onopen\n监听 WebSocket 连接打开事件\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - |\n###### OnSocketOpenCallbackResult 的属性值 @onsocketopencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| header | any | 是 | - | 连接成功的 HTTP 响应 Header |\n\n\n##### onOpen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onOpen](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen)\n\n#### onClose(callback) @onclose\n监听 WebSocket 连接关闭事件\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n##### onClose 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onClose](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose)\n\n#### onError(callback) @onerror\n监听 WebSocket 错误\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 是 | - | - |\n\n##### onError 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onError](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror)\n\n#### onMessage(callback) @onmessage\n监听 WebSocket 接受到服务器的消息事件\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - |\n###### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n\n\n##### onMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onMessage](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage)\n","compatibility":"### connectSocket 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[connectSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.connectSocket)\n"},"onSocketOpen":{"name":"## onSocketOpen(options) @onsocketopen","description":"监听WebSocket连接打开事件。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - |","returnValue":"","compatibility":"### onSocketOpen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketOpen](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketopen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketOpen)\n"},"onSocketError":{"name":"## onSocketError(callback) @onsocketerror","description":"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketErrorCallbackResult](#onsocketerrorcallbackresult-values)) => void | 是 | - | - |\n#### OnSocketErrorCallbackResult 的属性值 @onsocketerrorcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n","returnValue":"","compatibility":"### onSocketError 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketError](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketError)\n"},"sendSocketMessage":{"name":"## sendSocketMessage(options) @sendsocketmessage","description":"通过 WebSocket 连接发送数据,需要先 uni.connectSocket,并在 uni.onSocketOpen 回调之后才能发送。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - |\n#### SendSocketMessageOptions 的属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | 错误码
- 10001 发送数据超限,发送队列不能超过16M大小。
- 10002 websocket未连接
- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### sendSocketMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[sendSocketMessage](https://uniapp.dcloud.net.cn/api/request/websocket.html#sendsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.sendSocketMessage)\n"},"onSocketMessage":{"name":"## onSocketMessage(callback) @onsocketmessage","description":"监听WebSocket接受到服务器的消息事件。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n","returnValue":"","compatibility":"### onSocketMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketMessage](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketMessage)\n"},"closeSocket":{"name":"## closeSocket(options) @closesocket","description":"关闭 WebSocket 连接。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CloseSocketOptions](#closesocketoptions-values) | 是 | - | - |\n#### CloseSocketOptions 的属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number \\| null | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string \\| null | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### closeSocket 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[closeSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.closeSocket)\n"},"onSocketClose":{"name":"## onSocketClose(callback) @onsocketclose","description":"监听WebSocket关闭。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketCloseCallbackResult](#onsocketclosecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketCloseCallbackResult 的属性值 @onsocketclosecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 是 | - | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。\t |\n| reason | string | 是 | - | 一个可读的字符串,表示连接被关闭的原因。\t |\n","returnValue":"","compatibility":"### onSocketClose 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketClose](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketClose)\n"},"websocket-global":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/websocket-global/websocket-global.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/websocket-global/websocket-global\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n connected: false,\r\n connecting: false,\r\n msg: '',\r\n roomId: '',\r\n platform: '',\r\n }\r\n },\r\n computed: {\r\n showMsg() : string {\r\n if (this.connected) {\r\n if (this.msg.length > 0) {\r\n return '收到消息:' + this.msg\r\n } else {\r\n return '等待接收消息'\r\n }\r\n } else {\r\n return '尚未连接'\r\n }\r\n },\r\n },\r\n onLoad() {\r\n this.platform = uni.getSystemInfoSync().platform\r\n },\r\n onUnload() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n uni.hideLoading()\r\n },\r\n methods: {\r\n connect() {\r\n if (this.connected || this.connecting) {\r\n uni.showModal({\r\n content: '正在连接或者已经连接,请勿重复连接',\r\n showCancel: false,\r\n })\r\n return\r\n }\r\n this.connecting = true\r\n uni.showLoading({\r\n title: '连接中...',\r\n })\r\n uni.connectSocket({\r\n url: 'ws://websocket.dcloud.net.cn',\r\n header: null,\r\n protocols: null,\r\n success: (res : any) => {\r\n // 这里是接口调用成功的回调,不是连接成功的回调,请注意\r\n console.log('uni.connectSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n // 这里是接口调用失败的回调,不是连接失败的回调,请注意\r\n console.log('uni.connectSocket fail', err)\r\n },\r\n })\r\n uni.onSocketOpen((res) => {\r\n this.connecting = false\r\n this.connected = true\r\n uni.hideLoading()\r\n\r\n uni.showToast({\r\n icon: 'none',\r\n title: '连接成功',\r\n })\r\n console.log('onOpen', res)\r\n })\r\n uni.onSocketError((err) => {\r\n this.connecting = false\r\n this.connected = false\r\n uni.hideLoading()\r\n\r\n uni.showModal({\r\n content: '连接失败,可能是websocket服务不可用,请稍后再试',\r\n showCancel: false,\r\n })\r\n console.log('onError', err)\r\n })\r\n uni.onSocketMessage((res) => {\r\n this.msg = res.data as string\r\n console.log('onMessage', res)\r\n })\r\n uni.onSocketClose((res) => {\r\n this.connected = false\r\n this.msg = ''\r\n console.log('onClose', res)\r\n })\r\n },\r\n send() {\r\n uni.sendSocketMessage({\r\n data:\r\n 'from ' +\r\n this.platform +\r\n ' : ' +\r\n parseInt((Math.random() * 10000).toString()).toString(),\r\n success: (res : any) => {\r\n console.log(res)\r\n },\r\n fail: (err : any) => {\r\n console.log(err)\r\n },\r\n } as SendSocketMessageOptions)\r\n },\r\n close() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n },\r\n },\r\n }\r\n\n```\n\n:::"},"getSystemInfo":{"name":"## uni.getSystemInfo(options) @getsysteminfo","description":"异步获取系统信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetSystemInfoOptions](#getsysteminfooptions-values) | 是 | - | - |\n#### GetSystemInfoOptions 的属性值 @getsysteminfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetSystemInfoResult](#getsysteminforesult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetSystemInfoResult 的属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 是 | - | `manifest.json` 中应用版本名号。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"undefined\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | 设备类型。 |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | 设备方向。 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 系统名称\t |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| osTheme | \"light\" \\| \"dark\" | 否 | - | 操作系统主题
|\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| ~~uniCompileVersion~~ | string | 是 | - | uni 编译器版本\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | uni-app 运行平台。 |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| ~~uniCompileVersionCode~~ | number | 是 | - | uni 编译器版本号\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| ~~version~~ | string | 是 | - | 引擎版本号。已废弃,仅为了向下兼容保留 \n已废弃,仅为了向下兼容保留 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| osAndroidAPILevel | number \\| null | 否 | - | Android 系统API库的版本。
|\n\n###### SafeArea 的属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n###### SafeAreaInsets 的属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n###### GetSystemInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| osTheme | √ | x | - |\n| osAndroidAPILevel | √ | x | - |\n","returnValue":"","compatibility":"### getSystemInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getSystemInfo](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfo)\n"},"getSystemInfoSync":{"name":"## uni.getSystemInfoSync() @getsysteminfosync","description":"同步获取系统信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetSystemInfoResult](#getsysteminforesult-values) | \n\n#### GetSystemInfoResult 的属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 是 | - | `manifest.json` 中应用版本名号。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"null\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | 设备类型。 |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | 设备方向。 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 系统名称\t |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| osTheme | \"light\" \\| \"dark\" | 否 | - | 操作系统主题
|\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| ~~uniCompileVersion~~ | string | 是 | - | uni 编译器版本\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | uni-app 运行平台。 |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| ~~uniCompileVersionCode~~ | number | 是 | - | uni 编译器版本号\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| ~~version~~ | string | 是 | - | 引擎版本号。已废弃,仅为了向下兼容保留 \n已废弃,仅为了向下兼容保留 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| osAndroidAPILevel | number \\| null | 否 | - | Android 系统API库的版本。
|\n\n##### SafeArea 的属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 的属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n##### GetSystemInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| osTheme | √ | x | - |\n| osAndroidAPILevel | √ | x | - |\n","compatibility":"### getSystemInfoSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getSystemInfoSync](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfoSync)\n"},"get-system-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-info/get-system-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-system-info/get-system-info\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getSystemInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getSystemInfo: function () {\r\n uni.getSystemInfo({\r\n success: (res) => {\r\n this.items = [] as Item[];\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n },\r\n })\r\n },\r\n getSystemInfoSync: function () {\r\n this.items = [] as Item[];\r\n const res = uni.getSystemInfoSync()\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n },\r\n //自动化测试例专用\r\n jest_getSystemInfo() : GetSystemInfoResult {\r\n return uni.getSystemInfoSync();\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"getDeviceInfo":{"name":"## uni.getDeviceInfo(options?) @getdeviceinfo","description":"获取设备信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetDeviceInfoOptions](#getdeviceinfooptions-values) | 否 | 包含所有字段的过滤对象 | [options=包含所有字段的过滤对象\\] 过滤的字段对象, 不传参数默认为获取全部字段。 |\n#### GetDeviceInfoOptions 的属性值 @getdeviceinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filter | Array\\ | 是 | - | 过滤字段的字符串数组,假如要获取指定字段,传入此数组。 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetDeviceInfoResult](#getdeviceinforesult-values) | \n\n#### GetDeviceInfoResult 的属性值 @getdeviceinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| brand | string | 否 | - | 设备品牌 |\n| deviceBrand | string | 否 | - | 设备品牌 |\n| deviceId | string | 否 | - | 设备 id 。由 uni-app 框架生成并存储,清空 Storage 会导致改变 |\n| model | string | 否 | - | 设备型号\t |\n| deviceModel | string | 否 | - | 设备型号\t |\n| deviceType | string | 否 | - | 设备类型phone、pad、pc\t |\n| deviceOrientation | string | 否 | - | 设备方向 竖屏 portrait、横屏 landscape\t |\n| devicePixelRatio | string | 否 | - | 设备像素比\t |\n| system | string | 否 | - | 操作系统及版本\t |\n| platform | string | 否 | - | 客户端平台\t |\n| isRoot | boolean | 否 | - | 是否root |\n| isSimulator | boolean | 否 | - | 是否是模拟器 |\n| isUSBDebugging | boolean | 否 | - | adb是否开启 |\n\n##### GetDeviceInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| isUSBDebugging | √ | x | - |\n","compatibility":"### getDeviceInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getDeviceInfo](https://uniapp.dcloud.net.cn/api/system/getDeviceInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-device-info)\n"},"get-device-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-device-info/get-device-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-device-info/get-device-info\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { setDevicePixelRatio } from '@/store/index.uts'\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getDeviceInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getDeviceInfo: function () {\r\n const res = uni.getDeviceInfo();\r\n // 获取像素比, 供截图对比使用\r\n setDevicePixelRatio(res.devicePixelRatio !== null ? parseFloat(res.devicePixelRatio!) : 1)\r\n this.items = [] as Item[];\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"getWindowInfo":{"name":"## uni.getWindowInfo() @getwindowinfo","description":"同步获取窗口信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetWindowInfoResult](#getwindowinforesult-values) | \n\n#### GetWindowInfoResult 的属性值 @getwindowinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| pixelRatio | number | 是 | - | 设备像素比 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| screenTop | number | 是 | - | 窗口上边缘的 y 值 |\n\n##### SafeArea 的属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 的属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n","compatibility":"### getWindowInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getWindowInfo](http://uniapp.dcloud.io/api/system/getWindowInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-window-info)\n"},"get-window-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-window-info/get-window-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-window-info/get-window-info\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { setStatusBarHeight } from '@/store/index.uts'\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getWindowInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\n onReady() {\n this.getWindowInfo()\n },\r\n methods: {\r\n getWindowInfo: function () {\r\n const res = uni.getWindowInfo();\r\n // 获取状态栏+导航栏高度, 供截图对比使用\r\n setStatusBarHeight(res.statusBarHeight);\r\n this.items = [] as Item[];\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n },\r\n //自动化测试例专用\r\n jest_getWindowInfo() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"getAppBaseInfo":{"name":"## uni.getAppBaseInfo(options?) @getappbaseinfo","description":"获取app基本信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetAppBaseInfoOptions](#getappbaseinfooptions-values) | 否 | 包含所有字段的过滤对象 | [options=包含所有字段的过滤对象\\] 过滤的字段对象, 不传参数默认为获取全部字段。 |\n#### GetAppBaseInfoOptions 的属性值 @getappbaseinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filter | Array\\ | 是 | - | 过滤字段的字符串数组,假如要获取指定字段,传入此数组。 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetAppBaseInfoResult](#getappbaseinforesult-values) | \n\n#### GetAppBaseInfoResult 的属性值 @getappbaseinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| appId | string | 否 | - | manifest.json 中应用appid,即DCloud appid。\t |\n| appName | string | 否 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 否 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 否 | - | `manifest.json` 中应用版本名号。 |\n| appLanguage | string | 否 | - | 应用设置的语言en、zh-Hans、zh-Hant、fr、es\t |\n| language | string | 否 | - | 应用设置的语言\t |\n| ~~version~~ | string | 否 | - | 引擎版本号。已废弃,仅为了向下兼容保留\n已废弃,仅为了向下兼容保留 |\n| isUniAppX | boolean | 否 | - | 是否uni-app x |\n| ~~uniCompileVersion~~ | string | 否 | - | uni 编译器版本\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersion | string | 否 | - | uni 编译器版本 |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 否 | - | uni-app 运行平台。 |\n| uniRuntimeVersion | string | 否 | - | uni 运行时版本 |\n| ~~uniCompileVersionCode~~ | number | 否 | - | uni 编译器版本号\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersionCode | number | 否 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 否 | - | uni 运行时版本号 |\n| packageName | string | 否 | - | Android的包名 |\n| signature | string | 否 | - | Android: 应用签名证书的SHA1值(全部为小写,中间不包含“:”)。 为了保证应用的安全性,请使用自己生成的证书(不要使用公共测试证书)。 iOS: 应用签名证书中绑定的Bundle ID(AppleID)的md5值(全部为小写)。 |\n\n##### GetAppBaseInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| uniCompilerVersion | 4.0 | x | - |\n| uniCompilerVersionCode | 4.0 | x | - |\n| packageName | 3.97 | x | - |\n| signature | 3.97 | x | - |\n","compatibility":"### getAppBaseInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getAppBaseInfo](https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-base-info)\n"},"get-app-base-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-base-info/get-app-base-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app-base-info/get-app-base-info\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\n\ttype Item = {\n\t\tlabel : string,\n\t\tvalue : string,\n\t}\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\ttitle: 'getAppBaseInfo',\n\t\t\t\titems: [] as Item[],\r\n\t\t\t}\r\n\t\t},\r\n\t\tonUnload:function(){\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tgetAppBaseInfo: function () {\n\t\t\t\tconst res = uni.getAppBaseInfo();\n this.items = [] as Item[];\n for(const key in res){\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n }\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\n```\n\n:::"},"getAppAuthorizeSetting":{"name":"## uni.getAppAuthorizeSetting() @getappauthorizesetting","description":"获取 APP 授权设置。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetAppAuthorizeSettingResult](#getappauthorizesettingresult-values) | \n\n#### GetAppAuthorizeSettingResult 的属性值 @getappauthorizesettingresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| cameraAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 使用摄像头的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台:表示没有配置 `android.permission.CAMERA` 权限,[权限配置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions);iOS平台没有该值 |\n| locationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 使用定位的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台:表示没有配置 `android.permission.ACCESS_COARSE_LOCATION` 权限,[权限配置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions);iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `Geolocation(定位)` 模块 |\n| locationAccuracy | \"reduced\" \\| \"full\" \\| \"unsupported\" | 否 | - | 定位准确度。
- reduced: 模糊定位
- full: 精准定位
- unsupported: 不支持(包括用户拒绝定位权限和没有在 `manifest.json -> App模块配置` 中配置 `Geolocation(定位)` 模块) |\n| microphoneAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 使用麦克风的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台:表示没有配置 `android.permission.RECORD_AUDIO` 权限,[权限配置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions);iOS平台没有该值 |\n| notificationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 通知的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块 |\n","compatibility":"### getAppAuthorizeSetting 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | - |\n","tutorial":"\n### 参见\n[getAppAuthorizeSetting](http://uniapp.dcloud.io/api/system/getappauthorizesetting)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-authorize-setting)\n"},"get-app-authorize-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue) \n ```vue\n\r\n\r\n\r\n\n\n```"},"getSystemSetting":{"name":"## uni.getSystemSetting() @getsystemsetting","description":"获取系统设置","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetSystemSettingResult](#getsystemsettingresult-values) | \n\n#### GetSystemSettingResult 的属性值 @getsystemsettingresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| bluetoothEnabled | boolean | 否 | - | 蓝牙是否开启 |\n| bluetoothError | string | 否 | - | 蓝牙的报错信息 |\n| locationEnabled | boolean | 是 | - | 位置是否开启 |\n| wifiEnabled | boolean | 否 | - | wifi是否开启 |\n| wifiError | string | 否 | - | wifi的报错信息 |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | 设备方向 |\n","compatibility":"### getSystemSetting 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | - |\n","tutorial":"\n### 参见\n[getSystemSetting](https://uniapp.dcloud.net.cn/api/system/getsystemsetting.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-setting)\n"},"get-system-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-setting/get-system-setting.uvue) \n ```vue\n\n\r\n\r\n\r\n\n\n```"},"installApk":{"name":"## uni.installApk(options) @installapk","description":"安装apk","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [InstallApkOptions](#installapkoptions-values) | 是 | - | - |\n#### InstallApkOptions 的属性值 @installapkoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string | 是 | - | apk文件地址 |\n| success | (res: [InstallApkSuccess](#installapksuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (err: [InstallApkFail](#installapkfail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### InstallApkSuccess 的属性值 @installapksuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 安装成功消息 |\n\n##### InstallApkFail 的属性值 @installapkfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 错误码 - 1300002 找不到文件 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### installApk 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.94 | x | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.install-apk)\n"},"install-apk":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/install-apk/install-apk.uvue) \n ```vue\n\r\n\r\n\n\n```"},"getPushClientId":{"name":"## uni.getPushClientId(options) @getpushclientid","description":"获取客户端唯一的推送标识","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetPushClientIdOptions](#getpushclientidoptions-values) | 是 | - | - |\n#### GetPushClientIdOptions 的属性值 @getpushclientidoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetPushClientIdSuccess](#getpushclientidsuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetPushClientIdSuccess 的属性值 @getpushclientidsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| cid | string | 是 | - | 个推客户端推送id,对应uni-id-device表的push_clientid |\n| errMsg | string | 是 | - | 错误描述 |\n","returnValue":"","compatibility":"### getPushClientId 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[getPushClientId](http://uniapp.dcloud.io/api/plugins/push.html#getpushclientid)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getPushClientId)\n"},"onPushMessage":{"name":"## uni.onPushMessage(callback) @onpushmessage","description":"启动监听推送消息事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | 事件类型
- click 从系统推送服务点击消息启动应用事件
- receive 应用从推送服务器接收到推送消息事件 |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | 消息内容 |\n","returnValue":"","compatibility":"### onPushMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[onPushMessage](http://uniapp.dcloud.io/api/plugins/push.html#onpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.onPushMessage)\n"},"offPushMessage":{"name":"## uni.offPushMessage(callback) @offpushmessage","description":"关闭推送消息监听事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | 事件类型
- click 从系统推送服务点击消息启动应用事件
- receive 应用从推送服务器接收到推送消息事件 |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | 消息内容 |\n","returnValue":"","compatibility":"### offPushMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[offPushMessage](http://uniapp.dcloud.io/api/plugins/push.html#offpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.offPushMessage)\n"},"getChannelManager":{"name":"## uni.getChannelManager() @getchannelmanager","description":"获取通知渠道管理器,Android 8系统以上才可以设置通知渠道,Android 8系统以下返回null。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [ChannelManager](#channelmanager-values) | \n\n#### ChannelManager 的方法 @channelmanager-values \n\n#### setPushChannel(options) @setpushchannel\n\n设置推送渠道\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetPushChannelOptions](#setpushchanneloptions-values) | 是 | - | - |\n###### SetPushChannelOptions 的属性值 @setpushchanneloptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| soundName | string \\| null | 否 | null | 添加的声音文件,注意raw目录下必须要有 ,不传此字段将使用默认铃音。 |\n| channelId | string | 是 | - | 通知渠道id |\n| channelDesc | string | 是 | - | 通知渠道描述 |\n| enableLights | boolean \\| null | 否 | false | 呼吸灯闪烁 |\n| enableVibration | boolean \\| null | 否 | false | 震动 |\n| importance | number \\| null | 否 | 3 | 通知的重要性级别,可选范围IMPORTANCE_LOW:2、IMPORTANCE_DEFAULT:3、IMPORTANCE_HIGH:4 。 |\n| lockscreenVisibility | number \\| null | 否 | -1000 | 锁屏可见性,可选范围VISIBILITY_PRIVATE:0、VISIBILITY_PUBLIC:1、VISIBILITY_SECRET:-1、VISIBILITY_NO_OVERRIDE:-1000。 |\n\n\n##### setPushChannel 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n\n\n#### getAllChannels() @getallchannels\n\n获取当前应用注册的所有的通知渠道。\n\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\ | \n\n##### getAllChannels 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n\n","compatibility":"### getChannelManager 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getChannelManager)\n"},"createPushMessage":{"name":"## uni.createPushMessage(options) @createpushmessage","description":"创建本地通知栏消息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CreatePushMessageOptions](#createpushmessageoptions-values) | 是 | - | - |\n#### CreatePushMessageOptions 的属性值 @createpushmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| cover | boolean \\| null | 否 | false | 是否覆盖上一次提示的消息 |\n| delay | number \\| null | 否 | 0 | 提示消息延迟显示的时间,单位为s |\n| icon | string \\| null | 否 | null | 推送消息的图标 |\n| sound | string \\| null | 否 | \"system\" | 推送消息的提示音
- system: 使用系统通知提示音(默认值)
- none: 不使用提示音 |\n| title | string \\| null | 否 | App的名称 | 推送消息的标题 |\n| content | string | 是 | - | 消息显示的内容,在系统通知中心中显示的文本内容 |\n| payload | any \\| null | 否 | null | 消息承载的数据,可根据业务逻辑自定义数据格式 |\n| when | number \\| null | 否 | 当前时间 | 消息上显示的提示时间 |\n| channelId | string \\| null | 否 | \"DcloudChannelID\" | 渠道id |\n| category | string \\| null | 否 | null | 通知类别 |\n| success | (result: CreatePushMessageSuccess) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### CreatePushMessageOptions 兼容性 \n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| channelId | 4.4 | 3.98 | x | - |\n| category | 4.4 | 3.98 | x | - |\n","returnValue":"","compatibility":"### createPushMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[createPushMessage](http://uniapp.dcloud.io/api/plugins/push.html#createpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.createPushMessage)\n"},"getBatteryInfo":{"name":"## uni.getBatteryInfo(options) @getbatteryinfo","description":"获取电池电量信息\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetBatteryInfoOptions](#getbatteryinfooptions-values) | 是 | - | - |\n#### GetBatteryInfoOptions 的属性值 @getbatteryinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [GetBatteryInfoSuccess](#getbatteryinfosuccess-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n| fail | (res: UniError) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void | 否 | - | 接口调用成功的回调 |\n\n##### GetBatteryInfoSuccess 的属性值 @getbatteryinfosuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n| level | number | 是 | - | 设备电量,范围1 - 100 |\n| isCharging | boolean | 是 | - | 是否正在充电中 |\n","returnValue":"","compatibility":"### getBatteryInfo 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfo)\n"},"getBatteryInfoSync":{"name":"## uni.getBatteryInfoSync() @getbatteryinfosync","description":"获取电池电量信息\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetBatteryInfoResult](#getbatteryinforesult-values) | \n\n#### GetBatteryInfoResult 的属性值 @getbatteryinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| level | number | 是 | - | 设备电量,范围1 - 100 |\n| isCharging | boolean | 是 | - | 是否正在充电中 |\n","compatibility":"### getBatteryInfoSync 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfoSync)\n"},"get-battery-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-battery-info/get-battery-info.uvue) \n ```vue\n\n\n\n\n```"},"startWifi":{"name":"## uni.startWifi(option) @startwifi","description":"\n初始化Wi-Fi模块\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | Wifi 函数通用入参封装 |\n#### WifiOption 的属性值 @wifioption-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### startWifi 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[startWifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.startWifi)\n"},"connectWifi":{"name":"## uni.connectWifi(option) @connectwifi","description":"","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [WifiConnectOption](#wificonnectoption-values) | 是 | - | Wifi 链接参数封装 |\n#### WifiConnectOption 的属性值 @wificonnectoption-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 否 | - | - |\n| BSSID | string | 否 | - | - |\n| password | string | 否 | - | - |\n| maunal | boolean | 否 | - | - |\n| partialInfo | boolean | 否 | - | - |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### connectWifi 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| >=4.4 && <10.0 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[connectWifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#connectWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.connectWifi)\n"},"getWifiList":{"name":"## uni.getWifiList(option) @getwifilist","description":"\n请求获取 Wi-Fi 列表。wifiList 数据会在 onGetWifiList 注册的回调中返回。\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | Wifi 函数通用入参封装 |\n#### WifiOption 的属性值 @wifioption-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### getWifiList 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[getWifiList](https://uniapp.dcloud.net.cn/api/system/wifi.html#getWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getWifiList)\n"},"onGetWifiList":{"name":"## uni.onGetWifiList(callback) @ongetwifilist","description":"\n监听获取到 Wi-Fi 列表数据事件。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (wifiInfo: any) => void | 是 | - | - |","returnValue":"","compatibility":"### onGetWifiList 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onGetWifiList](https://uniapp.dcloud.net.cn/api/system/wifi.html#onGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onGetWifiList)\n"},"offGetWifiList":{"name":"## uni.offGetWifiList(callback) @offgetwifilist","description":"\n移除获取到 Wi-Fi 列表数据事件的监听函数。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### offGetWifiList 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[offGetWifiList](https://uniapp.dcloud.net.cn/api/system/wifi.html#offGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offGetWifiList)\n"},"getConnectedWifi":{"name":"## uni.getConnectedWifi(option) @getconnectedwifi","description":"\n获取已连接的 Wi-Fi 信息\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [GetConnectedWifiOptions](#getconnectedwifioptions-values) | 是 | - | 获取当前链接的wifi信息 |\n#### GetConnectedWifiOptions 的属性值 @getconnectedwifioptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| partialInfo | boolean | 否 | - | - |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### getConnectedWifi 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[getConnectedWifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#getConnectedWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getConnectedWifi)\n"},"onWifiConnected":{"name":"## uni.onWifiConnected(callback) @onwificonnected","description":"\n监听连接上 Wi-Fi 的事件\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (wifiInfo: [UniWifiResult](#uniwifiresult-values)) => void | 是 | - | - |\n#### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n##### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### onWifiConnected 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onWifiConnected](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnected)\n"},"onWifiConnectedWithPartialInfo":{"name":"## uni.onWifiConnectedWithPartialInfo(callback) @onwificonnectedwithpartialinfo","description":"\n监听连接上 Wi-Fi 的事件。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (wifiInfo: [UniWifiInfoWithPartialInfo](#uniwifiinfowithpartialinfo-values)) => void | 是 | - | - |\n#### UniWifiInfoWithPartialInfo 的属性值 @uniwifiinfowithpartialinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n","returnValue":"","compatibility":"### onWifiConnectedWithPartialInfo 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onWifiConnectedWithPartialInfo](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnectedWithPartialInfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnectedWithPartialInfo)\n"},"offWifiConnected":{"name":"## uni.offWifiConnected(callback?) @offwificonnected","description":"\n移除连接上 Wi-Fi 的事件的监听函数。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | () => void \\| null | 否 | - | |","returnValue":"","compatibility":"### offWifiConnected 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[offWifiConnected](https://uniapp.dcloud.net.cn/api/system/wifi.html#offWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offWifiConnected)\n"},"onMemoryWarning":{"name":"## uni.onMemoryWarning(callback) @onmemorywarning","description":"\n开启监听内存警告\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void | 是 | - | uni.onMemoryWarning/uni.offMemoryWarning回调函数定义 |\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| level | number | 是 | - | 内存警告等级(仅安卓平台有效,iOS始终是0) |\n","returnValue":"","compatibility":"### onMemoryWarning 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onMemoryWarning](https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.onMemoryWarning)\n"},"offMemoryWarning":{"name":"## uni.offMemoryWarning(callback?) @offmemorywarning","description":"\n取消监听内存不足告警事件\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void \\| null | 否 | - | |\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| level | number | 是 | - | 内存警告等级(仅安卓平台有效,iOS始终是0) |\n","returnValue":"","compatibility":"### offMemoryWarning 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[offMemoryWarning](https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.offMemoryWarning)\n"},"onUserCaptureScreen":{"name":"## uni.onUserCaptureScreen(callback?) @onusercapturescreen","description":"\n开启截屏监听 \n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | 否 | - | uni.onUserCaptureScreen/uni.offUserCaptureScreen回调函数定义 |\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 否 | - | 截屏文件路径(仅Android返回) |\n","returnValue":"","compatibility":"### onUserCaptureScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | 3.9.0 | - |\n","tutorial":"\n### 参见\n[onUserCaptureScreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.onUserCaptureScreen)\n"},"offUserCaptureScreen":{"name":"## uni.offUserCaptureScreen(callback?) @offusercapturescreen","description":"\n关闭截屏监听 \n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | 否 | - | |\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 否 | - | 截屏文件路径(仅Android返回) |\n","returnValue":"","compatibility":"### offUserCaptureScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | 3.9.0 | - |\n","tutorial":"\n### 参见\n[offUserCaptureScreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.offUserCaptureScreen)\n"},"createRequestPermissionListener":{"name":"## uni.createRequestPermissionListener() @createrequestpermissionlistener","description":"创建一个监听权限申请的对象。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestPermissionListener](#requestpermissionlistener-values) | \n\n#### RequestPermissionListener 的方法 @requestpermissionlistener-values \n\n#### onRequest(callback) @onrequest\n\n监听申请系统权限\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (permissions: Array\\) => void | 是 | - | 申请系统权限回调,permissions为触发权限申请的所有权限 |\n\n\n\n#### onConfirm(callback) @onconfirm\n\n监听弹出系统权限授权框\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (permissions: Array\\) => void | 是 | - | 弹出系统权限授权框回调,permissions为触发弹出权限授权框的所有权限 |\n\n\n\n#### onComplete(callback) @oncomplete\n\n监听权限申请完成\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (permissions: Array\\) => void | 是 | - | 权限申请完成回调,permissions为申请完成的所有权限 |\n\n\n\n#### stop() @stop\n\n取消所有监听\n\n\n\n","compatibility":"### createRequestPermissionListener 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 4.0 | - | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.createRequestPermissionListener)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/create-request-permission-listener/create-request-permission-listener.uvue) \n ```vue\n\n\n\n\n\n\n```"},"chooseImage":{"name":"## uni.chooseImage(options) @chooseimage","description":"从本地相册选择图片或使用相机拍照","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ChooseImageOptions](#chooseimageoptions-values) | 是 | - | - |\n#### ChooseImageOptions 的属性值 @chooseimageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| count | number \\| null | 否 | 9 | 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个。 |\n| sizeType | Array\\ \\| null | 否 | ['original','compressed'\\] | original 原图,compressed 压缩图,默认二者都有 |\n| sourceType | Array\\ \\| null | 否 | ['album','camera'\\] | album 从相册选图,camera 使用相机,默认二者都有 |\n| crop | [ChooseImageCropOptions](#chooseimagecropoptions-values) \\| null | 否 | - | 图像裁剪参数,设置后 sizeType 失效。 |\n| success | (callback: [ChooseImageSuccess](#chooseimagesuccess-values)) => void \\| null | 否 | - | 成功则返回图片的本地文件路径列表 tempFilePaths |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ChooseImageCropOptions 的属性值 @chooseimagecropoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| width | number | 是 | - | 裁剪的宽度,单位为px,用于计算裁剪宽高比。 |\n| height | number | 是 | - | 裁剪的高度,单位为px,用于计算裁剪宽高比。 |\n| quality | number \\| null | 否 | 80 | 取值范围为1-100,数值越小,质量越低(仅对jpg格式有效)。默认值为80。 |\n| resize | boolean \\| null | 否 | - | 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。 |\n\n##### ChooseImageSuccess 的属性值 @chooseimagesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errSubject | string | 是 | - | 调用API的名称 |\n| errMsg | string | 是 | - | 描述信息 |\n| tempFilePaths | Array\\ | 是 | - | 图片的本地文件路径列表 |\n| tempFiles | any | 是 | - | 图片的本地文件列表 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### chooseImage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | 4.0 |\n","tutorial":"\n### 参见\n[chooseImage](http://uniapp.dcloud.io/api/media/image?id=chooseimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.choose-image)\n"},"choose-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/choose-image/choose-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/choose-image/choose-image\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n var sourceTypeArray = [\n ['camera'],\n ['album'],\n ['camera', 'album']\n ]\n var sizeTypeArray = [\n ['compressed'],\n ['original'],\n ['compressed', 'original']\n ]\n export default {\n data() {\n return {\n title: 'choose/previewImage',\n imageList: [] as Array,\n sourceTypeIndex: 2,\n sourceType: ['拍照', '相册', '拍照或相册'],\n sizeTypeIndex: 2,\n sizeType: ['压缩', '原图', '压缩或原图'],\n countIndex: 8,\n count: [1, 2, 3, 4, 5, 6, 7, 8, 9],\n isCrop: false,\n cropPercent: 80,\n cropWidth: 100,\n cropHeight: 100,\n cropResize: false\n }\n },\n onUnload() {\n this.imageList = [];\n this.sourceTypeIndex = 2\n this.sourceType = ['拍照', '相册', '拍照或相册']\n this.sizeTypeIndex = 2\n this.sizeType = ['压缩', '原图', '压缩或原图']\n this.countIndex = 8\n },\n methods: {\n cropHeightConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropHeight = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"裁剪高度需要大于0\"\n })\n }\n },\n cropWidthConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropWidth = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"裁剪宽度需要大于0\"\n })\n }\n },\n cropPercentConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0 && value <= 100) {\n this.cropPercent = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"请输入0~100之间的值\"\n })\n }\n },\n cropResizeChange(e : UniSwitchChangeEvent) {\n this.cropResize = e.detail.value\n },\n switchCrop(e : UniSwitchChangeEvent) {\n this.isCrop = e.detail.value\n },\n removeImage(index : number) {\n this.imageList.splice(index, 1)\n },\n chooseImageSource() {\n uni.showActionSheet({\n itemList: ['拍照', '相册', '拍照或相册'],\n success: (e) => {\n this.sourceTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageType() {\n uni.showActionSheet({\n itemList: ['压缩', '原图', '压缩或原图'],\n success: (e) => {\n this.sizeTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageCount(event : InputConfirmEvent) {\n let count = parseInt(event.detail.value) - 1\n if (count < 0) {\n uni.showToast({\n position: \"bottom\",\n title: \"图片数量应该大于0\"\n })\n return\n }\n this.countIndex = count\n },\n chooseImage: function () {\n // var cropOption:ChooseImageCropOptions|null = this.isCrop ? null : new ChooseImageCropOptions( )\n if (this.imageList.length >= 9) {\n uni.showToast({\n position: \"bottom\",\n title: \"已经有9张图片了,请删除部分图片之后重新选择\"\n })\n return\n }\n uni.chooseImage({\n sourceType: sourceTypeArray[this.sourceTypeIndex],\n sizeType: sizeTypeArray[this.sizeTypeIndex],\n crop: this.isCrop ? { \"quality\": this.cropPercent, \"width\": this.cropWidth, \"height\": this.cropHeight, \"resize\": this.cropResize } as ChooseImageCropOptions : null,\n count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList.length : this.count[this.countIndex],\n success: (res) => {\n this.imageList = this.imageList.concat(res.tempFilePaths);\n },\n fail: (err) => {\n console.log(\"err: \", JSON.stringify(err));\n }\n })\n },\n previewImage: function (index : number) {\n uni.previewImage({\n current: index,\n urls: this.imageList\n })\n }\n }\n }\n\n```\n\n:::"},"previewImage":{"name":"## uni.previewImage(options) @previewimage","description":"预览图片","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [PreviewImageOptions](#previewimageoptions-values) | 是 | - | - |\n#### PreviewImageOptions 的属性值 @previewimageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| current | any \\| null | 否 | - | current 为当前显示图片的链接/索引值,不填或填写的值无效则为 urls 的第一张。 |\n| urls | Array\\ | 是 | - | 需要预览的图片链接列表 |\n| indicator | string \\| null | 否 | - | 图片指示器样式
- default: 底部圆点指示器
- number: 顶部数字指示器
- none: 不显示指示器 |\n| loop | boolean \\| null | 否 | - | 是否可循环预览 |\n| success | (callback: [PreviewImageSuccess](#previewimagesuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### PreviewImageSuccess 的属性值 @previewimagesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errSubject | string | 是 | - | 调用API的名称 |\n| errMsg | string | 是 | - | 描述信息 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### previewImage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | 4.0 |\n","tutorial":"\n### 参见\n[previewImage](http://uniapp.dcloud.io/api/media/image?id=previewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.previewImage)\n"},"closePreviewImage":{"name":"## uni.closePreviewImage(options) @closepreviewimage","description":"关闭图片预览","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ClosePreviewImageOptions](#closepreviewimageoptions-values) | 是 | - | - |\n#### ClosePreviewImageOptions 的属性值 @closepreviewimageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (callback: [ClosePreviewImageSuccess](#closepreviewimagesuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ClosePreviewImageSuccess 的属性值 @closepreviewimagesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### closePreviewImage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | - |\n","tutorial":"\n### 参见\n[closePreviewImage](http://uniapp.dcloud.io/api/media/image?id=closepreviewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.closePreviewImage)\n"},"preview-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/preview-image/preview-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/preview-image/preview-image\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string\n }\n\n export default {\n data() {\n return {\n imageList: [\"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png\", \"/static/uni.png\"],\n indicator: [{\n value: \"default\",\n name: \"圆点\"\n }, {\n value: \"number\",\n name: \"数字\"\n }, {\n value: \"none\",\n name: \"不显示\"\n }] as ItemType[],\n currentIndicator: \"default\",\n isLoop: true\n }\n },\n methods: {\n previewImage(index : number) {\n uni.previewImage({\n urls: this.imageList,\n current: index,\n indicator: this.currentIndicator,\n loop: this.isLoop\n })\n },\n chooseImage() {\n uni.chooseImage({\n sourceType: ['album'],\n success: (e) => {\n this.imageList = this.imageList.concat(e.tempFilePaths)\n },\n fail(_) {\n }\n })\n },\n onIndicatorChanged(e : UniRadioGroupChangeEvent) {\n this.currentIndicator = e.detail.value\n },\n onCheckboxChange(_ : UniCheckboxGroupChangeEvent) {\n this.isLoop = !this.isLoop\n }\n }\n }\n\n```\n\n:::"},"saveImageToPhotosAlbum":{"name":"## uni.saveImageToPhotosAlbum(options) @saveimagetophotosalbum","description":"保存图片到系统相册","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SaveImageToPhotosAlbumOptions](#saveimagetophotosalbumoptions-values) | 是 | - | - |\n#### SaveImageToPhotosAlbumOptions 的属性值 @saveimagetophotosalbumoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.ImageURIString | 是 | - | 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径 |\n| success | (callback: [SaveImageToPhotosAlbumSuccess](#saveimagetophotosalbumsuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### SaveImageToPhotosAlbumSuccess 的属性值 @saveimagetophotosalbumsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | 保存到相册的图片路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### saveImageToPhotosAlbum 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | - |\n","tutorial":"\n### 参见\n[saveImageToPhotosAlbum](http://uniapp.dcloud.io/api/media/image?id=saveimagetophotosalbum)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.save-image-to-photos-album)\n"},"save-image-to-photos-album":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/save-image-to-photos-album/save-image-to-photos-album.uvue) \n ```vue\n\n\n\n\n\n\n```"},"getLocation":{"name":"## uni.getLocation(options) @getlocation","description":"获取当前的地理位置、速度","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetLocationOptions](#getlocationoptions-values) | 是 | - | - |\n#### GetLocationOptions 的属性值 @getlocationoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | \"wgs84\" \\| \"gcj02\" \\| \"gps\" | 否 | wgs84 | 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于uni.openLocation的坐标,web端需配置定位 SDK 信息才可支持 gcj02 |\n| altitude | boolean \\| null | 否 | false | 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 |\n| geocode | boolean \\| null | 否 | false | 传入 true 会解析地址 |\n| highAccuracyExpireTime | number \\| null | 否 | 3000 | 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 |\n| isHighAccuracy | boolean \\| null | 否 | false | 开启高精度定位 |\n| success | (result: [GetLocationSuccess](#getlocationsuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [IGetLocationFail](#igetlocationfail-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetLocationSuccess 的属性值 @getlocationsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| latitude | number | 是 | 0 | 纬度,浮点数,范围为-90~90,负数表示南纬 |\n| longitude | number | 是 | 0 | 经度,范围为-180~180,负数表示西经 |\n| speed | number | 是 | 0 | 速度,浮点数,单位m/s |\n| accuracy | number | 是 | - | 位置的精确度 |\n| altitude | number | 是 | 0 | 高度,单位 m |\n| verticalAccuracy | number | 是 | 0 | 垂直精度,单位 m(Android 无法获取,返回 0) |\n| horizontalAccuracy | number | 是 | 0 | 水平精度,单位 m |\n| address | any \\| null | 否 | null | 地址信息 |\n\n##### IGetLocationFail 的属性值 @igetlocationfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1505004 \\| 1505021 \\| 1505022 \\| 1505023 \\| 1505024 | 是 | - | 错误码
- 1505004 缺失权限
- 1505021 超时
- 1505022 不支持的定位类型
- 1505023 不支持逆地理编码
- 1505024 没有找到具体的定位引擎,请定位开关是否已打开 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### getLocation 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | x | 4.0 |\n","tutorial":"\n### 参见\n[getLocation]([](http://uniapp.dcloud.io/api/location/location?id=getlocation))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.location.get-location)\n"},"get-location":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-location/get-location.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-location/get-location\n>Template\n```vue\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : 'wgs84' | 'gcj02',\n name : string,\n }\n export default {\n data() {\n return {\n title: 'get-location',\n altitudeSelect: false,\n isHighAccuracySelect: false,\n geocodeSelect: false,\n exeRet: '',\n items: [\n {\n value: 'wgs84',\n name: 'wgs84'\n },\n {\n value: 'gcj02',\n name: 'gcj02'\n }\n ] as ItemType[],\n current: 0,\n }\n },\n methods: {\n altitudeChange: function (e : UniSwitchChangeEvent) {\n this.altitudeSelect = e.detail.value\n },\n geocodeChange: function (e : UniSwitchChangeEvent) {\n this.geocodeSelect = e.detail.value\n },\n highAccuracySelectChange: function (e : UniSwitchChangeEvent) {\n this.isHighAccuracySelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n getLocationTap: function () {\n uni.showLoading({\n title: '定位中'\n })\n uni.getLocation(({\n type: this.items[this.current].value,\n altitude: this.altitudeSelect,\n isHighAccuracy: this.isHighAccuracySelect,\n geocode: this.geocodeSelect,\n success: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n fail: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n complete: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n }\n }));\n\n\n }\n\n }\n }\n\n```\n\n:::"},"getStorageInfo":{"name":"## uni.getStorageInfo(options) @getstorageinfo","description":"\nuni.getStorageInfo函数定义\n异步获取当前 storage 的相关信息。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetStorageInfoOptions](#getstorageinfooptions-values) | 是 | - | uni.getStorageInfo参数定义 |\n#### GetStorageInfoOptions 的属性值 @getstorageinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [GetStorageInfoSuccess](#getstorageinfosuccess-values)) => void \\| null | 否 | - | uni.getStorageInfo成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.getStorageInfo失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.getStorageInfo完成回调函数定义 |\n\n##### GetStorageInfoSuccess 的属性值 @getstorageinfosuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| keys | Array\\ | 是 | - | 当前 storage 中所有的 key |\n| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |\n| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |\n","returnValue":"","compatibility":"### getStorageInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorageInfo](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfo)\n"},"getStorageInfoSync":{"name":"## uni.getStorageInfoSync() @getstorageinfosync","description":"\nuni.getStorageInfoSync函数定义\n同步获取当前 storage 的相关信息。\n\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetStorageInfoSuccess](#getstorageinfosuccess-values) | \n\n#### GetStorageInfoSuccess 的属性值 @getstorageinfosuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| keys | Array\\ | 是 | - | 当前 storage 中所有的 key |\n| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |\n| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |\n","compatibility":"### getStorageInfoSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorageInfoSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfoSync)\n"},"getStorage":{"name":"## uni.getStorage(options) @getstorage","description":"\nuni.getStorage函数定义\n从本地存储中异步获取指定 key 对应的内容。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetStorageOptions](#getstorageoptions-values) | 是 | - | uni.getStorage参数定义 |\n#### GetStorageOptions 的属性值 @getstorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |\n| success | (res: [GetStorageSuccess](#getstoragesuccess-values)) => void \\| null | 否 | - | uni.getStorage成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.getStorage失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.getStorage完成回调函数定义 |\n\n##### GetStorageSuccess 的属性值 @getstoragesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any \\| null | 否 | - | key 对应的内容 |\n","returnValue":"","compatibility":"### getStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorage)\n"},"getStorageSync":{"name":"## uni.getStorageSync(key) @getstoragesync","description":"\nuni.getStorageSync函数定义\n从本地存储中同步获取指定 key 对应的内容。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | 否 | \n","compatibility":"### getStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageSync)\n"},"setStorage":{"name":"## uni.setStorage(options) @setstorage","description":"\nuni.setStorage函数定义\n将数据存储在本地storage存储中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。 \n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetStorageOptions](#setstorageoptions-values) | 是 | - | uni.setStorage参数定义 |\n#### SetStorageOptions 的属性值 @setstorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |\n| data | any | 是 | - | 需要存储的内容,只支持原生类型、及能够通过 JSON.stringify 序列化的对象 |\n| success | (res: SetStorageSuccess) => void \\| null | 否 | - | uni.setStorage成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.setStorage失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.setStorage完成回调函数定义 |\n","returnValue":"","compatibility":"### setStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[setStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorage)\n"},"setStorageSync":{"name":"## uni.setStorageSync(key, data) @setstoragesync","description":"\nuni.setStorageSync函数定义\n将 data 存储在本地storage存储中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地storage存储中的指定的 key |\n| data | any | 是 | - | 需要存储的内容,只支持原生类型、及能够通过 JSON.stringify 序列化的对象 |","returnValue":"","compatibility":"### setStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[setStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorageSync)\n"},"removeStorage":{"name":"## uni.removeStorage(options) @removestorage","description":"\nuni.removeStorage函数定义\n从本地存储中异步移除指定 key。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RemoveStorageOptions](#removestorageoptions-values) | 是 | - | uni.removeStorage参数定义 |\n#### RemoveStorageOptions 的属性值 @removestorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |\n| success | (res: RemoveStorageSuccess) => void \\| null | 否 | - | uni.removeStorage成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.removeStorage失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.removeStorage完成回调函数定义 |\n","returnValue":"","compatibility":"### removeStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[removeStorage](hhttps://uniapp.dcloud.net.cn/api/storage/storage.html#removestorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorage)\n"},"removeStorageSync":{"name":"## uni.removeStorageSync(key) @removestoragesync","description":"\nuni.removeStorageSync函数定义\n从本地存储中同步移除指定 key。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |","returnValue":"","compatibility":"### removeStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[removeStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#removestoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorageSync)\n"},"clearStorage":{"name":"## uni.clearStorage(option?) @clearstorage","description":"\nuni.clearStorage函数定义\n清除本地数据存储。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [ClearStorageOptions](#clearstorageoptions-values) \\| null | 否 | - | uni.removeStorage参数定义 |\n#### ClearStorageOptions 的属性值 @clearstorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: ClearStorageSuccess) => void \\| null | 否 | - | uni.clearStorage 成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.clearStorage 失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.clearStorage 完成回调函数定义 |\n","returnValue":"","compatibility":"### clearStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[clearStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorage)\n"},"clearStorageSync":{"name":"## uni.clearStorageSync() @clearstoragesync","description":"\nuni.clearStorageSync函数定义\n清除本地数据存储。\n","param":"","returnValue":"","compatibility":"### clearStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[clearStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorageSync)\n"},"storage":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/storage/storage.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/storage/storage\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'get/set/clearStorage',\n key: '',\n data: '' as any,\n apiGetData: '' as any | null,\n storageInfo: '',\n }\n },\n methods: {\n getStorageInfo() {\n uni.getStorageInfo({\n success: (res) => {\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n },\n })\n },\n getStorageInfoSync() {\n try {\n const res = uni.getStorageInfoSync()\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n } catch (e) {\n // error\n console.log(e)\n }\n },\n jsonLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = JSON.stringify({\n name: \"james\",\n age: 12,\n from: \"american\"\n });\n\n },\n longLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"1234567890\"\n },\n floatLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"321456.1234567890\"\n },\n negativeLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"-321456\"\n },\n strMock() {\n this.key = 'key_' + Math.random()\n this.data = '测试字符串数据,长度为16个字符'\n },\n complexMock() {\n this.key = 'key_' + Math.random()\n let jsonObj = {\n name: '张三',\n age: 12,\n classMate: [\n {\n id: 1001,\n name: '李四',\n },\n {\n id: 1002,\n name: 'jack ma',\n },\n ],\n }\n this.data = jsonObj\n },\n numberMock() {\n this.key = 'key_' + Math.random()\n this.data = 10011\n },\n floatMock() {\n this.key = 'key_' + Math.random()\n this.data = 3.1415926535893384626\n },\n\n keyChange: function (e : InputEvent) {\n this.key = e.detail.value\n },\n dataChange: function (e : InputEvent) {\n this.data = e.detail.value\n },\n getStorage: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读取数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n let that = this\n uni.getStorage({\n key: key,\n success: (res) => {\n\n that.apiGetData = res.data\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读取数据成功',\n content: desc,\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '读取数据失败',\n content: '找不到 key 对应的数据',\n showCancel: false,\n })\n },\n })\n }\n },\n getStorageSync: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读取数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n this.apiGetData = uni.getStorageSync(key)\n\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读取数据成功',\n content: desc,\n showCancel: false,\n })\n }\n },\n setStorage: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: '保存数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n uni.setStorage({\n key: key,\n data: data,\n success: () => {\n uni.showModal({\n title: '存储数据成功',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '储存数据失败!',\n showCancel: false,\n })\n },\n })\n }\n },\n setStorageSync: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: '保存数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n uni.setStorageSync(key, data)\n uni.showModal({\n title: '存储数据成功',\n showCancel: false,\n })\n }\n },\n removeStorage: function () {\n uni.removeStorage({\n key: this.key,\n success: () => {\n uni.showModal({\n title: '移除数据成功',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '移除数据失败',\n showCancel: false,\n })\n },\n })\n },\n removeStorageSync: function () {\n uni.removeStorageSync(this.key)\n uni.showModal({\n title: '移除数据成功',\n showCancel: false,\n })\n },\n clearStorage: function () {\n this.key = ''\n this.data = ''\n uni.clearStorage({\n success: function (_) {\n uni.showModal({\n title: '清除数据成功',\n showCancel: false,\n })\n },\n fail: function (_) {\n uni.showModal({\n title: '清除数据失败',\n showCancel: false,\n })\n },\n })\n },\n clearStorageSync: function () {\n this.key = ''\n this.data = ''\n uni.clearStorageSync()\n uni.showModal({\n title: '清除数据成功',\n content: ' ',\n showCancel: false,\n })\n },\n },\n }\n\n```\n\n:::"},"getFileSystemManager":{"name":"## uni.getFileSystemManager() @getfilesystemmanager","description":"\n获取文件管理器","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [FileSystemManager](#filesystemmanager-values) | \n\n#### FileSystemManager 的方法 @filesystemmanager-values \n\n#### readFile(options) @readfile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ReadFileOptions](#readfileoptions-values) | 是 | - | - |\n###### ReadFileOptions 的属性值 @readfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| encoding | \"base64\" \\| \"utf-8\" | 是 | - | base64 / utf-8 |\n| filePath | string.URIString | 是 | - | 文件路径,支持相对地址和绝对地址 |\n| success | (res: [ReadFileSuccessResult](#readfilesuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 通用的错误返回结果回调 |\n| complete | (res: any) => void \\| null | 否 | - | 通用的结束返回结果回调 |\n\n###### ReadFileSuccessResult 的属性值 @readfilesuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | string | 是 | - | - |\n\n\n\n\n#### writeFile(options) @writefile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [WriteFileOptions](#writefileoptions-values) | 是 | - | - |\n###### WriteFileOptions 的属性值 @writefileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.URIString | 是 | - | 文件路径,只支持绝对地址 |\n| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | 指定写入文件的字符编码
支持:ascii base64 utf-8 |\n| data | string | 是 | - | 写入的文本内容 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 通用的正确返回结果回调 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### FileManagerSuccessResult 的属性值 @filemanagersuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n\n\n\n#### unlink(options) @unlink\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UnLinkOptions](#unlinkoptions-values) | 是 | - | - |\n###### UnLinkOptions 的属性值 @unlinkoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.URIString | 是 | - | 文件路径,只支持绝对地址 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### mkdir(options) @mkdir\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [MkDirOptions](#mkdiroptions-values) | 是 | - | - |\n###### MkDirOptions 的属性值 @mkdiroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dirPath | string.URIString | 是 | - | 创建的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### rmdir(options) @rmdir\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RmDirOptions](#rmdiroptions-values) | 是 | - | - |\n###### RmDirOptions 的属性值 @rmdiroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dirPath | string.URIString | 是 | - | 要删除的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### readdir(options) @readdir\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ReadDirOptions](#readdiroptions-values) | 是 | - | - |\n###### ReadDirOptions 的属性值 @readdiroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dirPath | string.URIString | 是 | - | 要读取的目录路径 (本地路径) |\n| success | (res: [ReadDirSuccessResult](#readdirsuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### ReadDirSuccessResult 的属性值 @readdirsuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| files | Array\\ | 是 | - | - |\n\n\n\n\n#### access(options) @access\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [AccessOptions](#accessoptions-values) | 是 | - | - |\n###### AccessOptions 的属性值 @accessoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string.URIString | 是 | - | 要删除的目录路径 (本地路径) |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### rename(options) @rename\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RenameOptions](#renameoptions-values) | 是 | - | - |\n###### RenameOptions 的属性值 @renameoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| oldPath | string.URIString | 是 | - | 源文件路径,支持本地路径 |\n| newPath | string.URIString | 是 | - | 新文件路径,支持本地路径 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### copyFile(options) @copyfile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CopyFileOptions](#copyfileoptions-values) | 是 | - | - |\n###### CopyFileOptions 的属性值 @copyfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| srcPath | string.URIString | 是 | - | 源文件路径,支持本地路径 |\n| destPath | string.URIString | 是 | - | 新文件路径,支持本地路径 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### getFileInfo(options) @getfileinfo\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetFileInfoOptions](#getfileinfooptions-values) | 是 | - | - |\n###### GetFileInfoOptions 的属性值 @getfileinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.URIString | 是 | - | 要读取的文件路径 (本地路径) |\n| digestAlgorithm | \"md5\" \\| \"sha1\" | 是 | - | md5 / sha1 |\n| success | (res: [GetFileInfoSuccessResult](#getfileinfosuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### GetFileInfoSuccessResult 的属性值 @getfileinfosuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| digest | string | 是 | - | - |\n| size | number | 是 | - | - |\n| errMsg | string | 是 | - | - |\n\n\n\n\n#### stat(options) @stat\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [StatOptions](#statoptions-values) | 是 | - | - |\n###### StatOptions 的属性值 @statoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string.URIString | 是 | - | 文件/目录路径 (本地路径) |\n| recursive | boolean | 是 | - | 是否递归获取目录下的每个文件的 Stats 信息 |\n| success | (res: [StatSuccessResult](#statsuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### StatSuccessResult 的属性值 @statsuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n| stats | Array\\<[FileStats](#filestats-values)\\> | 是 | - | - |\n\n###### FileStats 的属性值 @filestats-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | - |\n| stats | [Stats](#stats-values) | 是 | - | - |\n\n###### Stats 的属性值 @stats-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| mode | number | 是 | - | - |\n| size | number | 是 | - | - |\n| lastAccessedTime | number | 是 | - | - |\n| lastModifiedTime | number | 是 | - | - |\n| mIsFile | boolean | 是 | - | - |\n\n###### Stats 的方法 @stats-values \n\n##### isDirectory() @isdirectory\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean | \n\n\n\n##### isFile() @isfile\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean | \n\n\n\n##### toLog() @tolog\n\n\n###### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | 否 | \n\n\n\n##### toJSON() @tojson\n\n\n###### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | 否 | \n\n\n\n\n\n","compatibility":"### getFileSystemManager 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | x | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.file.filemanager.getFileSystemManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-file-system-manager/get-file-system-manager.uvue) \n ```vue\n\n\n\n\n\n\n```"},"getUniverifyManager":{"name":"## uni.getUniverifyManager() @getuniverifymanager","description":"获取一键登录管理对象","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UniverifyManager](#univerifymanager-values) | \n\n#### UniverifyManager 的方法 @univerifymanager-values \n\n#### preLogin(options) @prelogin\n预登录\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [PreLoginOptions](#preloginoptions-values) | 是 | - | 预登录参数 |\n###### PreLoginOptions 的属性值 @preloginoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | () => void | 否 | - | - |\n| fail | (err: [PreLoginFail](#preloginfail-values)) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n###### PreLoginFail 的属性值 @preloginfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | 1000 当前应用appid尚未开通uni一键登录
1001 应用所有者账号信息异常,请检查账号一键登录服务是否正常
1002 应用所有者账号信息异常,请检查账号余额是否充足
1004 uni一键登录应用不存在
4001 参数异常
30004 其他错误
30005 预登录失败
30006 一键登录失败 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n##### preLogin 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n\n#### login(options) @login\n登录\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [LoginOptions](#loginoptions-values) | 是 | - | 登录参数 |\n###### LoginOptions 的属性值 @loginoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| univerifyStyle | [UniverifyStyle](#univerifystyle-values) | 否 | - | 登录页样式 |\n| success | (res: [LoginSuccess](#loginsuccess-values)) => void | 否 | - | - |\n| fail | (err: [LoginFail](#loginfail-values)) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n###### UniverifyStyle 的属性值 @univerifystyle-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fullScreen | boolean | 否 | - | 是否全屏 |\n| logoPath | string | 否 | - | logo路径 |\n| backgroundColor | string | 否 | - | 登录页背景色 |\n| loginBtnText | string | 否 | - | 登录按钮文字 |\n\n###### LoginSuccess 的属性值 @loginsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| openId | string | 是 | - | 登录授权唯一标识 |\n| accessToken | string | 是 | - | token |\n\n###### LoginFail 的属性值 @loginfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | 1000 当前应用appid尚未开通uni一键登录
1001 应用所有者账号信息异常,请检查账号一键登录服务是否正常
1002 应用所有者账号信息异常,请检查账号余额是否充足
1004 uni一键登录应用不存在
4001 参数异常
30004 其他错误
30005 预登录失败
30006 一键登录失败 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n##### login 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n\n#### close() @close\n关闭登录页\n\n\n##### close 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n\n#### isPreLoginValid() @ispreloginvalid\n预登录是否有效\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| boolean | \n\n##### isPreLoginValid 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n","compatibility":"### getUniverifyManager 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n","tutorial":"\n### 参见\n[getUniverifyManager](https://uniapp.dcloud.net.cn/univerify.html#univerifymanager)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.univerify.getUniverifyManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-univerify-manager/get-univerify-manager.uvue) \n ```vue\n\n\n\n\n\n\n```"},"getFacialRecognitionMetaInfo":{"name":"## uni.getFacialRecognitionMetaInfo() @getfacialrecognitionmetainfo","description":"获取阿里云实人认证meta info","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| string | \n","compatibility":"### getFacialRecognitionMetaInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | 3.9 | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.getFacialRecognitionMetaInfo)\n"},"startFacialRecognitionVerify":{"name":"## uni.startFacialRecognitionVerify(faceStyle) @startfacialrecognitionverify","description":"启动人脸识别","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| faceStyle | [StartFacialRecognitionVerifyOptions](#startfacialrecognitionverifyoptions-values) | 是 | - | - |\n#### StartFacialRecognitionVerifyOptions 的属性值 @startfacialrecognitionverifyoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| certifyId | string | 是 | - | certifyId 调用实人认证的id |\n| progressBarColor | string \\| null | 否 | - | 活体检测页面的进度条颜色。 |\n| screenOrientation | Union \\| null | 否 | \"port\" | 认证时屏幕方向
- land 横屏
- port 竖屏 |\n| success | (res: [StartFacialRecognitionVerifySuccess](#startfacialrecognitionverifysuccess-values)) => void \\| null | 否 | - | 成功回调 |\n| fail | (res: [IFacialRecognitionVerifyError](#ifacialrecognitionverifyerror-values)) => void \\| null | 否 | - | 失败回调 |\n| complete | (res: any) => void \\| null | 否 | - | 完成回调 |\n\n##### StartFacialRecognitionVerifySuccess 的属性值 @startfacialrecognitionverifysuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 错误码 |\n| errSubject | string | 是 | - | 调用API的名称 |\n| errMsg | string | 是 | - | 错误的详细信息 |\n| cause | [SourceError](#sourceerror-values) | 否 | - | 错误来源 |\n\n###### SourceError 的属性值 @sourceerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| subject | string \\| null | 否 | - | 源错误模块名称 |\n| message | string | 是 | - | 源错误描述信息 |\n| code | number | 是 | - | 源错误的错误码 |\n| name | string | 是 | - | - |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | |\n\n##### IFacialRecognitionVerifyError 的属性值 @ifacialrecognitionverifyerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 10010 \\| 10012 \\| 10011 \\| 10013 \\| 10020 \\| 10001 \\| 10002 | 是 | - | 错误码
- 10001 certifyId 不能为空
- 10002 \"当前设备不支持\"
- 10010 刷脸异常
- 10012 网络异常
- 10011 验证中断
- 10013 刷脸验证失败
- 10020 设备设置时间异常 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### StartFacialRecognitionVerifyOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| screenOrientation | 3.9 | x | - |\n","returnValue":"","compatibility":"### startFacialRecognitionVerify 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | 3.9 | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.startFacialRecognitionVerify)\n"},"facial-recognition-verify":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/facial-recognition-verify/facial-recognition-verify.uvue) \n ```vue\n\n\n\n\n\n\n```"},"createRewardedVideoAd":{"name":"## uni.createRewardedVideoAd(option) @createrewardedvideoad","description":"创建激励视频广告对象","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [CreateRewardedVideoAdOptions](#createrewardedvideoadoptions-values) | 是 | - | - |\n#### CreateRewardedVideoAdOptions 的属性值 @createrewardedvideoadoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| adpid | string | 是 | - | 广告位 id |\n| urlCallback | [UrlCallbackOptions](#urlcallbackoptions-values) \\| null | 否 | - | 服务器回调透传参数 |\n\n##### UrlCallbackOptions 的属性值 @urlcallbackoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| userId | string \\| null | 否 | - | 透传到服务器端的userId |\n| extra | string \\| null | 否 | - | 透传到服务器端的extra,不推荐设置过于复杂的字符串 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RewardedVideoAd](#rewardedvideoad-values) | \n\n#### RewardedVideoAd 的方法 @rewardedvideoad-values \n\n#### show() @show\n\n广告加载成功之后,调用此方法展示广告\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\ | \n\n\n\n#### load() @load\n\n加载广告\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\ | \n\n\n\n#### destroy() @destroy\n\n销毁广告\n\n\n\n\n#### onLoad(callback) @onload\n\n绑定广告 load 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n\n\n#### offLoad(callback) @offload\n\n解除绑定 load 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n\n\n#### onError(callback) @onerror\n\n绑定 error 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - |\n###### IUniAdError 的属性值 @iuniaderror-values \n\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 \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n\n\n#### offError(callback) @offerror\n\n解除绑定 error 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - |\n\n\n\n#### onClose(callback) @onclose\n\n绑定 close 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - |\n###### VideoAdClose 的属性值 @videoadclose-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| isEnded | boolean | 是 | - | true标识广告播放完毕或者达到发放奖励的条件 |\n\n\n\n\n#### offClose(callback) @offclose\n\n解除绑定 close 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - |\n\n\n\n#### onAdClicked(callback) @onadclicked\n\n绑定广告可点击屏幕区域事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n\n\n#### onVerify(callback) @onverify\n\n绑定 verify 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | 是 | - | - |\n\n\n","compatibility":"### createRewardedVideoAd 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 4.0 | - | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ad.createRewardedVideoAd)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/rewarded-video-ad/rewarded-video-ad.uvue) \n ```vue\n\n\n\n\n\n\n```"},"requestPayment":{"name":"## uni.requestPayment(options) @requestpayment","description":"支付","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RequestPaymentOptions](#requestpaymentoptions-values) | 是 | - | - |\n#### RequestPaymentOptions 的属性值 @requestpaymentoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| provider | string | 是 | - | 支付服务提供商,通过 uni.getProvider 获取 - alipay: 支付宝支付 - wxpay: 微信支付 - baidu: 百度收银台 - appleiap: 苹果应用内支付 |\n| orderInfo | string | 是 | - | 订单数据 |\n| timeStamp | string \\| null | 否 | - | 时间戳从1970年1月1日至今的秒数,即当前的时间,微信小程序独有 |\n| nonceStr | string \\| null | 否 | - | 随机字符串,长度为32个字符以下,微信小程序独有 。 |\n| package | string \\| null | 否 | - | 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=xx,微信小程序独有 |\n| signType | string \\| null | 否 | - | 签名算法,暂支持 MD5 ,微信小程序独有 |\n| paySign | string \\| null | 否 | - | 签名,具体签名方案参见小程序支付接口文档,微信小程序独有 |\n| success | (result: [RequestPaymentSuccess](#requestpaymentsuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [IRequestPaymentFail](#irequestpaymentfail-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### RequestPaymentSuccess 的属性值 @requestpaymentsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any \\| null | 否 | - | |\n\n##### IRequestPaymentFail 的属性值 @irequestpaymentfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 700710 \\| 700711 \\| 700712 \\| 700713 \\| 700714 \\| 700715 \\| 700716 | 是 | - | 错误码
- 700710 正在处理中,支付结果未知(有可能已经支付成功),请查询商家订单列表中订单的支付状态
- 700711 订单支付失败。
- 700712 重复请求。
- 700713 用户中途取消。
- 700714 网络连接出错。
- 700715 支付结果未知(有可能已经支付成功),请查询商家订单列表中订单的支付状态。
- 700716 其它支付错误。 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### requestPayment 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 4.0 | x | x |\n","tutorial":"\n### 参见\n[requestPayment]([](https://uniapp.dcloud.net.cn/api/plugins/payment.html))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.payment.requestPayment)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request-payment/request-payment.uvue) \n ```vue\n\r\n\r\n\r\n\r\n\n\n```"},"createWebviewContext":{"name":"## uni.createWebviewContext(webviewId, component?) @createwebviewcontext","description":"创建 web-view 组件的上下文对象,用于操作 web-view 的行为。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| webviewId | string.WebviewIdString | 是 | - | - |\n| component | ComponentPublicInstance \\| null | 否 | - | |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [WebviewContext](#webviewcontext-values) \\| null | 否 | \n\n#### WebviewContext 的方法 @webviewcontext-values \n\n#### back() @back\n后退到 web-view 组件网页加载历史的上一页,如果不存在上一页则没有任何效果。\n\n\n##### back 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### forward() @forward\n前进到 web-view 组件网页加载历史的下一页,如果不存在下一页则没有任何效果。\n\n\n##### forward 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### reload() @reload\n重新加载 web-view 组件当前页面。\n\n\n##### reload 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### stop() @stop\n停止加载 web-view 组件当前网页,该方法不能阻止已经加载的 html 文档,但是能够阻止未完成的图片及延迟加载的资源。\n\n\n##### stop 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### evalJS(js) @evaljs\n在网页中执行指定的js脚本,在 uvue 页面中可通过此方法向 web-view 组件加载的页面发送数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| js | string | 是 | - | - |\n\n##### evalJS 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n","compatibility":"### createWebviewContext 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-webview-context)\n"},"createVideoContext":{"name":"## uni.createVideoContext(videoId, component?) @createvideocontext","description":"创建并返回 video 上下文 videoContext 对象","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| videoId | string.VideoIdString | 是 | - | - |\n| component | ComponentPublicInstance \\| null | 否 | - | |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [VideoContext](#videocontext-values) \\| null | 否 | \n\n#### VideoContext 的方法 @videocontext-values \n\n#### play() @play\n播放\n\n\n##### play 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### pause() @pause\n暂停\n\n\n##### pause 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### seek(position) @seek\n跳转到指定位置\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| position | number | 是 | - | 跳转到指定位置(秒) |\n\n##### seek 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### stop() @stop\n停止视频\n\n\n##### stop 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### sendDanmu(danmu) @senddanmu\n发送弹幕\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| danmu | [Danmu](#danmu-values) | 是 | - | text, color |\n###### Danmu 的属性值 @danmu-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string \\| null | 否 | - | 弹幕文字 |\n| color | string \\| null | 否 | - | 弹幕颜色 |\n| time | number \\| null | 否 | - | 显示时刻 |\n\n\n##### sendDanmu 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### playbackRate(rate) @playbackrate\n设置倍速播放\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| rate | number | 是 | - | , 支持倍率 0.5/0.8/1.0/1.25/1.5 |\n\n##### playbackRate 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### requestFullScreen(direction?) @requestfullscreen\n进入全屏\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | [RequestFullScreenOptions](#requestfullscreenoptions-values) | 否 | - | , 0\\|正常竖向, 90\\|屏幕逆时针90度, -90\\|屏幕顺时针90度 |\n###### RequestFullScreenOptions 的属性值 @requestfullscreenoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | number \\| null | 否 | - | direction
- 0: 正常竖向
- 90: 屏幕逆时针90度
- -90: 屏幕顺时针90度 |\n\n###### RequestFullScreenOptions 兼容性 \n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| direction | 4.4 | 3.9.0 | - | x |\n\n\n##### requestFullScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### exitFullScreen() @exitfullscreen\n退出全屏\n\n\n##### exitFullScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n","compatibility":"### createVideoContext 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | √ | - | 4.0 |\n","tutorial":"\n### 参见\n[createVideoContext](http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-video-context)\n"},"general_type":{"name":"## 通用类型\n","param":"### GeneralCallbackResult \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n"}} \ No newline at end of file +{"getApp":{"name":"## getApp() @getapp","description":"\n`getApp()` 函数用于获取当前应用实例,可通过应用实例调用 App.uvue methods 中定义的方法。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| any | \n","compatibility":"","tutorial":"\n### 参见\n[getApp](https://uniapp.dcloud.net.cn/tutorial/page.html#getapp)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-app)\n"},"get-app":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app/get-app.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app/get-app\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n import { state, setLifeCycleNum } from '@/store/index.uts'\n\n type MyGlobalData = {\n str : string,\n num : number,\n bool : boolean,\n obj : UTSJSONObject,\n null : string | null,\n arr : number[],\n mySet : string[],\n myMap : UTSJSONObject,\n func : () => string\n }\n\n export default {\n data() {\n return {\n originGlobalData: {\n str: '',\n num: 0,\n bool: false,\n obj: {\n str: '',\n num: 0,\n bool: false\n } as UTSJSONObject,\n null: null,\n arr: [] as number[],\n mySet: [] as string[],\n myMap: {},\n func: () : string => ''\n } as MyGlobalData,\n originGlobalDataFuncRes: '',\n newGlobalData: {\n str: '',\n num: 0,\n bool: false,\n obj: {\n str: '',\n num: 0,\n bool: false\n } as UTSJSONObject,\n null: null,\n arr: [] as number[],\n mySet: [] as string[],\n myMap: {},\n func: () : string => ''\n } as MyGlobalData,\n newGlobalDataFuncRes: '',\n lifeCycleNum: 0,\n }\n },\n onReady() {\n this.lifeCycleNum = state.lifeCycleNum\n },\n methods: {\n getGlobalData() {\n const app = getApp()\n\n this.originGlobalData.str = app.globalData.str\n this.originGlobalData.num = app.globalData.num\n this.originGlobalData.bool = app.globalData.bool\n this.originGlobalData.obj = app.globalData.obj\n this.originGlobalData.null = app.globalData.null\n this.originGlobalData.arr = app.globalData.arr\n app.globalData.mySet.forEach((value : string) => {\n this.originGlobalData.mySet.push(value)\n })\n app.globalData.myMap.forEach((value : any, key : string) => {\n this.originGlobalData.myMap[key] = value\n })\n this.originGlobalData.func = app.globalData.func\n this.originGlobalDataFuncRes = this.originGlobalData.func()\n },\n setGlobalData() {\n const app = getApp()\n\n app.globalData.str = 'new globalData str'\n app.globalData.num = 100\n app.globalData.bool = true\n app.globalData.obj = {\n str: 'new globalData obj str',\n num: 200,\n bool: true\n }\n app.globalData.null = 'not null'\n app.globalData.arr = [1, 2, 3]\n app.globalData.mySet = new Set(['a', 'b', 'c'])\n app.globalData.myMap = new Map([\n ['a', 1],\n ['b', 2],\n ['c', 3]\n ])\n app.globalData.func = () : string => {\n return 'new globalData func'\n }\n\n this.newGlobalData.str = app.globalData.str\n this.newGlobalData.num = app.globalData.num\n this.newGlobalData.bool = app.globalData.bool\n this.newGlobalData.obj = app.globalData.obj\n this.newGlobalData.null = app.globalData.null\n this.newGlobalData.arr = app.globalData.arr\n app.globalData.mySet.forEach((value : string) => {\n this.newGlobalData.mySet.push(value)\n })\n app.globalData.myMap.forEach((value : any, key : string) => {\n this.newGlobalData.myMap[key] = value\n })\n this.newGlobalData.func = app.globalData.func\n this.newGlobalDataFuncRes = this.newGlobalData.func()\n },\n _increasetLifeCycleNum: function () {\n const app = getApp()\n app.increasetLifeCycleNum()\n this.lifeCycleNum = state.lifeCycleNum\n },\n // 自动化测试\n setLifeCycleNum(num : number) {\n setLifeCycleNum(num)\n }\n },\n }\n\n```\n\n:::"},"getCurrentPages":{"name":"## getCurrentPages() @getcurrentpages","description":"\n`getCurrentPages()` 函数用于获取当前页面栈的实例,以数组形式按栈的顺序给出,数组中的元素为页面实例,第一个元素为首页,最后一个元素为当前页面。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Array\\<[Page](#page-values)\\> | \n\n#### Page 的属性值 @page-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| route | string | 是 | - | 页面的路由地址 |\n| options | Map\\ | 是 | - | 页面的路由参数信息 |\n","compatibility":"","tutorial":"\n### 参见\n[getCurrentPages](https://uniapp.dcloud.net.cn/tutorial/page.html#getcurrentpages)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.global.get-current-pages)\n"},"get-current-pages":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-current-pages/get-current-pages.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-current-pages/get-current-pages\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n class Page {\n constructor(public route : string) {\n }\n }\n\n export default {\n data() {\n return {\n checked: false,\n pages: [] as Page[],\n }\n },\n methods: {\n _getCurrentPages: function () {\n this.pages.length = 0\n const pages = getCurrentPages()\n this.pages.push(new Page(pages[0].route))\n if (this.pages[0].route.includes('/tabBar/')) {\n this.checked = true\n }\n for (let i = 1; i < pages.length; i++) {\n this.pages.push(new Page(pages[i].route))\n if (pages[i].route.includes('/tabBar/')) {\n this.checked = false\n }\n }\n },\n },\n }\n\n```\n\n:::"},"$on":{"name":"## uni.$on(eventName, callback) @$on","description":"\n监听自定义事件。事件可以由 uni.$emit 触发。回调函数会接收 uni.$emit 传递的参数。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### $on 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$on](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$on)\n"},"$once":{"name":"## uni.$once(eventName, callback) @$once","description":"\n监听一个自定义事件。事件只触发一次,在第一次触发之后移除事件监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### $once 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$once](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$once)\n"},"$off":{"name":"## uni.$off(eventName, callback) @$off","description":"\n移除自定义事件监听器。如果没有指定事件名,则移除所有事件监听器。如果提供事件名,则移除该事件的所有监听器。如果提供了事件名和回调,则只移除这个回调的监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### $off 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$off](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$off)\n"},"$emit":{"name":"## uni.$emit(eventName, args?) @$emit","description":"\n触发自定义事件,附加的参数会传递给事件监听器。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| eventName | string | 是 | - | - |\n| args | any \\| null | 否 | - | |","returnValue":"","compatibility":"### $emit 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[$emit](https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.event-bus.$emit)\n"},"event-bus":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/event-bus/event-bus.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/event-bus/event-bus\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n log: [] as string[],\r\n }\r\n },\r\n methods: {\r\n fn(res : string) {\r\n this.log.push(res)\r\n },\r\n on() {\r\n uni.$on('test', this.fn)\r\n },\r\n once() {\r\n uni.$once('test', this.fn)\r\n },\r\n off() {\r\n uni.$off('test', this.fn)\r\n },\r\n emit() {\r\n uni.$emit('test', 'msg:' + Date.now())\r\n },\r\n clear() {\r\n this.log.length = 0\r\n },\r\n },\r\n }\r\n\n```\n\n:::"},"addInterceptor":{"name":"## uni.addInterceptor(name, interceptor) @addinterceptor","description":"\n添加拦截器","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | 需要拦截的 API 名称 |\n| interceptor | [Interceptor](#interceptor-values) | 是 | - | 拦截器 |\n#### Interceptor 的属性值 @interceptor-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| invoke | (...args?: any) => any \\| null | 否 | - | 拦截前触发 |\n| returnValue | (...args?: any) => any \\| null | 否 | - | 方法调用后触发,处理返回值 |\n| success | (...args?: any) => any \\| null | 否 | - | 成功回调拦截 |\n| fail | (...args?: any) => any \\| null | 否 | - | 失败回调拦截 |\n| complete | (...args?: any) => any \\| null | 否 | - | 完成回调拦截 |\n","returnValue":"","compatibility":"### addInterceptor 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.addInterceptor)\n"},"removeInterceptor":{"name":"## uni.removeInterceptor(name, interceptor?) @removeinterceptor","description":"\n删除拦截器","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | 需要删除拦截器的 API 名称 |\n| interceptor | [Interceptor](#interceptor-values) \\| null | 否 | - | 拦截器 |\n#### Interceptor 的属性值 @interceptor-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| invoke | (...args?: any) => any \\| null | 否 | - | 拦截前触发 |\n| returnValue | (...args?: any) => any \\| null | 否 | - | 方法调用后触发,处理返回值 |\n| success | (...args?: any) => any \\| null | 否 | - | 成功回调拦截 |\n| fail | (...args?: any) => any \\| null | 否 | - | 失败回调拦截 |\n| complete | (...args?: any) => any \\| null | 否 | - | 完成回调拦截 |\n","returnValue":"","compatibility":"### removeInterceptor 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.interceptor.removeInterceptor)\n"},"interceptor":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/interceptor/interceptor.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/interceptor/interceptor\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n const interceptor = {\r\n invoke: function (options : NavigateToOptions) {\r\n console.log('拦截 navigateTo 接口传入参数为:', options)\r\n const url = './page2'\r\n uni.showToast({\r\n title: `重定向到页面:${url}`\r\n })\r\n options.url = url\r\n },\r\n success: function (res : NavigateBackSuccess) {\r\n console.log('拦截 navigateTo 接口 success 返回参数为:', res)\r\n },\r\n fail: function (err : NavigateToFail) {\r\n console.log('拦截 navigateTo 接口 fail 返回参数为:', err)\r\n },\r\n complete: function (res : NavigateToComplete) {\r\n console.log('拦截 navigateTo 接口 complete 返回参数为:', res)\r\n }\r\n } as Interceptor\r\n export default {\r\n data() {\r\n return {\r\n msg: \"会跳转到测试页面1\"\r\n }\r\n },\r\n beforeUnmount() {\r\n // 移除 navigateTo 所有拦截器\r\n uni.removeInterceptor('navigateTo')\r\n },\r\n methods: {\r\n addInterceptor() {\r\n uni.addInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '页面跳转已拦截'\r\n })\r\n this.msg = \",路由被劫持到测试页面2\"\r\n },\r\n removeInterceptor() {\r\n uni.removeInterceptor('navigateTo', interceptor)\r\n uni.showToast({\r\n title: '拦截器已移除'\r\n })\r\n this.msg = \"会跳转到测试页面1\"\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: './page1',\r\n success(res) {\r\n console.log('res:', res)\r\n },\r\n fail(err) {\r\n console.error('err:', err)\r\n },\r\n complete(res) {\r\n console.log('res:', res)\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"getLaunchOptionsSync":{"name":"## uni.getLaunchOptionsSync() @getlaunchoptionssync","description":"\n获取本次启动时的参数。返回值与App.onLaunch的回调参数一致\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [OnLaunchOptions](#onlaunchoptions-values) | \n\n#### OnLaunchOptions 的属性值 @onlaunchoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | - |\n","compatibility":"### getLaunchOptionsSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[getLaunchOptionsSync](https://doc.dcloud.net.cn/uni-app-x/api/get-launch-options-sync.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.get-launch-options-sync)\n"},"get-launch-options-sync":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-launch-options-sync/get-launch-options-sync.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-launch-options-sync/get-launch-options-sync\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\nexport default {\n data() {\n return {\n checked: false,\n homePagePath: 'pages/tabBar/component',\n launchOptionsPath: '',\n }\n },\n methods: {\n getLaunchOptionsSync() {\n const launchOptions = uni.getLaunchOptionsSync()\n this.launchOptionsPath = launchOptions.path\n\n if (launchOptions.path == this.homePagePath) {\n this.checked = true\n }\n },\n },\n}\n\n```\n\n:::"},"exit":{"name":"## uni.exit(options?) @exit","description":"\n退出当前应用","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ExitOptions](#exitoptions-values) \\| null | 否 | - | uni.exit参数定义 |\n#### ExitOptions 的属性值 @exitoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [ExitSuccess](#exitsuccess-values)) => void \\| null | 否 | - | uni.exit成功回调函数定义 |\n| fail | (res: [IExitError](#iexiterror-values)) => void \\| null | 否 | - | uni.exit失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.exit完成回调函数定义 |\n\n##### ExitSuccess 的属性值 @exitsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### IExitError 的属性值 @iexiterror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 12001 \\| 12002 | 是 | - | 错误码
- 12001: 系统不支持
- 12002: 未知错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### exit 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | x | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.exit)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/exit/exit.uvue) \n ```vue\n\n\n\n\n\n```"},"env":{"name":"## env","description":"","param":"### env 的属性值 @env-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| USER_DATA_PATH | string | 是 | - | 应用专属存储空间的外置存储空间根目录下的files目录 |\n| CACHE_PATH | string | 是 | - | 应用专属存储空间的外置存储空间根目录下的cache目录 |\n| SANDBOX_PATH | string | 是 | - | 应用专属存储空间的外置存储空间根目录(caches/files) |\n","compatibility":"#### env 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| USER_DATA_PATH | 3.99 | x | - |\n| CACHE_PATH | 3.99 | x | - |\n| SANDBOX_PATH | 3.99 | x | - |\n","returnValue":"","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.base.env)\n"},"navigateTo":{"name":"## uni.navigateTo(options) @navigateto","description":"\n保留当前页面,跳转到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [NavigateToOptions](#navigatetooptions-values) | 是 | - | - |\n#### NavigateToOptions 的属性值 @navigatetooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| animationType | string \\| null | 否 | - | 窗口显示的动画类型
- auto: 自动选择动画效果
- none: 无动画效果
- slide-in-right: 从右侧横向滑动效果
- slide-in-left: 左侧横向滑动效果
- slide-in-top: 从上侧竖向滑动效果
- slide-in-bottom: 从下侧竖向滑动效果
- fade-in: 从透明到不透明逐渐显示效果
- zoom-out: 从小到大逐渐放大显示效果
- zoom-fade-out: 从小到大逐渐放大并且从透明到不透明逐渐显示效果
- pop-in: 从右侧平移入栈动画效果
- UnionType => 'auto' \\| 'none' \\| 'slide-in-right' \\| 'slide-in-left' \\| 'slide-in-top' \\| 'slide-in-bottom' \\| 'fade-in' \\| 'zoom-out' \\| 'zoom-fade-out' \\| 'pop-in' |\n| animationDuration | number \\| null | 否 | - | 窗口显示动画的持续时间,单位为 ms |\n| events | any \\| null | 否 | - | 页面间通信接口,用于监听被打开页面发送到当前页面的数据 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [NavigateToError](#navigatetoerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateToError 的属性值 @navigatetoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 路由错误码 - 4: 框架内部异常 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateToOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| animationType | x | x | 4.0 |\n| animationDuration | x | x | 4.0 |\n| events | x | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### navigateTo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[navigateTo](http://uniapp.dcloud.io/api/router?id=navigateto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateTo)\n"},"reLaunch":{"name":"## uni.reLaunch(options) @relaunch","description":"\n关闭所有页面,打开到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ReLaunchOptions](#relaunchoptions-values) | 是 | - | - |\n#### ReLaunchOptions 的属性值 @relaunchoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [ReLaunchError](#relauncherror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ReLaunchError 的属性值 @relauncherror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ReLaunchOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### reLaunch 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[reLaunch](http://uniapp.dcloud.io/api/router?id=relaunch)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.reLaunch)\n"},"navigateBack":{"name":"## uni.navigateBack(options?) @navigateback","description":"\n关闭当前页面,返回上一页面或多级页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [NavigateBackOptions](#navigatebackoptions-values) \\| null | 否 | - | |\n#### NavigateBackOptions 的属性值 @navigatebackoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| delta | number \\| null | 否 | - | 返回的页面数,如果 delta 大于现有页面数,则返回到首页 |\n| animationType | string \\| null | 否 | - | 窗口关闭的动画类型
- auto: 自动选择动画效果
- none: 无动画效果
- slide-out-right: 横向向右侧滑出屏幕动画
- slide-out-left: 横向向左侧滑出屏幕动画
- slide-out-top: 竖向向上侧滑出屏幕动画
- slide-out-bottom: 竖向向下侧滑出屏幕动画
- fade-out: 从不透明到透明逐渐隐藏动画
- zoom-in: 从大逐渐缩小关闭动画
- zoom-fade-in: 从大逐渐缩小并且从不透明到透明逐渐隐藏关闭动画
- pop-out: 从右侧平移出栈动画效果
- UnionType => 'auto' \\| 'none' \\| 'slide-out-right' \\| 'slide-out-left' \\| 'slide-out-top' \\| 'slide-out-bottom' \\| 'fade-out' \\| 'zoom-in' \\| 'zoom-fade-in' \\| 'pop-out' |\n| animationDuration | number \\| null | 否 | - | 窗口关闭动画的持续时间,单位为 ms |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [NavigateBackError](#navigatebackerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateBackError 的属性值 @navigatebackerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### NavigateBackOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| delta | √ | x | 4.0 |\n| animationType | x | x | 4.0 |\n| animationDuration | x | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### navigateBack 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[navigateBack](http://uniapp.dcloud.io/api/router?id=navigateback)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.navigateBack)\n"},"redirectTo":{"name":"## uni.redirectTo(options) @redirectto","description":"\n关闭当前页面,跳转到应用内的某个页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RedirectToOptions](#redirecttooptions-values) | 是 | - | - |\n#### RedirectToOptions 的属性值 @redirecttooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的应用内非 tabBar 的页面的路径 , 路径后可以带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [RedirectToError](#redirecttoerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### RedirectToError 的属性值 @redirecttoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### RedirectToOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### redirectTo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[redirectTo](http://uniapp.dcloud.io/api/router?id=redirectto)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.redirectTo)\n"},"switchTab":{"name":"## uni.switchTab(options) @switchtab","description":"\n跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SwitchTabOptions](#switchtaboptions-values) | 是 | - | - |\n#### SwitchTabOptions 的属性值 @switchtaboptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string (string.PageURIString) | 是 | - | 需要跳转的 tabBar 页面的路径,路径后不能带参数 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SwitchTabError](#switchtaberror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SwitchTabError 的属性值 @switchtaberror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SwitchTabOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### switchTab 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[switchTab](http://uniapp.dcloud.io/api/router?id=switchtab)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.navigator.switchTab)\n"},"navigator":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/navigator/navigator.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/navigator/navigator\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n data() {\r\n return {\r\n onLoadTime: 0,\r\n onShowTime: 0,\r\n onReadyTime: 0,\r\n onHideTime: 0,\r\n }\r\n },\r\n onLoad() {\r\n this.onLoadTime = Date.now()\r\n console.log('onLoad', this.onLoadTime)\r\n },\r\n onShow() {\r\n this.onShowTime = Date.now()\r\n console.log('onShow', this.onShowTime)\r\n },\r\n onReady() {\r\n this.onReadyTime = Date.now()\r\n console.log('onReady', this.onReadyTime)\r\n },\r\n onHide() {\r\n this.onHideTime = Date.now()\r\n console.log('onHide', this.onHideTime)\r\n },\r\n onBackPress(options : OnBackPressOptions) : boolean | null {\r\n console.log('onBackPress', Date.now())\r\n console.log('onBackPress from', options.from)\r\n return null\r\n },\r\n onUnload() {\r\n console.log('onUnload', Date.now())\r\n },\r\n methods: {\r\n reLaunch() {\r\n uni.reLaunch({\r\n url: '/pages/tabBar/component',\r\n success(result) {\r\n console.log('reLaunch success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('reLaunch fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('reLaunch complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateTo() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToErrorPage() {\r\n uni.navigateTo({\r\n url: '/pages/error-page/error-page',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n uni.showToast({\r\n title: error.errMsg,\r\n icon: 'none',\r\n })\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateToDebounce() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=debounce',\r\n success(result) {\r\n console.log('navigateTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n fail(error) {\r\n console.log('navigateTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n complete(result) {\r\n console.log('navigateTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath1() {\r\n uni.navigateTo({\r\n url: 'new-page/new-page-1?data=new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath2() {\r\n uni.navigateTo({\r\n url: './new-page/new-page-1?data=./new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n navigateToRelativePath3() {\r\n uni.navigateTo({\r\n url: '../navigator/new-page/new-page-1?data=../navigator/new-page/new-page-1',\r\n success() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail() {\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete() {\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBack() {\r\n uni.navigateBack({\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n navigateBackWithDelta1() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 1,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n navigateBackWithDelta100() {\r\n uni.navigateTo({\r\n url: '/pages/API/navigator/new-page/new-page-1',\r\n success() {\r\n uni.navigateBack({\r\n delta: 100,\r\n success(result) {\r\n console.log('navigateBack success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('navigateBack fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('navigateBack complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n })\r\n },\r\n redirectTo() {\r\n uni.redirectTo({\r\n url: '/pages/API/navigator/new-page/new-page-1?data=Hello',\r\n success(result) {\r\n console.log('redirectTo success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('redirectTo fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('redirectTo complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n switchTab() {\r\n uni.switchTab({\r\n url: '/pages/tabBar/template',\r\n success(result) {\r\n console.log('switchTab success', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail(error) {\r\n console.log('switchTab fail', error.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete(result) {\r\n console.log('switchTab complete', result.errMsg)\r\n // 自动化测试\r\n setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n },\r\n }\r\n\n```\n\n:::"},"setNavigationBarColor":{"name":"## uni.setNavigationBarColor(options) @setnavigationbarcolor","description":"\n设置导航条、状态栏颜色\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetNavigationBarColorOptions](#setnavigationbarcoloroptions-values) | 是 | - | - |\n#### SetNavigationBarColorOptions 的属性值 @setnavigationbarcoloroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| frontColor | \"#ffffff\" \\| \"#000000\" | 是 | - | 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 |\n| backgroundColor | string.ColorString | 是 | - | 背景颜色值,有效值为十六进制颜色 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [SetNavigationBarColorError](#setnavigationbarcolorerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarColorError 的属性值 @setnavigationbarcolorerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarColorOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| frontColor | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setNavigationBarColor 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[setNavigationBarColor](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-color.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-color)\n"},"set-navigation-bar-color":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-color/set-navigation-bar-color.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-color/set-navigation-bar-color\n>Template\n```vue\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { state, setLifeCycleNum } from '@/store/index.uts'\r\n\r\n export default {\r\n methods: {\r\n setNavigationBarColor1() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#ffffff',\r\n backgroundColor: '#00ff00',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n setNavigationBarColor2() {\r\n uni.setNavigationBarColor({\r\n frontColor: '#000000',\r\n backgroundColor: '#ff0000',\r\n success: () => {\r\n console.log('setNavigationBarColor success')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n },\r\n fail: () => {\r\n console.log('setNavigationBarColor fail')\r\n this.setLifeCycleNum(state.lifeCycleNum - 1)\r\n },\r\n complete: () => {\r\n console.log('setNavigationBarColor complete')\r\n this.setLifeCycleNum(state.lifeCycleNum + 1)\r\n }\r\n })\r\n },\r\n // 自动化测试\r\n getLifeCycleNum() : number {\r\n return state.lifeCycleNum\r\n },\r\n // 自动化测试\r\n setLifeCycleNum(num : number) {\r\n setLifeCycleNum(num)\r\n },\r\n goNavbarLite() {\r\n uni.navigateTo({\r\n url: '/pages/template/navbar-lite/navbar-lite'\r\n })\r\n },\r\n goCustomNavigation() {\r\n uni.navigateTo({\r\n url: '/pages/API/set-navigation-bar-color/set-navigation-bar-color-custom-navigation'\r\n })\r\n }\r\n },\r\n }\r\n\n```\n\n:::"},"setNavigationBarTitle":{"name":"## uni.setNavigationBarTitle(options) @setnavigationbartitle","description":"\n动态设置当前页面的标题\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetNavigationBarTitleOptions](#setnavigationbartitleoptions-values) | 是 | - | - |\n#### SetNavigationBarTitleOptions 的属性值 @setnavigationbartitleoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 页面标题 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [SetNavigationBarTitleError](#setnavigationbartitleerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarTitleError 的属性值 @setnavigationbartitleerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetNavigationBarTitleOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| title | 3.97 | x | 4.0 |\n| success | 3.97 | x | 4.0 |\n| fail | 3.97 | x | 4.0 |\n| complete | 3.97 | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setNavigationBarTitle 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","tutorial":"\n### 参见\n[setNavigationBarTitle](https://doc.dcloud.net.cn/uni-app-x/api/set-navigation-bar-title.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-navigation-bar-title)\n"},"set-navigation-bar-title":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/set-navigation-bar-title/set-navigation-bar-title.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/set-navigation-bar-title/set-navigation-bar-title\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n import { state, setLifeCycleNum } from '@/store/index.uts'\n\n export default {\n data() {\n return {\n newTitle: 'new title',\n longTitle: 'long title long title long title long title long title long title long title long title long title long title'\n }\n },\n methods: {\n setNavigationBarNewTitle() {\n uni.setNavigationBarTitle({\n title: this.newTitle,\n success: () => {\n console.log('setNavigationBarTitle success')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n },\n fail: () => {\n console.log('setNavigationBarTitle fail')\n this.setLifeCycleNum(state.lifeCycleNum - 1)\n },\n complete: () => {\n console.log('setNavigationBarTitle complete')\n this.setLifeCycleNum(state.lifeCycleNum + 1)\n }\n })\n },\n setNavigationBarLongTitle() {\n uni.setNavigationBarTitle({\n title: this.longTitle,\n success() {\n console.log('setNavigationBarTitle success')\n },\n fail() {\n console.log('setNavigationBarTitle fail')\n },\n complete() {\n console.log('setNavigationBarTitle complete')\n }\n })\n },\n // 自动化测试\n getLifeCycleNum() : number {\n return state.lifeCycleNum\n },\n // 自动化测试\n setLifeCycleNum(num : number) {\n setLifeCycleNum(num)\n }\n },\n }\n\n```\n\n:::"},"showTabBar":{"name":"## uni.showTabBar(options?) @showtabbar","description":"\n显示 tabBar\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowTabBarOptions](#showtabbaroptions-values) \\| null | 否 | - | |\n#### ShowTabBarOptions 的属性值 @showtabbaroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| animation | boolean | 否 | - | 是否需要动画效果 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### showTabBar 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[showTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBar)\n"},"hideTabBar":{"name":"## uni.hideTabBar(options?) @hidetabbar","description":"\n隐藏 tabBar\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [HideTabBarOptions](#hidetabbaroptions-values) \\| null | 否 | - | |\n#### HideTabBarOptions 的属性值 @hidetabbaroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| animation | boolean | 否 | - | 是否需要动画效果 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### hideTabBar 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[hideTabBar](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbar)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBar)\n"},"showTabBarRedDot":{"name":"## uni.showTabBarRedDot(options) @showtabbarreddot","description":"\n显示 tabBar 某一项的右上角的红点\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowTabBarRedDotOptions](#showtabbarreddotoptions-values) | 是 | - | - |\n#### ShowTabBarRedDotOptions 的属性值 @showtabbarreddotoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### showTabBarRedDot 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[showTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#showtabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.showTabBarRedDot)\n"},"hideTabBarRedDot":{"name":"## uni.hideTabBarRedDot(options) @hidetabbarreddot","description":"\n隐藏 tabBar 某一项的右上角的红点\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [HideTabBarRedDotOptions](#hidetabbarreddotoptions-values) | 是 | - | - |\n#### HideTabBarRedDotOptions 的属性值 @hidetabbarreddotoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### hideTabBarRedDot 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[hideTabBarRedDot](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#hidetabbarreddot)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.hideTabBarRedDot)\n"},"setTabBarBadge":{"name":"## uni.setTabBarBadge(options) @settabbarbadge","description":"\n为 tabBar 某一项的右上角添加文本\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarBadgeOptions](#settabbarbadgeoptions-values) | 是 | - | - |\n#### SetTabBarBadgeOptions 的属性值 @settabbarbadgeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| text | string | 是 | - | 显示的文本,不超过 3 个半角字符 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setTabBarBadge 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[setTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarBadge)\n"},"removeTabBarBadge":{"name":"## uni.removeTabBarBadge(options) @removetabbarbadge","description":"\n移除 tabBar 某一项右上角的文本\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RemoveTabBarBadgeOptions](#removetabbarbadgeoptions-values) | 是 | - | - |\n#### RemoveTabBarBadgeOptions 的属性值 @removetabbarbadgeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar的哪一项,从左边算起,索引从0开始 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### removeTabBarBadge 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[removeTabBarBadge](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#removetabbarbadge)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.removeTabBarBadge)\n"},"setTabBarStyle":{"name":"## uni.setTabBarStyle(options) @settabbarstyle","description":"\n动态设置 tabBar 的整体样式\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarStyleOptions](#settabbarstyleoptions-values) | 是 | - | - |\n#### SetTabBarStyleOptions 的属性值 @settabbarstyleoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| color | string (string.ColorString) | 否 | - | tab 上的文字默认颜色 |\n| selectedColor | string (string.ColorString) | 否 | - | tab 上的文字选中时的颜色 |\n| backgroundColor | string (string.ColorString) | 否 | - | tab 的背景色 |\n| backgroundImage | string | 否 | - | 图片背景 |\n| backgroundRepeat | \"repeat\" \\| \"repeat-x\" \\| \"repeat-y\" \\| \"no-repeat\" | 否 | - | 背景图平铺方式
- repeat: 背景图片在垂直方向和水平方向平铺
- repeat-x: 背景图片在水平方向平铺,垂直方向拉伸
- repeat-y: 背景图片在垂直方向平铺,水平方向拉伸
- no-repeat: 背景图片在垂直方向和水平方向都拉伸 |\n| borderStyle | string | 否 | - | tabbar上边框的颜色 |\n| midButton | [MidButtonOptions](#midbuttonoptions-values) | 否 | - | tabbar 中间按钮 仅在 list 项为偶数时有效 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### MidButtonOptions 的属性值 @midbuttonoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| width | string | 否 | - | 中间按钮的宽度,tabBar 其它项为减去此宽度后平分,默认值为与其它项平分宽度。默认 80px |\n| height | string | 否 | - | 中间按钮的高度,可以大于 tabBar 高度,达到中间凸起的效果。默认 50px |\n| text | string | 否 | - | 中间按钮的文字 |\n| iconPath | string | 否 | - | 中间按钮的图片路径 |\n| iconWidth | string | 否 | - | 图片宽度(高度等比例缩放)。默认 24px |\n| backgroundImage | string | 否 | - | 中间按钮的背景图片路径 |\n| iconfont | [MidButtonIconFont](#midbuttoniconfont-values) | 否 | - | 字体图标,优先级高于 iconPath |\n\n###### MidButtonIconFont 的属性值 @midbuttoniconfont-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | 否 | - | 字库 Unicode 码 |\n| selectedText | string | 否 | - | 选中后字库 Unicode 码 |\n| fontSize | string | 否 | - | 字体图标字号(px) |\n| color | string | 否 | - | 字体图标颜色 |\n| selectedColor | string | 否 | - | 字体图标选中颜色 |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setTabBarStyle 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[setTabBarStyle](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbarstyle)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarStyle)\n"},"setTabBarItem":{"name":"## uni.setTabBarItem(options) @settabbaritem","description":"\n动态设置 tabBar 某一项的内容\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetTabBarItemOptions](#settabbaritemoptions-values) | 是 | - | - |\n#### SetTabBarItemOptions 的属性值 @settabbaritemoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | tabBar 的哪一项,从左边算起,索引从0开始 |\n| text | string | 否 | - | tab 上按钮文字 |\n| iconPath | string | 否 | - | 图片路径 |\n| selectedIconPath | string | 否 | - | 选中时的图片路径 |\n| pagePath | string | 否 | - | 页面绝对路径 |\n| iconfont | [SetTabBarItemIconFontOptions](#settabbaritemiconfontoptions-values) | 否 | - | 字体图标,优先级高于 iconPath |\n| visible | boolean | 否 | - | tab 是否显示 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [SetTabBarError](#settabbarerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### SetTabBarItemIconFontOptions 的属性值 @settabbaritemiconfontoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | 是 | - | 字库 Unicode 码 |\n| selectedText | string | 是 | - | 选中后字库 Unicode 码 |\n| fontSize | string | 否 | - | 字体图标字号(px) |\n| color | string | 否 | - | 字体图标颜色 |\n| selectedColor | string | 否 | - | 字体图标选中颜色 |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### SetTabBarError 的属性值 @settabbarerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100 \\| 200 | 是 | - | 错误码
- 100: TabBar 不存在
- 200: 参数错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### setTabBarItem 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[setTabBarItem](https://doc.dcloud.net.cn/uni-app-x/api/set-tabbar.html#settabbaritem)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.set-tabbar.setTabBarItem)\n"},"startPullDownRefresh":{"name":"## uni.startPullDownRefresh(options?) @startpulldownrefresh","description":"\n开始下拉刷新\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [StartPullDownRefreshOptions](#startpulldownrefreshoptions-values) \\| null | 否 | - | |\n#### StartPullDownRefreshOptions 的属性值 @startpulldownrefreshoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [PullDownRefreshError](#pulldownrefresherror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### PullDownRefreshError 的属性值 @pulldownrefresherror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### startPullDownRefresh 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[startPullDownRefresh](https://uniapp.dcloud.io/uni-app-x/api/pull-down-refresh.html#startpulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.startPullDownRefresh)\n"},"stopPullDownRefresh":{"name":"## uni.stopPullDownRefresh() @stoppulldownrefresh","description":"\n停止当前页面下拉刷新\n","param":"","returnValue":"","compatibility":"### stopPullDownRefresh 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[stopPullDownRefresh](https://doc.dcloud.net.cn/uni-app-x/api/pull-down-refresh.html#stoppulldownrefresh)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.pull-down-refresh.stopPullDownRefresh)\n"},"pull-down-refresh":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/pull-down-refresh/pull-down-refresh.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/pull-down-refresh/pull-down-refresh\n>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n\texport default {\n\t\tdata() {\n\t\t\treturn {\n\t\t\t\tdata: [] as Array,\n\t\t\t\tloadMoreText: \"加载中...\",\n\t\t\t\tshowLoadMore: false,\n\t\t\t\tmax: 0\n\t\t\t}\n\t\t},\n\t\tonLoad() {\n\t\t\tthis.initData();\n\t\t},\n\t\tonReachBottom() {\n\t\t\tconsole.log(\"onReachBottom\");\n\t\t\tif (this.max > 40) {\n\t\t\t\tthis.loadMoreText = \"没有更多数据了!\"\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.showLoadMore = true;\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.setListData();\n\t\t\t}, 300);\n\t\t},\n\t\tonPullDownRefresh() {\n\t\t\tconsole.log('onPullDownRefresh');\n\t\t\tthis.initData();\n\t\t},\n\t\tmethods: {\n\t\t\tinitData(){\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tthis.max = 0;\n\t\t\t\t\tthis.data = [];\n\t\t\t\t\tlet data:Array = [];\n\t\t\t\t\tthis.max += 20;\n\t\t\t\t\tfor (let i:number = this.max - 19; i < this.max + 1; i++) {\n\t\t\t\t\t\tdata.push(i)\n\t\t\t\t\t}\n\t\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t\t\tuni.stopPullDownRefresh();\n\t\t\t\t}, 300);\n\t\t\t},\n\t\t\tsetListData() {\n\t\t\t\tlet data:Array = [];\n\t\t\t\tthis.max += 10;\n\t\t\t\tfor (let i:number = this.max - 9; i < this.max + 1; i++) {\n\t\t\t\t\tdata.push(i)\n\t\t\t\t}\n\t\t\t\tthis.data = this.data.concat(data);\n\t\t\t}\n\t\t}\n\t}\n\n```\n\n:::"},"pageScrollTo":{"name":"## uni.pageScrollTo(options) @pagescrollto","description":"\n将页面滚动到目标位置\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [PageScrollToOptions](#pagescrolltooptions-values) | 是 | - | - |\n#### PageScrollToOptions 的属性值 @pagescrolltooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| scrollTop | number \\| null | 否 | - | 滚动到页面的目标位置 |\n| selector | string \\| null | 否 | - | 选择器 |\n| offsetTop | number \\| null | 否 | - | 偏移距离,可以滚动到 selector 加偏移距离的位置 |\n| duration | number \\| null | 否 | - | 滚动动画的时长 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [PageScrollToError](#pagescrolltoerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: [AsyncApiResult](#asyncapiresult-values)) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### PageScrollToError 的属性值 @pagescrolltoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### PageScrollToOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| offsetTop | 3.91 | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### pageScrollTo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[pageScrollTo](https://doc.dcloud.net.cn/uni-app-x/api/page-scroll-to.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.page.page-scroll-to)\n"},"page-scroll-to":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/page-scroll-to/page-scroll-to.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/page-scroll-to/page-scroll-to\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'pageScrollTo',\n }\n },\n methods: {\n scrollTo() {\n uni.pageScrollTo({\n scrollTop: 100,\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n scrollToElement() {\n uni.pageScrollTo({\n selector: '.custom-element',\n duration: 300,\n success: () => {\n console.log('success')\n },\n })\n },\n },\n }\n\n```\n\n:::"},"getElementById":{"name":"## uni.getElementById(id) @getelementbyid","description":"\n返回一个匹配特定 ID 的元素, 如果不存在,返回 null。\\\n如果需要获取指定的节点类型,需要使用 as 进行类型转换。\\\nID 区分大小写,且应该是唯一的。如果存在多个匹配的元素,则返回第一个匹配的元素。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | string.IDString \\| string | 是 | - | - |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [UniElement](/dom/unielement.md) \\| null | 否 | \n","compatibility":"### getElementById 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[getElementById](https://doc.dcloud.net.cn/uni-app-x/api/get-element.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.get-element.getElementById)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-element-by-id/get-element-by-id.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-element-by-id/get-element-by-id\n>Template\n```vue\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n checked: false,\r\n homePagePath: '/pages/tabBar/component',\r\n launchOptionsPath: '',\r\n }\r\n },\r\n methods: {\r\n getElementByNotExistId() : Element | null {\r\n return uni.getElementById('not-exist-id')\r\n },\r\n changePageHeadBackgroundColor() {\r\n const pageHead = uni.getElementById('page-head')!\r\n pageHead.style.setProperty('background-color', 'red')\r\n },\r\n changeTextColor() {\r\n const text = uni.getElementById('text')!\r\n text.style.setProperty('color', 'red')\r\n },\r\n changeViewStyle() {\r\n const view = uni.getElementById('view')\r\n if (view !== null) {\r\n view.style.setProperty('width', '90%')\r\n view.style.setProperty('height', '50px')\r\n view.style.setProperty('background-color', '#007AFF')\r\n }\r\n },\r\n goMultipleRootNode() {\r\n uni.navigateTo({ url: '/pages/API/get-element-by-id/get-element-by-id-multiple-root-node' })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"createSelectorQuery":{"name":"## uni.createSelectorQuery() @createselectorquery","description":"\n返回一个SelectorQuery对象实例\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n#### SelectorQuery 的方法 @selectorquery-values \n\n#### in(component?) @in\n\n将选择器的选取范围更改为自定义组件component内\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| component | any \\| null | 否 | - | |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n#### select(selector) @select\n\n在当前页面下选择第一个匹配选择器selector的节点\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| selector | string | 是 | - | - |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) | \n\n###### NodesRef 的方法 @nodesref-values \n\n##### boundingClientRect(callback?) @boundingclientrect\n\n添加节点的布局位置的查询请求,相对于显示区域,以像素为单位\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void \\| null | 否 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n##### scrollOffset(callback) @scrolloffset\n\n添加节点的滚动位置查询请求,以像素为单位\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n##### fields(fields, callback) @fields\n\n获取节点的相关信息,需要获取的字段在fields中指定\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fields | [NodeField](#nodefield-values) | 是 | - | - |\n| callback | (result: any) => void | 是 | - | |\n###### NodeField 的属性值 @nodefield-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | boolean \\| null | 否 | - | 是否返回节点 id |\n| dataset | boolean \\| null | 否 | - | 是否返回节点 dataset |\n| rect | boolean \\| null | 否 | - | 是否返回节点布局位置(left right top bottom) |\n| size | boolean \\| null | 否 | - | 是否返回节点尺寸(width height) |\n| scrollOffset | boolean \\| null | 否 | - | 是否返回节点的 scrollLeft scrollTop,节点必须是 scroll-view 或者 viewport |\n| properties | Array\\ \\| null | 否 | - | 指定属性名列表,返回节点对应属性名的当前属性值(只能获得组件文档中标注的常规属性值,id class style 和事件绑定的属性值不可获取) |\n| computedStyle | Array\\ \\| null | 否 | - | 指定样式名列表,返回节点对应样式名的当前值 |\n| context | boolean \\| null | 否 | - | 是否返回节点对应的 Context 对象 |\n\n###### NodeField 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| context | x | x | 4.0 |\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n##### context(callback) @context\n\n添加节点的 Context 对象查询请求\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n###### context 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| x | x | 4.0 |\n\n\n##### node(callback) @node\n\n获取 Node 节点实例。目前支持 Canvas 的获取。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [SelectorQuery](#selectorquery-values) | \n\n\n\n\n\n#### selectAll(selector) @selectall\n\n在当前页面下选择匹配选择器selector的所有节点\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| selector | string | 是 | - | - |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) | \n\n\n\n#### selectViewport() @selectviewport\n\n选择显示区域\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| [NodesRef](#nodesref-values) | \n\n\n\n#### exec(callback) @exec\n\n执行所有的请求\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: Array\\) => void \\| null | 是 | - | - |\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [NodesRef](#nodesref-values) \\| null | 否 | \n\n\n","compatibility":"### createSelectorQuery 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.91 | x | 4.0 |\n","tutorial":"\n### 参见\n[createSelectorQuery](https://doc.dcloud.net.cn/uni-app-x/api/nodes-info.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.dom.nodes-info.createSelectorQuery)\n"},"nodes-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/nodes-info/nodes-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/nodes-info/nodes-info\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n type NodeInfoType = {\n left : number | null,\n top : number | null,\n right : number | null,\n bottom : number | null,\n width : number | null,\n height : number | null,\n }\n\n export default {\n data() {\n return {\n title: 'createSelectorQuery',\n nodeInfoList: [] as NodeInfoType[],\n // 仅用于自动化测试\n rootNodeInfo: null as NodeInfoType | null,\n //供自动化测试使用\n // resizeRectValid: false\n }\n },\n onResize() {\n //供自动化测试使用\n /* var rect12Element = uni.getElementById(\"rect-1-2\")\n if(rect12Element != null) {\n var domRect = rect12Element.getBoundingClientRect()\n if(domRect.width > 100) {\n this.resizeRectValid = true\n }\n } */\n },\n methods: {\n // 仅用于自动化测试\n getRootNodeInfo(selector: string) {\n uni.createSelectorQuery().select(selector).boundingClientRect().exec((ret) => {\n if (ret.length == 1) {\n const nodeInfo = ret[0] as NodeInfo;\n const nodeType = {\n left: nodeInfo.left,\n top: nodeInfo.top,\n right: nodeInfo.right,\n bottom: nodeInfo.bottom,\n width: nodeInfo.width,\n height: nodeInfo.height,\n } as NodeInfoType;\n this.rootNodeInfo = nodeType\n }\n })\n },\n getNodeInfo() {\n uni.createSelectorQuery().select('.rect1').boundingClientRect().exec((ret) => {\n this.nodeInfoList.length = 0\n const i = ret[0] as NodeInfo\n this.nodeInfoList.push({\n left: i.left,\n top: i.top,\n right: i.right,\n bottom: i.bottom,\n width: i.width,\n height: i.height,\n } as NodeInfoType)\n })\n },\n getAllNodeInfo() {\n uni.createSelectorQuery().selectAll('.rect').boundingClientRect().exec((ret) => {\n this.nodeInfoList.length = 0\n const array = ret[0] as NodeInfo[]\n array.forEach((i) => {\n this.nodeInfoList.push({\n left: i.left,\n top: i.top,\n right: i.right,\n bottom: i.bottom,\n width: i.width,\n height: i.height,\n } as NodeInfoType)\n })\n })\n }\n }\n }\n\n```\n\n:::"},"showActionSheet":{"name":"## uni.showActionSheet(options) @showactionsheet","description":"从底部向上弹出操作菜单","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowActionSheetOptions](#showactionsheetoptions-values) | 是 | - | uni.showActionSheet函数参数定义 |\n#### ShowActionSheetOptions 的属性值 @showactionsheetoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string \\| null | 否 | - | 菜单标题 |\n| alertText | string \\| null | 否 | - | 警示文案(同菜单标题, app无效) |\n| itemList | Array\\ | 是 | - | 按钮的文字数组 |\n| itemColor | string.ColorString \\| null | 否 | - | 按钮的文字颜色,字符串格式(iOS默认为系统控件颜色) |\n| popover | [Popover](#popover-values) \\| null | 否 | - | 大屏设备弹出原生选择按钮框的指示区域,默认居中显示 |\n| success | (res: [ShowActionSheetSuccess](#showactionsheetsuccess-values)) => void \\| null | 否 | - | uni.showActionSheet成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showActionSheet成功回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showActionSheet成功回调函数定义 |\n\n##### Popover 的属性值 @popover-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| top | number | 是 | - | 指示区域坐标,使用原生 navigationBar 时一般需要加上 navigationBar 的高度 |\n| left | number | 是 | - | 指示区域坐标 |\n| width | number | 是 | - | 指示区域宽度 |\n| height | number | 是 | - | 指示区域高度 |\n\n##### ShowActionSheetSuccess 的属性值 @showactionsheetsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tapIndex | number \\| null | 否 | - | 用户点击的按钮,从上到下的顺序,从0开始 |\n","returnValue":"","compatibility":"### showActionSheet 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showActionSheet]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showActionSheet)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/action-sheet/action-sheet.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/action-sheet/action-sheet\n>Template\n```vue\n\r\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 title: 'action-sheet',\r\n itemColorCustom: false,\r\n itemContentLarge: false,\r\n itemNumLargeSelect: false,\n showErrorToast:true,\r\n items: [{\r\n value: '标题',\r\n name: '有标题'\r\n },\r\n {\r\n value: '',\r\n name: '无标题'\r\n },\r\n {\r\n value: '超长标题测试内容,测试超过显示最大范围之后的样式-超长标题测试内容,测试超过显示最大范围之后的样式',\r\n name: '超长标题'\r\n }\r\n ] as ItemType[],\r\n current: 0,\r\n }\r\n },\n onLoad(){\n uni.showActionSheet({\n title: \"onLoad 调用示例,请手动取消\",\n itemList:['item1', 'item2'],\n })\n },\r\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\r\n radioChange(e : UniRadioGroupChangeEvent) {\r\n for (let i = 0; i < this.items.length; i++) {\r\n if (this.items[i].value === e.detail.value) {\r\n this.current = i;\r\n break;\r\n }\r\n }\r\n },\r\n itemContentLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemContentLarge = e.detail.value\r\n },\r\n itemColorChange: function (e : UniSwitchChangeEvent) {\r\n this.itemColorCustom = e.detail.value\r\n },\r\n itemNumLargeChange: function (e : UniSwitchChangeEvent) {\r\n this.itemNumLargeSelect = e.detail.value\r\n },\r\n actionSheetTap() {\r\n\r\n let itemInfo = ['item1', 'item2', 'item3', 'item4']\r\n\r\n if (this.itemContentLarge) {\r\n itemInfo = ['两个黄鹂鸣翠柳,一行白鹭上青天。窗含西岭千秋雪,门泊东吴万里船', '水光潋滟晴方好,山色空蒙雨亦奇。 欲把西湖比西子,淡妆浓抹总相宜', '']\r\n }\n\n if (this.itemNumLargeSelect) {\r\n // 大量选项测试,不能超过6个元素 https://uniapp.dcloud.net.cn/api/ui/prompt.html#showactionsheet\r\n itemInfo = []\n for (var i = 1; i <= 10; i++) {\r\n itemInfo.push('两个黄鹂鸣翠柳,一行白鹭上青天');\r\n }\r\n }\r\n\r\n const that = this\r\n if (this.itemColorCustom) {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n itemColor: \"#ff00ff\",\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\r\n console.log(e);\r\n }\r\n })\r\n } else {\r\n uni.showActionSheet({\r\n title: this.items[this.current].value,\r\n itemList: itemInfo,\r\n success: (e) => {\r\n console.log(e.tapIndex);\r\n uni.showToast({\r\n title: \"点击了第\" + e.tapIndex + \"个选项\",\r\n icon: \"none\"\r\n })\r\n },\r\n fail: (e) => {\r\n console.log(e);\n if(this.showErrorToast){\n uni.showToast({\n title: e.errMsg,\n icon: \"none\"\n })\n }\n }\r\n })\r\n }\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"showLoading":{"name":"## uni.showLoading(options) @showloading","description":"显示 loading 提示框, 需主动调用 uni.hideLoading 才能关闭提示框。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowLoadingOptions](#showloadingoptions-values) | 是 | - | uni.showLoading参数定义 |\n#### ShowLoadingOptions 的属性值 @showloadingoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |\n| mask | boolean \\| null | 否 | - | 是否显示透明蒙层,防止触摸穿透,默认:false |\n| success | (res: ShowLoadingSuccess) => void \\| null | 否 | - | uni.showLoading成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showLoading失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showLoading完成回调函数定义 |\n","returnValue":"","compatibility":"### showLoading 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showLoading]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showloading))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showLoading)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/loading/loading.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/loading/loading\n>Template\n```vue\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string\n name : string\n }\n export default {\n data() {\n return {\n title: 'loading',\n items: [\n {\n value: 'null',\n name: '无标题',\n },\n {\n value: '三秒后自动关闭',\n name: '普通标题',\n },\n {\n value: '超长文本内容,测试超出范围-超长文本内容,测试超出范围-三秒后自动关闭',\n name: '长标题',\n },\n ] as ItemType[],\n current: 0,\n maskSelect: false,\n titleSelect: \"null\"\n }\n },\n onLoad(){\n uni.showLoading({\n \ttitle:'onLoad 调用示例,2秒后消失'\n })\n setTimeout(function() {\n uni.hideLoading()\n }, 2000);\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n\n radioChange(e : UniRadioGroupChangeEvent) {\n const selected = this.items.find((item) : boolean => {\n return item.value == e.detail.value\n })\n if (selected != null) {\n this.titleSelect = selected.value\n }\n },\n maskChange: function (e : UniSwitchChangeEvent) {\n this.maskSelect = e.detail.value\n },\n showLoading: function () {\n\n console.log(this.titleSelect)\n if (this.titleSelect == \"null\") {\n uni.showLoading({\n title: \"\",\n mask: this.maskSelect\n });\n } else {\n uni.showLoading({\n title: this.titleSelect,\n mask: this.maskSelect\n });\n }\n setTimeout(() => {\n this.hideLoading();\n }, 3000);\n },\n hideLoading: function () {\n uni.hideLoading();\n }\n }\n }\n\n```\n\n:::"},"showModal":{"name":"## uni.showModal(options) @showmodal","description":"显示模态弹窗,可以只有一个确定按钮,也可以同时有确定和取消按钮。类似于一个API整合了 html 中:alert、confirm。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowModalOptions](#showmodaloptions-values) | 是 | - | uni.showModal 参数定义 |\n#### ShowModalOptions 的属性值 @showmodaloptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string \\| null | 否 | - | 提示的标题 |\n| content | string \\| null | 否 | - | 提示的内容 |\n| showCancel | boolean \\| null | 否 | true
是否显示取消按钮,默认为 true | |\n| cancelText | string \\| null | 否 | - | 取消按钮的文字,默认为\"取消\" |\n| cancelColor | string.ColorString \\| null | 否 | - | 取消按钮的文字颜色,默认为\"#000000\" |\n| confirmText | string \\| null | 否 | - | 确定按钮的文字,默认为\"确定\" |\n| confirmColor | string.ColorString \\| null | 否 | - | 确定按钮的文字颜色 |\n| editable | boolean \\| null | 否 | false
是否显示输入框 | |\n| placeholderText | string \\| null | 否 | - | 显示输入框时的提示文本 |\n| success | (res: [ShowModalSuccess](#showmodalsuccess-values)) => void \\| null | 否 | - | uni.showModal成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showModal失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showModal完成回调函数定义 |\n\n##### ShowModalSuccess 的属性值 @showmodalsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| confirm | boolean | 是 | - | 为 true 时,表示用户点击了确定按钮 |\n| cancel | boolean | 是 | - | 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) |\n| content | string \\| null | 否 | - | editable 为 true 时,用户输入的文本 |\n","returnValue":"","compatibility":"### showModal 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showModal]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showmodal))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showModal)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/modal/modal.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/modal/modal\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string,\n }\n export default {\n data() {\n return {\n title: 'modal',\n showCancelSelect: false,\n cancelTextSelect: false,\n confirmTextSelect: false,\n editableSelect: false,\n placeholderTextSelect: false,\n exeRet: \"\",\n items: [{\n value: '标题',\n name: '有标题'\n },\n {\n value: '',\n name: '无标题'\n },\n {\n value: '超长标题测试内容,测试超过显示最大范围之后的样式-超长标题测试内容,测试超过显示最大范围之后的样式',\n name: '超长标题'\n }\n ] as ItemType[],\n current: 0\n }\n },\n onLoad() {\n uni.showModal({\n title: \"onLoad 调用示例,请手动取消\",\n showCancel: false\n })\n },\n methods: {\n //自动化测试例专用\n jest_getWindowInfo() : GetWindowInfoResult {\n return uni.getWindowInfo();\n },\n showCancelChange: function (e : UniSwitchChangeEvent) {\n this.showCancelSelect = e.detail.value\n },\n cancelTextChange: function (e : UniSwitchChangeEvent) {\n this.cancelTextSelect = e.detail.value\n },\n confirmTextChange: function (e : UniSwitchChangeEvent) {\n this.confirmTextSelect = e.detail.value\n },\n editableChange: function (e : UniSwitchChangeEvent) {\n this.editableSelect = e.detail.value\n },\n placeholderTextChange: function (e : UniSwitchChangeEvent) {\n this.placeholderTextSelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n modalTap: function () {\n let cancelTextVal : string\n let cancelColorVal = ''\n if (this.cancelTextSelect) {\n cancelTextVal = \"修改后的取消文本\"\n cancelColorVal = \"#ff00ff\"\n } else {\n cancelTextVal = \"取消\"\n }\n\n let confirmTextVal = '确定'\n let confirmColorVal = ''\n if (this.confirmTextSelect) {\n confirmTextVal = \"修改后的确定文本\"\n confirmColorVal = \"#00ffff\"\n }\n\n let placeholderTextVal = ''\n let contentVal = \"弹窗内容,告知当前状态、信息和解决方法,描述文字尽量控制在三行内\"\n if (this.placeholderTextSelect) {\n placeholderTextVal = \"定制提示信息\"\n contentVal = \"\"\n }\n uni.showModal({\n title: this.items[this.current].value,\n editable: this.editableSelect,\n placeholderText: placeholderTextVal,\n content: contentVal,\n showCancel: this.showCancelSelect,\n cancelText: cancelTextVal,\n cancelColor: cancelColorVal,\n confirmText: confirmTextVal,\n confirmColor: confirmColorVal,\n success: (res) => {\n this.exeRet = JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = JSON.stringify(res)\n }\n })\n }\n }\n }\n\n```\n\n:::"},"showToast":{"name":"## uni.showToast(options) @showtoast","description":"显示消息提示框","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ShowToastOptions](#showtoastoptions-values) | 是 | - | uni.showToast参数定义 |\n#### ShowToastOptions 的属性值 @showtoastoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 是 | - | 提示的内容,长度与 icon 取值有关。 |\n| icon | \"success\" \\| \"error\" \\| \"fail\" \\| \"exception\" \\| \"loading\" \\| \"none\" | 否 | - | icon值说明 success: 显示成功图标,error: 显示错误图标; fail: 显示错误图标,此时title文本无长度显示; exception: 显示异常图标,此时title文本无长度显示; loading: 显示加载图标;none: 不显示图标。 |\n| image | string.ImageURIString \\| null | 否 | - | 自定义图标的本地路径(app端暂不支持gif) |\n| mask | boolean \\| null | 否 | - | 是否显示透明蒙层,防止触摸穿透,默认:false |\n| duration | number \\| null | 否 | - | 提示的延迟时间,单位毫秒,默认:1500 |\n| position | \"top\" \\| \"center\" \\| \"bottom\" | 否 | - | position值说明(仅App生效) top: 居上显示; center: 居中显示;bottom: 居底显示 |\n| success | (res: ShowToastSuccess) => void \\| null | 否 | - | uni.showToast成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.showToast失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.showToast完成回调函数定义 |\n","returnValue":"","compatibility":"### showToast 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[showToast]([](https://uniapp.dcloud.net.cn/api/ui/prompt.html#showtoast))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.prompt.showToast)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/toast/toast.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/toast/toast\n>Template\n```vue\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'toast',\n exeRet: ''\n }\n },\n onLoad() {\n uni.showToast({\n title: 'onLoad 调用示例,2秒后消失'\n })\n setTimeout(function () {\n uni.hideToast()\n }, 2000);\n },\n methods: {\n toast1Tap: function () {\n uni.showToast({\n title: \"默认\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toastTapIconError: function () {\n uni.showToast({\n title: \"默认\",\n icon: 'error',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast2Tap: function () {\n uni.showToast({\n title: \"duration 3000\",\n duration: 3000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast3Tap: function () {\n uni.showToast({\n title: \"loading\",\n icon: \"loading\",\n duration: 5000,\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n toast4Tap: function () {\n uni.showToast({\n title: \"logo\",\n image: \"/static/uni.png\",\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #ifdef APP-PLUS\n toast5Tap: function () {\n uni.showToast({\n title: \"显示一段轻提示\",\n position: 'bottom',\n success: (res) => {\n this.exeRet = \"success:\" + JSON.stringify(res)\n },\n fail: (res) => {\n this.exeRet = \"fail:\" + JSON.stringify(res)\n },\n })\n },\n // #endif\n hideToast: function () {\n uni.hideToast()\n }\n }\n }\n\n```\n\n:::"},"loadFontFace":{"name":"## uni.loadFontFace(options) @loadfontface","description":"\n动态加载网络字体\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [LoadFontFaceOptions](#loadfontfaceoptions-values) | 是 | - | - |\n#### LoadFontFaceOptions 的属性值 @loadfontfaceoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| global | boolean | 否 | - | 是否全局生效。微信小程序 '2.10.0'起支持全局生效,需在 app.vue 中调用。 |\n| family | string | 是 | - | 定义的字体名称 |\n| source | string | 是 | - | 字体资源的地址, App-Android 平台不支持 woff、woff2 格式字体文件 |\n| desc | [LoadFontFaceOptionDesc](#loadfontfaceoptiondesc-values) | 否 | - | 可选的字体描述符 |\n| success | (result: [AsyncApiSuccessResult](#asyncapisuccessresult-values)) => void | 否 | - | 接口调用成功的回调函数 |\n| fail | (error: [LoadFontFaceError](#loadfontfaceerror-values)) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: [AsyncApiResult](#asyncapiresult-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### LoadFontFaceOptionDesc 的属性值 @loadfontfaceoptiondesc-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| style | string \\| null | 否 | - | |\n| weight | string \\| null | 否 | - | |\n| variant | string \\| null | 否 | - | |\n\n##### AsyncApiSuccessResult 的属性值 @asyncapisuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### LoadFontFaceError 的属性值 @loadfontfaceerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 4 \\| 99 \\| 101 \\| 100001 \\| 100002 \\| 200001 \\| 300001 \\| 300002 | 是 | - | 错误码
- 4: 框架内部异常
- 99: page is not ready
- 101: 参数错误
- 100001: family is null
- 100002: source is null
- 200001: local font not found
- 300001: same source task is loading
- 300002: download fail |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| name | string | 是 | - | - |\n| message | string | 是 | - | - |\n\n##### AsyncApiResult 的属性值 @asyncapiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### LoadFontFaceOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| global | √ | x | 4.0 |\n| family | √ | x | 4.0 |\n| source | √ | x | 4.0 |\n| desc | x | x | 4.0 |\n| success | √ | x | 4.0 |\n| fail | √ | x | 4.0 |\n| complete | √ | x | 4.0 |\n","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| Promise \\| null | 否 | \n","compatibility":"### loadFontFace 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","tutorial":"\n### 参见\n[loadFontFace](https://doc.dcloud.net.cn/uni-app-x/api/load-font-face.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.load-font-face)\n"},"load-font-face":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/load-font-face/load-font-face.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/load-font-face/load-font-face\n>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n uniIcon1: '\\ue100',\n uniIcon2: '\\ue101',\n }\n },\n onLoad() {\n uni.loadFontFace({\n global: true,\n family: 'UniFontFamily',\n source: \"url('/static/font/uni.ttf')\",\n success() {\n console.log('global loadFontFace uni.ttf success')\n },\n fail(error) {\n console.warn('global loadFontFace uni.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiTTF',\n source:\n \"url('https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/font/AlimamaDaoLiTi.ttf')\",\n success() {\n console.log('loadFontFace Remote AlimamaDaoLiTi.ttf success')\n },\n fail(error) {\n console.warn('loadFontFace Remote AlimamaDaoLiTi.ttf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiOTF',\n source: \"url('/static/font/AlimamaDaoLiTi.otf')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.otf success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.otf fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF',\n source: \"url('/static/font/AlimamaDaoLiTi.woff')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff fail', error.errMsg)\n },\n })\n uni.loadFontFace({\n family: 'AlimamaDaoLiTiWOFF2',\n source: \"url('/static/font/AlimamaDaoLiTi.woff2')\",\n success() {\n console.log('loadFontFace AlimamaDaoLiTi.woff2 success')\n },\n fail(error) {\n console.warn('loadFontFace AlimamaDaoLiTi.woff2 fail', error.errMsg)\n },\n })\n },\n methods: {\n navigateToChild() {\n uni.navigateTo({\n url: '/pages/API/load-font-face/load-font-face-child',\n })\n },\n },\n }\n\n```\n\n:::"},"rpx2px":{"name":"## uni.rpx2px(number) @rpx2px","description":"rpx2px","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| number | number | 是 | - | - |","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| number | \n","compatibility":"### rpx2px 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 4.01 | x | √ |\n","tutorial":"\n### 参见\n[rpx2px](https://doc.dcloud.net.cn/uni-app-x/api/rpx2px.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ui.rpx2px)\n"},"request":{"name":"## uni.request(param) @request","description":"发起网络请求。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| param | [RequestOptions\\](#requestoptions-values) | 是 | - | 网络请求参数 |\n#### RequestOptions\\ 的属性值 @requestoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器接口地址 |\n| data | any \\| null | 否 | null | 请求的参数 UTSJSONObject\\|string类型 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | 设置请求的 header,header 中不能设置 Referer |\n| method | Union \\| null | 否 | \"GET\" | 请求方法
- GET GET方法请求一个指定资源的表示形式,使用 GET 的请求应该只被用于获取数据。
- POST POST方法用于将实体提交到指定的资源,通常导致在服务器上的状态变化或副作用。
- PUT PUT方法用有效载荷请求替换目标资源的所有当前表示。
- PATCH PATCH方法用于对资源应用部分修改。
- DELETE DELETE方法删除指定的资源。
- HEAD HEAD方法请求一个与GET请求的响应相同的响应,但没有响应体。
- OPTIONS OPTIONS 方法用于描述目标资源的通信选项。 |\n| timeout | number \\| null | 否 | 60000 | 超时时间,单位 ms |\n| firstIpv4 | boolean \\| null | 否 | false | DNS解析时优先使用ipv4 |\n| success | (option: [RequestSuccess\\](#requestsuccess-values)) => void \\| null | 否 | null | 网络请求成功回调。 |\n| fail | (option: [RequestFail](#requestfail-values)) => void \\| null | 否 | null | 网络请求失败回调。 |\n| complete | (option: any) => void \\| null | 否 | null | 网络请求完成回调,成功或者失败都会调用。 |\n\n##### RequestSuccess\\ 的属性值 @requestsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | T \\| null | 否 | - | 开发者服务器返回的数据 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n| header | any | 是 | - | 开发者服务器返回的 HTTP Response Header |\n| cookies | Array\\ | 是 | - | 开发者服务器返回的 cookies,格式为字符串数组 |\n\n##### RequestFail 的属性值 @requestfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | 错误码
- 5 接口超时
- 1000 服务端系统错误
- 100001 json数据解析错误
- 100002 错误信息json解析失败
- 600003 网络中断
- 600009 URL格式不合法
- 602001 request系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestTask](#requesttask-values) | \n\n#### RequestTask 的方法 @requesttask-values \n\n#### abort() @abort\n中断网络请求。\n\n\n##### abort 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | x |\n\n\n##### 参见\n[abort](https://uniapp.dcloud.net.cn/api/request/request.html#request)\n","compatibility":"### request 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[request](https://uniapp.dcloud.net.cn/api/request/request.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.request)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request/request.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/request/request\n>Template\n```vue\n\r\n\r\n\n```\n>Script\n```uts\n\r\n const duration = 2000\r\n const methodMap = {\r\n \"GET\": \"/api/http/method/get\",\r\n \"POST\": \"/api/http/method/post\",\r\n \"PUT\": \"/api/http/method/put\",\r\n \"DELETE\": \"/api/http/method/delete\",\r\n \"PATCH\": \"/api/http/method/patch\",\r\n \"OPTIONS\": \"/api/http/method/options\",\r\n \"HEAD\": \"/api/http/method/head\"\r\n }\r\n\r\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'request',\r\n res: '',\r\n task: null as RequestTask | null,\r\n host: \"https://request.dcloud.net.cn\",\r\n url: \"/api/http/method/get\",\r\n method: \"GET\" as RequestMethod | null,\r\n data: null as any | null,\r\n header: null as UTSJSONObject | null,\r\n errorCodeUrls: [\r\n \"/api/http/statusCode/200\",\r\n \"/api/http/statusCode/204\",\r\n \"/api/http/statusCode/301\",\r\n \"/api/http/statusCode/302\",\r\n \"/api/http/statusCode/307\",\r\n \"/api/http/statusCode/400\",\r\n \"/api/http/statusCode/401\",\r\n \"/api/http/statusCode/403\",\r\n \"/api/http/statusCode/404\",\r\n \"/api/http/statusCode/405\",\r\n \"/api/http/statusCode/500\",\r\n \"/api/http/statusCode/502\",\r\n \"/api/http/statusCode/503\",\r\n \"/api/http/statusCode/504\",\r\n ],\r\n headerUrls: [\r\n \"/api/http/header/ua\",\r\n \"/api/http/header/referer\",\r\n \"/api/http/header/requestCookie\",\r\n \"/api/http/header/setCookie\",\r\n \"/api/http/header/deleteCookie\"\r\n ],\r\n contentTypeUrls: [\r\n \"/api/http/contentType/text/plain\",\r\n \"/api/http/contentType/text/html\",\r\n \"/api/http/contentType/text/xml\",\r\n \"/api/http/contentType/image/gif\",\r\n \"/api/http/contentType/image/jpeg\",\r\n \"/api/http/contentType/image/png\",\r\n \"/api/http/contentType/application/json\",\r\n \"/api/http/contentType/application/octetStream\",\r\n ],\r\n postUrls: [\r\n \"/api/http/contentType/json\",\r\n \"/api/http/contentType/xWwwFormUrlencoded\",\r\n ],\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n changeMethod(e : RequestMethod) {\r\n this.method = e;\r\n this.url = methodMap[e] as string;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrl(e : string) {\r\n this.method = \"GET\";\r\n this.url = e;\r\n this.data = null;\r\n this.header = null;\r\n },\r\n changeUrlFromPost(e : string) {\r\n this.method = \"POST\";\r\n this.url = e;\r\n switch (e) {\r\n case \"/api/http/contentType/json\":\r\n this.header = {\r\n \"Content-Type\": \"application/json\"\r\n };\r\n this.data = {\r\n \"hello\": \"world\"\r\n };\r\n break;\r\n case \"/api/http/contentType/xWwwFormUrlencoded\":\r\n this.header = {\r\n \"Content-Type\": \"application/x-www-form-urlencoded\"\r\n };\r\n this.data = \"hello=world\";\r\n break;\r\n }\r\n },\r\n sendRequest() {\r\n uni.showLoading({\r\n title: \"请求中...\"\r\n })\r\n this.task = uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\r\n console.log('request success', JSON.stringify(res.data))\r\n console.log('request success header is :', JSON.stringify(res.header))\r\n uni.showToast({\r\n title: '请求成功',\r\n icon: 'success',\r\n mask: true,\r\n duration: duration\r\n });\r\n this.res = '请求结果 : ' + JSON.stringify(res);\r\n },\r\n fail: (err) => {\r\n console.log('request fail', err);\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n complete: () => {\r\n uni.hideLoading()\r\n },\r\n });\r\n },\r\n //自动化测试例专用\r\n jest_request() {\r\n uni.request({\r\n url: this.host + this.url,\r\n // dataType: \"json\",\r\n // responseType: \"json\",\r\n method: this.method,\r\n data: this.data,\r\n header: this.header,\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: this.host + \"/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_request(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_request(needCookie : boolean) {\r\n uni.request({\r\n url: this.host + \"/api/http/header/requestCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: (res) => {\r\n const requestCookie = (res.data as UTSJSONObject).getJSON(\"data\")?.getAny(\"requestCookie\")\r\n console.log(\"requestCookie \", requestCookie);\r\n if (requestCookie instanceof Array) {\r\n this.jest_result = needCookie ? requestCookie.length > 0 : requestCookie.length == 0\r\n } else {\r\n this.jest_result = needCookie ? (requestCookie as UTSJSONObject).toMap().size > 0 : (requestCookie as UTSJSONObject).toMap().size == 0\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"uploadFile":{"name":"## uni.uploadFile(options) @uploadfile","description":"将本地资源上传到开发者服务器。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UploadFileOptions](#uploadfileoptions-values) | 是 | - | - |\n#### UploadFileOptions 的属性值 @uploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器 url |\n| filePath | string \\| null | 否 | null | 要上传文件资源的路径 |\n| name | string \\| null | 否 | null | 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容 |\n| files | Array\\<[UploadFileOptionFiles](#uploadfileoptionfiles-values)\\> \\| null | 否 | null | 需要上传的文件列表。 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | HTTP 请求 Header, header 中不能设置 Referer |\n| formData | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | HTTP 请求中其他额外的 form data |\n| timeout | number \\| null | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [UploadFileSuccess](#uploadfilesuccess-values)) => void \\| null | 否 | null | 成功返回的回调函数 |\n| fail | (result: [UploadFileFail](#uploadfilefail-values)) => void \\| null | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### UploadFileOptionFiles 的属性值 @uploadfileoptionfiles-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string \\| null | 否 | \"file\" | multipart 提交时,表单的项目名,默认为 file,如果 name 不填或填的值相同,可能导致服务端读取文件时只能读取到一个文件。 |\n| uri | string | 是 | - | 要上传文件资源的路径 |\n\n##### UploadFileSuccess 的属性值 @uploadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | string | 是 | - | 开发者服务器返回的数据 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### UploadFileFail 的属性值 @uploadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | 错误码
- 5 接口超时
- 1000 服务端系统错误
- 100001 json数据解析错误
- 100002 错误信息json解析失败
- 600003 网络中断
- 600009 URL格式不合法
- 602001 request系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UploadTask](#uploadtask-values) | \n\n#### UploadTask 的方法 @uploadtask-values \n\n#### abort() @abort\n中断上传任务。\n\n\n##### abort 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | x |\n\n\n##### 参见\n[abort](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监听上传进度变化。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnProgressUpdateResult](#onprogressupdateresult-values)) => void | 是 | - | - |\n###### OnProgressUpdateResult 的属性值 @onprogressupdateresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 上传进度百分比 |\n| totalBytesSent | number | 是 | - | 已经上传的数据长度,单位 Bytes |\n| totalBytesExpectedToSend | number | 是 | - | 预期需要上传的数据总长度,单位 Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | - |\n\n\n##### 参见\n[onProgressUpdate](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n","compatibility":"### uploadFile 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[uploadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#uploadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.upload-file)\n"},"upload-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/upload-file/upload-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/upload-file/upload-file\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'uploadFile',\r\n imageSrc: '',\r\n task: null as UploadTask | null,\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n chooseImage: function () {\r\n uni.chooseImage({\r\n count: 1,\r\n sizeType: ['compressed'],\r\n sourceType: ['album'],\r\n success: (res) => {\r\n console.log('chooseImage success, temp path is', res.tempFilePaths[0])\r\n var imageSrc = res.tempFilePaths[0]\r\n uni.showLoading({\r\n title: '上传中'\r\n })\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,非真实的接口地址\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: (res) => {\r\n console.log('uploadImage success, res is:', res)\r\n uni.hideLoading();\r\n uni.showToast({\r\n title: '上传成功',\r\n icon: 'success',\r\n duration: 1000\r\n })\r\n this.imageSrc = imageSrc\r\n },\r\n fail: (err) => {\r\n console.log('uploadImage fail', err);\r\n uni.hideLoading();\r\n uni.showModal({\r\n content: err.errMsg,\r\n showCancel: false\r\n });\r\n },\r\n });\r\n },\r\n fail: (err) => {\r\n console.log('chooseImage fail', err)\r\n }\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_uploadFile() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload', //仅为示例,非真实的接口地址\r\n filePath: imageSrc,\r\n name: 'file',\r\n formData: {\r\n 'user': 'test'\r\n },\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_set_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(true)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n\r\n jest_delete_cookie() {\r\n uni.request({\r\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\r\n method: \"GET\",\r\n timeout: 6000,\r\n sslVerify: false,\r\n withCredentials: false,\r\n firstIpv4: false,\r\n success: () => {\r\n this.jest_cookie_upload(false)\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n });\r\n },\r\n jest_cookie_upload(needCookie : boolean) {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://request.dcloud.net.cn/api/http/header/upload',\r\n filePath: imageSrc,\r\n name: 'file',\r\n success: (res : UploadFileSuccess) => {\r\n const data = JSON.parseObject(res.data)\r\n const errCode = data?.getNumber(\"errCode\")\r\n if (errCode != null && errCode == 1000) {\r\n this.jest_result = needCookie ? false : true;\r\n } else {\r\n this.jest_result = needCookie ? true : false;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n },\r\n jest_files_upload() {\r\n const imageSrc = \"/static/uni.png\";\r\n this.task = uni.uploadFile({\r\n url: 'https://unidemo.dcloud.net.cn/upload',\r\n files: [\r\n {\r\n name: \"file1\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles,\r\n {\r\n name: \"file2\",\r\n uri: imageSrc\r\n } as UploadFileOptionFiles\r\n ],\r\n success: (res : UploadFileSuccess) => {\r\n if (res.statusCode == 200) {\r\n this.jest_result = true;\r\n }\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n },\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"downloadFile":{"name":"## uni.downloadFile(options) @downloadfile","description":"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [DownloadFileOptions](#downloadfileoptions-values) | 是 | - | - |\n#### DownloadFileOptions 的属性值 @downloadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 下载资源的 url |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | HTTP 请求 Header,header 中不能设置 Referer |\n| filePath | string \\| null | 否 | null | 指定文件下载路径
支持相对路径与绝对路径,例:
`/imgs/pic.png`、`/storage/emulated/0/Android/data/io.dcloud.HBuilder/apps/HBuilder/temp/imgs/pic.png`
并且支持指定下载目录,例:
`/imgs/` |\n| timeout | number \\| null | 否 | 120000 | 超时时间,单位 ms |\n| success | (result: [DownloadFileSuccess](#downloadfilesuccess-values)) => void \\| null | 否 | null | 下载成功后以 tempFilePath 的形式传给页面,res = {tempFilePath: '文件的临时路径'} |\n| fail | (result: [DownloadFileFail](#downloadfilefail-values)) => void \\| null | 否 | null | 失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 结束的回调函数(调用成功、失败都会执行) |\n\n##### DownloadFileSuccess 的属性值 @downloadfilesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFilePath | string | 是 | - | 临时文件路径,下载后的文件会存储到一个临时文件 |\n| statusCode | number | 是 | - | 开发者服务器返回的 HTTP 状态码 |\n\n##### DownloadFileFail 的属性值 @downloadfilefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 5 \\| 1000 \\| 100001 \\| 100002 \\| 600003 \\| 600009 \\| 602001 | 是 | - | 错误码
- 5 接口超时
- 1000 服务端系统错误
- 100001 json数据解析错误
- 100002 错误信息json解析失败
- 600003 网络中断
- 600009 URL格式不合法
- 602001 request系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [DownloadTask](#downloadtask-values) | \n\n#### DownloadTask 的方法 @downloadtask-values \n\n#### abort() @abort\n中断下载任务。\n\n\n##### abort 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | x |\n\n\n##### 参见\n[abort](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n#### onProgressUpdate(callback) @onprogressupdate\n监听下载进度变化。\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnProgressDownloadResult](#onprogressdownloadresult-values)) => void | 是 | - | - |\n###### OnProgressDownloadResult 的属性值 @onprogressdownloadresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | number | 是 | - | 下载进度百分比 |\n| totalBytesWritten | number | 是 | - | 已经下载的数据长度,单位 Bytes |\n| totalBytesExpectedToWrite | number | 是 | - | 预期需要下载的数据总长度,单位 Bytes |\n\n\n##### onProgressUpdate 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | - |\n\n\n##### 参见\n[onProgressUpdate](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n","compatibility":"### downloadFile 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[downloadFile](https://uniapp.dcloud.net.cn/api/request/network-file.html#downloadfile)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.download-file)\n"},"download-file":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/download-file/download-file.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/download-file/download-file\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'downloadFile',\r\n imageSrc: '',\r\n task: null as DownloadTask | null,\r\n //自动化测试例专用\r\n jest_result: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n // this.imageSrc = '';\r\n uni.hideLoading();\r\n this.task?.abort();\r\n },\r\n methods: {\r\n downloadImage: function () {\r\n uni.showLoading({\r\n title: '下载中'\r\n })\r\n var self = this\r\n this.task = uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: (res) => {\r\n console.log('downloadFile success, res is', res.tempFilePath)\r\n self.imageSrc = res.tempFilePath;\r\n uni.hideLoading();\r\n },\r\n fail: (err) => {\r\n console.log('downloadFile fail, err is:', err)\r\n uni.hideLoading();\r\n }\r\n });\r\n this.task?.onProgressUpdate((update) => {\r\n console.log(\"progress : \", update.progress);\r\n })\r\n },\r\n //自动化测试例专用\r\n jest_downloadFile() {\r\n uni.downloadFile({\r\n url: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png\",\r\n success: () => {\r\n this.jest_result = true\r\n },\r\n fail: () => {\r\n this.jest_result = false\r\n }\r\n });\r\n },\n\n jest_set_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/setCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(true)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n\n jest_delete_cookie(){\n uni.request({\n url: \"https://request.dcloud.net.cn/api/http/header/deleteCookie\",\n method: \"GET\",\n timeout: 6000,\n sslVerify: false,\n withCredentials: true,\n firstIpv4: false,\n success: () => {\n this.jest_cookie_download(false)\n },\n fail: () => {\n this.jest_result = false;\n },\n });\n },\n jest_cookie_download(needCookie: boolean){\n uni.downloadFile({\n url: \"https://request.dcloud.net.cn/api/http/header/download\",\n success: () => {\n this.jest_result = needCookie ? true : false;\n },\n fail: () => {\n this.jest_result = needCookie ? false : true;\n }\n });\n }\r\n }\r\n }\r\n\n```\n\n:::"},"getNetworkType":{"name":"## uni.getNetworkType(options) @getnetworktype","description":"获取网络类型","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetNetworkTypeOptions](#getnetworktypeoptions-values) | 是 | - | - |\n#### GetNetworkTypeOptions 的属性值 @getnetworktypeoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetNetworkTypeSuccess](#getnetworktypesuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetNetworkTypeSuccess 的属性值 @getnetworktypesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| networkType | string | 是 | - | 网络类型 |\n","returnValue":"","compatibility":"### getNetworkType 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getNetworkType](http://uniapp.dcloud.io/api/system/network?id=getnetworktype)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.get-network-type)\n"},"get-network-type":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-network-type/get-network-type.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-network-type/get-network-type\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'getNetworkType',\r\n hasNetworkType: false,\r\n networkType: '',\r\n connectedWifi: '',\r\n //自动化测试例专用\r\n jest_result: false,\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload: function () {\r\n this.networkType = '';\r\n this.hasNetworkType = false;\r\n },\r\n methods: {\r\n getNetworkType: function () {\r\n uni.getNetworkType({\r\n success: (res) => {\r\n console.log(res)\r\n this.hasNetworkType = true;\r\n this.networkType = res.networkType\r\n },\r\n fail: () => {\r\n uni.showModal({\r\n content: '获取失败!',\r\n showCancel: false\r\n })\r\n }\r\n })\r\n },\r\n clear: function () {\r\n this.hasNetworkType = false;\r\n this.networkType = '';\r\n this.connectedWifi = '';\r\n },\r\n //自动化测试例专用\r\n jest_getNetworkType() {\r\n uni.getNetworkType({\r\n success: () => {\r\n this.jest_result = true;\r\n },\r\n fail: () => {\r\n this.jest_result = false;\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"connectSocket":{"name":"## connectSocket(options) @connectsocket","description":"创建一个 WebSocket 连接。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ConnectSocketOptions](#connectsocketoptions-values) | 是 | - | - |\n#### ConnectSocketOptions 的属性值 @connectsocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 开发者服务器接口地址,必须是 wss 协议,且域名必须是后台配置的合法域名 |\n| header | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) \\| null | 否 | null | 如果属性名存在,且类型为UTSJSONObject返回对应的结果,不存在返回null |\n| protocols | Array\\ \\| null | 否 | null | 子协议数组 |\n| success | (result: [ConnectSocketSuccess](#connectsocketsuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [ConnectSocketFail](#connectsocketfail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ConnectSocketSuccess 的属性值 @connectsocketsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n##### ConnectSocketFail 的属性值 @connectsocketfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 错误码 - 600009 URL格式不合法 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [SocketTask](#sockettask-values) | \n\n#### SocketTask 的方法 @sockettask-values \n\n#### send(options) @send\n通过 WebSocket 连接发送数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - |\n###### SendSocketMessageOptions 的属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | 错误码
- 10001 发送数据超限,发送队列不能超过16M大小。
- 10002 websocket未连接
- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n##### send 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[send](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-send)\n\n#### close(options) @close\n关闭 WebSocket 连接\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CloseSocketOptions](#closesocketoptions-values) | 是 | - | - |\n###### CloseSocketOptions 的属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number \\| null | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string \\| null | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n##### close 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[close](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-close)\n\n#### onOpen(callback) @onopen\n监听 WebSocket 连接打开事件\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - |\n###### OnSocketOpenCallbackResult 的属性值 @onsocketopencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| header | any | 是 | - | 连接成功的 HTTP 响应 Header |\n\n\n##### onOpen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onOpen](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onopen)\n\n#### onClose(callback) @onclose\n监听 WebSocket 连接关闭事件\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n##### onClose 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onClose](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onclose)\n\n#### onError(callback) @onerror\n监听 WebSocket 错误\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void | 是 | - | - |\n\n##### onError 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onError](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onerror)\n\n#### onMessage(callback) @onmessage\n监听 WebSocket 接受到服务器的消息事件\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - |\n###### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n\n\n##### onMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n\n\n##### 参见\n[onMessage](https://uniapp.dcloud.net.cn/api/request/socket-task.html#sockettask-onmessage)\n","compatibility":"### connectSocket 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[connectSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#connectsocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.connectSocket)\n"},"onSocketOpen":{"name":"## onSocketOpen(options) @onsocketopen","description":"监听WebSocket连接打开事件。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | (result: [OnSocketOpenCallbackResult](#onsocketopencallbackresult-values)) => void | 是 | - | - |","returnValue":"","compatibility":"### onSocketOpen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketOpen](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketopen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketOpen)\n"},"onSocketError":{"name":"## onSocketError(callback) @onsocketerror","description":"下载文件资源到本地,客户端直接发起一个 HTTP GET 请求,返回文件的本地临时路径。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketErrorCallbackResult](#onsocketerrorcallbackresult-values)) => void | 是 | - | - |\n#### OnSocketErrorCallbackResult 的属性值 @onsocketerrorcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n","returnValue":"","compatibility":"### onSocketError 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketError](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketerror)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketError)\n"},"sendSocketMessage":{"name":"## sendSocketMessage(options) @sendsocketmessage","description":"通过 WebSocket 连接发送数据,需要先 uni.connectSocket,并在 uni.onSocketOpen 回调之后才能发送。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SendSocketMessageOptions](#sendsocketmessageoptions-values) | 是 | - | - |\n#### SendSocketMessageOptions 的属性值 @sendsocketmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 需要发送的内容 |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [SendSocketMessageFail](#sendsocketmessagefail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### SendSocketMessageFail 的属性值 @sendsocketmessagefail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 10001 \\| 10002 \\| 602001 | 是 | - | 错误码
- 10001 发送数据超限,发送队列不能超过16M大小。
- 10002 websocket未连接
- 602001 websocket系统错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### sendSocketMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[sendSocketMessage](https://uniapp.dcloud.net.cn/api/request/websocket.html#sendsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.sendSocketMessage)\n"},"onSocketMessage":{"name":"## onSocketMessage(callback) @onsocketmessage","description":"监听WebSocket接受到服务器的消息事件。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketMessageCallbackResult](#onsocketmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketMessageCallbackResult 的属性值 @onsocketmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | 服务器返回的消息 |\n","returnValue":"","compatibility":"### onSocketMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketMessage](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketMessage)\n"},"closeSocket":{"name":"## closeSocket(options) @closesocket","description":"关闭 WebSocket 连接。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CloseSocketOptions](#closesocketoptions-values) | 是 | - | - |\n#### CloseSocketOptions 的属性值 @closesocketoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number \\| null | 否 | 1000 | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。如果这个参数没有被指定,默认的取值是1000 (表示正常连接关闭) |\n| reason | string \\| null | 否 | \"\" | 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于123字节的UTF-8 文本(不是字符) |\n| success | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: [GeneralCallbackResult](#generalcallbackresult-values)) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n","returnValue":"","compatibility":"### closeSocket 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[closeSocket](https://uniapp.dcloud.net.cn/api/request/websocket.html#closesocket)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.closeSocket)\n"},"onSocketClose":{"name":"## onSocketClose(callback) @onsocketclose","description":"监听WebSocket关闭。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnSocketCloseCallbackResult](#onsocketclosecallbackresult-values)) => void | 是 | - | - |\n#### OnSocketCloseCallbackResult 的属性值 @onsocketclosecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| code | number | 是 | - | 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。\t |\n| reason | string | 是 | - | 一个可读的字符串,表示连接被关闭的原因。\t |\n","returnValue":"","compatibility":"### onSocketClose 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[onSocketClose](https://uniapp.dcloud.net.cn/api/request/websocket.html#onsocketclose)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.network.websocket-global.onSocketClose)\n"},"websocket-global":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/websocket-global/websocket-global.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/websocket-global/websocket-global\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n connected: false,\r\n connecting: false,\r\n msg: '',\r\n roomId: '',\r\n platform: '',\r\n }\r\n },\r\n computed: {\r\n showMsg() : string {\r\n if (this.connected) {\r\n if (this.msg.length > 0) {\r\n return '收到消息:' + this.msg\r\n } else {\r\n return '等待接收消息'\r\n }\r\n } else {\r\n return '尚未连接'\r\n }\r\n },\r\n },\r\n onLoad() {\r\n this.platform = uni.getSystemInfoSync().platform\r\n },\r\n onUnload() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n uni.hideLoading()\r\n },\r\n methods: {\r\n connect() {\r\n if (this.connected || this.connecting) {\r\n uni.showModal({\r\n content: '正在连接或者已经连接,请勿重复连接',\r\n showCancel: false,\r\n })\r\n return\r\n }\r\n this.connecting = true\r\n uni.showLoading({\r\n title: '连接中...',\r\n })\r\n uni.connectSocket({\r\n url: 'ws://websocket.dcloud.net.cn',\r\n header: null,\r\n protocols: null,\r\n success: (res : any) => {\r\n // 这里是接口调用成功的回调,不是连接成功的回调,请注意\r\n console.log('uni.connectSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n // 这里是接口调用失败的回调,不是连接失败的回调,请注意\r\n console.log('uni.connectSocket fail', err)\r\n },\r\n })\r\n uni.onSocketOpen((res) => {\r\n this.connecting = false\r\n this.connected = true\r\n uni.hideLoading()\r\n\r\n uni.showToast({\r\n icon: 'none',\r\n title: '连接成功',\r\n })\r\n console.log('onOpen', res)\r\n })\r\n uni.onSocketError((err) => {\r\n this.connecting = false\r\n this.connected = false\r\n uni.hideLoading()\r\n\r\n uni.showModal({\r\n content: '连接失败,可能是websocket服务不可用,请稍后再试',\r\n showCancel: false,\r\n })\r\n console.log('onError', err)\r\n })\r\n uni.onSocketMessage((res) => {\r\n this.msg = res.data as string\r\n console.log('onMessage', res)\r\n })\r\n uni.onSocketClose((res) => {\r\n this.connected = false\r\n this.msg = ''\r\n console.log('onClose', res)\r\n })\r\n },\r\n send() {\r\n uni.sendSocketMessage({\r\n data:\r\n 'from ' +\r\n this.platform +\r\n ' : ' +\r\n parseInt((Math.random() * 10000).toString()).toString(),\r\n success: (res : any) => {\r\n console.log(res)\r\n },\r\n fail: (err : any) => {\r\n console.log(err)\r\n },\r\n } as SendSocketMessageOptions)\r\n },\r\n close() {\r\n uni.closeSocket({\r\n code: 1000,\r\n reason: 'close reason from client',\r\n success: (res : any) => {\r\n console.log('uni.closeSocket success', res)\r\n },\r\n fail: (err : any) => {\r\n console.log('uni.closeSocket fail', err)\r\n },\r\n } as CloseSocketOptions)\r\n },\r\n },\r\n }\r\n\n```\n\n:::"},"getSystemInfo":{"name":"## uni.getSystemInfo(options) @getsysteminfo","description":"异步获取系统信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetSystemInfoOptions](#getsysteminfooptions-values) | 是 | - | - |\n#### GetSystemInfoOptions 的属性值 @getsysteminfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetSystemInfoResult](#getsysteminforesult-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetSystemInfoResult 的属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 是 | - | `manifest.json` 中应用版本名号。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"undefined\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | 设备类型。 |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | 设备方向。 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 系统名称\t |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| osTheme | \"light\" \\| \"dark\" | 否 | - | 操作系统主题
|\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| ~~uniCompileVersion~~ | string | 是 | - | uni 编译器版本\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | uni-app 运行平台。 |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| ~~uniCompileVersionCode~~ | number | 是 | - | uni 编译器版本号\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| ~~version~~ | string | 是 | - | 引擎版本号。已废弃,仅为了向下兼容保留 \n已废弃,仅为了向下兼容保留 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| osAndroidAPILevel | number \\| null | 否 | - | Android 系统API库的版本。
|\n\n###### SafeArea 的属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n###### SafeAreaInsets 的属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n###### GetSystemInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| osTheme | √ | x | - |\n| osAndroidAPILevel | √ | x | - |\n","returnValue":"","compatibility":"### getSystemInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getSystemInfo](http://uniapp.dcloud.io/api/system/info?id=getsysteminfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfo)\n"},"getSystemInfoSync":{"name":"## uni.getSystemInfoSync() @getsysteminfosync","description":"同步获取系统信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetSystemInfoResult](#getsysteminforesult-values) | \n\n#### GetSystemInfoResult 的属性值 @getsysteminforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SDKVersion | string | 是 | - | 客户端基础库版本 |\n| appId | string | 是 | - | `manifest.json` 中应用appid。 |\n| appLanguage | string | 是 | - | 应用设置的语言。 |\n| appName | string | 是 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 是 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 是 | - | `manifest.json` 中应用版本名号。 |\n| brand | string | 是 | - | 手机品牌。 |\n| browserName | string | 是 | - | 浏览器名称。`App` 端是系统 webview 的名字,比如 wkwebview、chrome。小程序端为空 |\n| browserVersion | string | 是 | - | 浏览器版本、webview 版本。 |\n| deviceId | string | 是 | - | 设备 ID |\n| deviceBrand | string | 是 | - | 设备品牌。如:`apple`、`huawei`。 |\n| deviceModel | string | 是 | - | 设备型号 |\n| deviceType | \"phone\" \\| \"pad\" \\| \"tv\" \\| \"watch\" \\| \"pc\" \\| \"null\" \\| \"car\" \\| \"vr\" \\| \"appliance\" | 是 | - | 设备类型。 |\n| devicePixelRatio | number | 是 | - | 设备像素比 |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | 设备方向。 |\n| language | string | 是 | - | 程序设置的语言 |\n| model | string | 是 | - | 手机型号 |\n| osName | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 系统名称\t |\n| osVersion | string | 是 | - | 操作系统版本。如 ios 版本,andriod 版本 |\n| osLanguage | string | 是 | - | 操作系统语言 |\n| osTheme | \"light\" \\| \"dark\" | 否 | - | 操作系统主题
|\n| pixelRatio | number | 是 | - | 设备像素比 |\n| platform | \"ios\" \\| \"android\" \\| \"mac\" \\| \"windows\" \\| \"linux\" | 是 | - | 客户端平台 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| system | string | 是 | - | 操作系统版本 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| ua | string | 是 | - | 用户标识。小程序端为空 |\n| ~~uniCompileVersion~~ | string | 是 | - | uni 编译器版本\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersion | string | 是 | - | uni 编译器版本 |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 是 | - | uni-app 运行平台。 |\n| uniRuntimeVersion | string | 是 | - | uni 运行时版本 |\n| ~~uniCompileVersionCode~~ | number | 是 | - | uni 编译器版本号\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersionCode | number | 是 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 是 | - | uni 运行时版本号 |\n| ~~version~~ | string | 是 | - | 引擎版本号。已废弃,仅为了向下兼容保留 \n已废弃,仅为了向下兼容保留 |\n| romName | string | 是 | - | rom 名称。Android 部分机型获取不到值。iOS 恒为 `ios` |\n| romVersion | string | 是 | - | rom 版本号。Android 部分机型获取不到值。iOS 恒为 `ios 版本号` |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| osAndroidAPILevel | number \\| null | 否 | - | Android 系统API库的版本。
|\n\n##### SafeArea 的属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 的属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n\n##### GetSystemInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| osTheme | √ | x | - |\n| osAndroidAPILevel | √ | x | - |\n","compatibility":"### getSystemInfoSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getSystemInfoSync](http://uniapp.dcloud.io/api/system/info?id=getsysteminfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-info.getSystemInfoSync)\n"},"get-system-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-info/get-system-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-system-info/get-system-info\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getSystemInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getSystemInfo: function () {\r\n uni.getSystemInfo({\r\n success: (res) => {\r\n this.items = [] as Item[];\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n },\r\n })\r\n },\r\n getSystemInfoSync: function () {\r\n this.items = [] as Item[];\r\n const res = uni.getSystemInfoSync()\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n },\r\n //自动化测试例专用\r\n jest_getSystemInfo() : GetSystemInfoResult {\r\n return uni.getSystemInfoSync();\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"getDeviceInfo":{"name":"## uni.getDeviceInfo(options?) @getdeviceinfo","description":"获取设备信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetDeviceInfoOptions](#getdeviceinfooptions-values) | 否 | 包含所有字段的过滤对象 | [options=包含所有字段的过滤对象\\] 过滤的字段对象, 不传参数默认为获取全部字段。 |\n#### GetDeviceInfoOptions 的属性值 @getdeviceinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filter | Array\\ | 是 | - | 过滤字段的字符串数组,假如要获取指定字段,传入此数组。 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetDeviceInfoResult](#getdeviceinforesult-values) | \n\n#### GetDeviceInfoResult 的属性值 @getdeviceinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| brand | string | 否 | - | 设备品牌 |\n| deviceBrand | string | 否 | - | 设备品牌 |\n| deviceId | string | 否 | - | 设备 id 。由 uni-app 框架生成并存储,清空 Storage 会导致改变 |\n| model | string | 否 | - | 设备型号\t |\n| deviceModel | string | 否 | - | 设备型号\t |\n| deviceType | string | 否 | - | 设备类型phone、pad、pc\t |\n| deviceOrientation | string | 否 | - | 设备方向 竖屏 portrait、横屏 landscape\t |\n| devicePixelRatio | string | 否 | - | 设备像素比\t |\n| system | string | 否 | - | 操作系统及版本\t |\n| platform | string | 否 | - | 客户端平台\t |\n| isRoot | boolean | 否 | - | 是否root |\n| isSimulator | boolean | 否 | - | 是否是模拟器 |\n| isUSBDebugging | boolean | 否 | - | adb是否开启 |\n\n##### GetDeviceInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| isUSBDebugging | √ | x | - |\n","compatibility":"### getDeviceInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getDeviceInfo](https://uniapp.dcloud.net.cn/api/system/getDeviceInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-device-info)\n"},"get-device-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-device-info/get-device-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-device-info/get-device-info\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { setDevicePixelRatio } from '@/store/index.uts'\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getDeviceInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\r\n methods: {\r\n getDeviceInfo: function () {\r\n const res = uni.getDeviceInfo();\r\n // 获取像素比, 供截图对比使用\r\n setDevicePixelRatio(res.devicePixelRatio !== null ? parseFloat(res.devicePixelRatio!) : 1)\r\n this.items = [] as Item[];\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"getWindowInfo":{"name":"## uni.getWindowInfo() @getwindowinfo","description":"同步获取窗口信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetWindowInfoResult](#getwindowinforesult-values) | \n\n#### GetWindowInfoResult 的属性值 @getwindowinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| pixelRatio | number | 是 | - | 设备像素比 |\n| screenWidth | number | 是 | - | 屏幕宽度 |\n| screenHeight | number | 是 | - | 屏幕高度 |\n| windowWidth | number | 是 | - | 可使用窗口宽度 |\n| windowHeight | number | 是 | - | 可使用窗口高度 |\n| statusBarHeight | number | 是 | - | 状态栏的高度 |\n| windowTop | number | 是 | - | 可使用窗口的顶部位置 |\n| windowBottom | number | 是 | - | 可使用窗口的底部位置 |\n| safeArea | [SafeArea](#safearea-values) | 是 | - | 在竖屏正方向下的安全区域 |\n| safeAreaInsets | [SafeAreaInsets](#safeareainsets-values) | 是 | - | 在竖屏正方向下的安全区域插入位置 |\n| screenTop | number | 是 | - | 窗口上边缘的 y 值 |\n\n##### SafeArea 的属性值 @safearea-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左上角横坐标 |\n| right | number | 是 | - | 安全区域右下角横坐标 |\n| top | number | 是 | - | 安全区域左上角纵坐标 |\n| bottom | number | 是 | - | 安全区域右下角纵坐标 |\n| width | number | 是 | - | 安全区域的宽度,单位逻辑像素 |\n| height | number | 是 | - | 安全区域的高度,单位逻辑像素 |\n\n##### SafeAreaInsets 的属性值 @safeareainsets-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| left | number | 是 | - | 安全区域左侧插入位置 |\n| right | number | 是 | - | 安全区域右侧插入位置 |\n| top | number | 是 | - | 安全区顶部插入位置 |\n| bottom | number | 是 | - | 安全区域底部插入位置 |\n","compatibility":"### getWindowInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getWindowInfo](http://uniapp.dcloud.io/api/system/getWindowInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-window-info)\n"},"get-window-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-window-info/get-window-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-window-info/get-window-info\n>Template\n```vue\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n import { setStatusBarHeight } from '@/store/index.uts'\r\n\r\n type Item = {\r\n label : string,\r\n value : string,\r\n }\r\n export default {\r\n data() {\r\n return {\r\n title: 'getWindowInfo',\r\n items: [] as Item[],\r\n }\r\n },\r\n onUnload: function () {\r\n },\n onReady() {\n this.getWindowInfo()\n },\r\n methods: {\r\n getWindowInfo: function () {\r\n const res = uni.getWindowInfo();\r\n // 获取状态栏+导航栏高度, 供截图对比使用\r\n setStatusBarHeight(res.statusBarHeight);\r\n this.items = [] as Item[];\r\n for (const key in res) {\r\n const value = res[key];\r\n if (value != null) {\r\n const item = {\r\n label: key,\r\n value: \"\" + ((typeof value == \"object\") ? JSON.stringify(value) : value)\r\n } as Item;\r\n this.items.push(item);\r\n }\r\n }\r\n },\r\n //自动化测试例专用\r\n jest_getWindowInfo() : GetWindowInfoResult {\r\n return uni.getWindowInfo();\r\n },\r\n }\r\n }\r\n\n```\n\n:::"},"getAppBaseInfo":{"name":"## uni.getAppBaseInfo(options?) @getappbaseinfo","description":"获取app基本信息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetAppBaseInfoOptions](#getappbaseinfooptions-values) | 否 | 包含所有字段的过滤对象 | [options=包含所有字段的过滤对象\\] 过滤的字段对象, 不传参数默认为获取全部字段。 |\n#### GetAppBaseInfoOptions 的属性值 @getappbaseinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filter | Array\\ | 是 | - | 过滤字段的字符串数组,假如要获取指定字段,传入此数组。 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetAppBaseInfoResult](#getappbaseinforesult-values) | \n\n#### GetAppBaseInfoResult 的属性值 @getappbaseinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| appId | string | 否 | - | manifest.json 中应用appid,即DCloud appid。\t |\n| appName | string | 否 | - | `manifest.json` 中应用名称。 |\n| appVersion | string | 否 | - | `manifest.json` 中应用版本名称。 |\n| appVersionCode | string | 否 | - | `manifest.json` 中应用版本名号。 |\n| appLanguage | string | 否 | - | 应用设置的语言en、zh-Hans、zh-Hant、fr、es\t |\n| language | string | 否 | - | 应用设置的语言\t |\n| ~~version~~ | string | 否 | - | 引擎版本号。已废弃,仅为了向下兼容保留\n已废弃,仅为了向下兼容保留 |\n| isUniAppX | boolean | 否 | - | 是否uni-app x |\n| ~~uniCompileVersion~~ | string | 否 | - | uni 编译器版本\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersion | string | 否 | - | uni 编译器版本 |\n| uniPlatform | \"app\" \\| \"web\" \\| \"mp-weixin\" \\| \"mp-alipay\" \\| \"mp-baidu\" \\| \"mp-toutiao\" \\| \"mp-lark\" \\| \"mp-qq\" \\| \"mp-kuaishou\" \\| \"mp-jd\" \\| \"mp-360\" \\| \"quickapp-webview\" \\| \"quickapp-webview-union\" \\| \"quickapp-webview-huawei\" | 否 | - | uni-app 运行平台。 |\n| uniRuntimeVersion | string | 否 | - | uni 运行时版本 |\n| ~~uniCompileVersionCode~~ | number | 否 | - | uni 编译器版本号\n已废弃,仅为了向下兼容保留 |\n| uniCompilerVersionCode | number | 否 | - | uni 编译器版本号 |\n| uniRuntimeVersionCode | number | 否 | - | uni 运行时版本号 |\n| packageName | string | 否 | - | Android的包名 |\n| signature | string | 否 | - | Android: 应用签名证书的SHA1值(全部为小写,中间不包含“:”)。 为了保证应用的安全性,请使用自己生成的证书(不要使用公共测试证书)。 iOS: 应用签名证书中绑定的Bundle ID(AppleID)的md5值(全部为小写)。 |\n\n##### GetAppBaseInfoResult 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| uniCompilerVersion | 4.0 | x | - |\n| uniCompilerVersionCode | 4.0 | x | - |\n| packageName | 3.97 | x | - |\n| signature | 3.97 | x | - |\n","compatibility":"### getAppBaseInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","tutorial":"\n### 参见\n[getAppBaseInfo](https://uniapp.dcloud.net.cn/api/system/getAppBaseInfo.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-base-info)\n"},"get-app-base-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-base-info/get-app-base-info.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-app-base-info/get-app-base-info\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\n\ttype Item = {\n\t\tlabel : string,\n\t\tvalue : string,\n\t}\n\texport default {\r\n\t\tdata() {\r\n\t\t\treturn {\r\n\t\t\t\ttitle: 'getAppBaseInfo',\n\t\t\t\titems: [] as Item[],\r\n\t\t\t}\r\n\t\t},\r\n\t\tonUnload:function(){\r\n\t\t},\r\n\t\tmethods: {\r\n\t\t\tgetAppBaseInfo: function () {\n\t\t\t\tconst res = uni.getAppBaseInfo();\n this.items = [] as Item[];\n for(const key in res){\n const value = res[key];\n if(value != null){\n const item = {\n \tlabel: key,\n \tvalue: \"\" + ((typeof value == \"object\")? JSON.stringify(value) : value)\n } as Item;\n this.items.push(item);\n }\n }\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\n```\n\n:::"},"getAppAuthorizeSetting":{"name":"## uni.getAppAuthorizeSetting() @getappauthorizesetting","description":"获取 APP 授权设置。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetAppAuthorizeSettingResult](#getappauthorizesettingresult-values) | \n\n#### GetAppAuthorizeSettingResult 的属性值 @getappauthorizesettingresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| cameraAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 使用摄像头的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台:表示没有配置 `android.permission.CAMERA` 权限,[权限配置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions);iOS平台没有该值 |\n| locationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 使用定位的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台:表示没有配置 `android.permission.ACCESS_COARSE_LOCATION` 权限,[权限配置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions);iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `Geolocation(定位)` 模块 |\n| locationAccuracy | \"reduced\" \\| \"full\" \\| \"unsupported\" | 否 | - | 定位准确度。
- reduced: 模糊定位
- full: 精准定位
- unsupported: 不支持(包括用户拒绝定位权限和没有在 `manifest.json -> App模块配置` 中配置 `Geolocation(定位)` 模块) |\n| microphoneAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 使用麦克风的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台:表示没有配置 `android.permission.RECORD_AUDIO` 权限,[权限配置详情](https://uniapp.dcloud.net.cn/tutorial/app-nativeresource-android.html#permissions);iOS平台没有该值 |\n| notificationAuthorized | \"authorized\" \\| \"denied\" \\| \"not determined\" \\| \"config error\" | 是 | - | 允许 App 通知的开关
- authorized: 已经获得授权,无需再次请求授权
- denied: 请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限)
- not determined: 尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
- config error: Android平台没有该值;iOS平台:表示没有在 `manifest.json -> App模块配置` 中配置 `Push(推送)` 模块 |\n","compatibility":"### getAppAuthorizeSetting 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | - |\n","tutorial":"\n### 参见\n[getAppAuthorizeSetting](http://uniapp.dcloud.io/api/system/getappauthorizesetting)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-app-authorize-setting)\n"},"get-app-authorize-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-app-authorize-setting/get-app-authorize-setting.uvue) \n ```vue\n\r\n\r\n\r\n\n\n```"},"getSystemSetting":{"name":"## uni.getSystemSetting() @getsystemsetting","description":"获取系统设置","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetSystemSettingResult](#getsystemsettingresult-values) | \n\n#### GetSystemSettingResult 的属性值 @getsystemsettingresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| bluetoothEnabled | boolean | 否 | - | 蓝牙是否开启 |\n| bluetoothError | string | 否 | - | 蓝牙的报错信息 |\n| locationEnabled | boolean | 是 | - | 位置是否开启 |\n| wifiEnabled | boolean | 否 | - | wifi是否开启 |\n| wifiError | string | 否 | - | wifi的报错信息 |\n| deviceOrientation | \"portrait\" \\| \"landscape\" | 是 | - | 设备方向 |\n","compatibility":"### getSystemSetting 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | - |\n","tutorial":"\n### 参见\n[getSystemSetting](https://uniapp.dcloud.net.cn/api/system/getsystemsetting.html)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-system-setting)\n"},"get-system-setting":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-system-setting/get-system-setting.uvue) \n ```vue\n\n\r\n\r\n\r\n\n\n```"},"installApk":{"name":"## uni.installApk(options) @installapk","description":"安装apk","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [InstallApkOptions](#installapkoptions-values) | 是 | - | - |\n#### InstallApkOptions 的属性值 @installapkoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string | 是 | - | apk文件地址 |\n| success | (res: [InstallApkSuccess](#installapksuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (err: [InstallApkFail](#installapkfail-values)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### InstallApkSuccess 的属性值 @installapksuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 安装成功消息 |\n\n##### InstallApkFail 的属性值 @installapkfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 错误码 - 1300002 找不到文件 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### installApk 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.94 | x | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.install-apk)\n"},"install-apk":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/install-apk/install-apk.uvue) \n ```vue\n\r\n\r\n\n\n```"},"getPushClientId":{"name":"## uni.getPushClientId(options) @getpushclientid","description":"获取客户端唯一的推送标识","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetPushClientIdOptions](#getpushclientidoptions-values) | 是 | - | - |\n#### GetPushClientIdOptions 的属性值 @getpushclientidoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (result: [GetPushClientIdSuccess](#getpushclientidsuccess-values)) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetPushClientIdSuccess 的属性值 @getpushclientidsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| cid | string | 是 | - | 个推客户端推送id,对应uni-id-device表的push_clientid |\n| errMsg | string | 是 | - | 错误描述 |\n","returnValue":"","compatibility":"### getPushClientId 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[getPushClientId](http://uniapp.dcloud.io/api/plugins/push.html#getpushclientid)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getPushClientId)\n"},"onPushMessage":{"name":"## uni.onPushMessage(callback) @onpushmessage","description":"启动监听推送消息事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | 事件类型
- click 从系统推送服务点击消息启动应用事件
- receive 应用从推送服务器接收到推送消息事件 |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | 消息内容 |\n","returnValue":"","compatibility":"### onPushMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[onPushMessage](http://uniapp.dcloud.io/api/plugins/push.html#onpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.onPushMessage)\n"},"offPushMessage":{"name":"## uni.offPushMessage(callback) @offpushmessage","description":"关闭推送消息监听事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [OnPushMessageCallbackResult](#onpushmessagecallbackresult-values)) => void | 是 | - | - |\n#### OnPushMessageCallbackResult 的属性值 @onpushmessagecallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | \"click\" \\| \"receive\" | 是 | - | 事件类型
- click 从系统推送服务点击消息启动应用事件
- receive 应用从推送服务器接收到推送消息事件 |\n| data | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | 消息内容 |\n","returnValue":"","compatibility":"### offPushMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[offPushMessage](http://uniapp.dcloud.io/api/plugins/push.html#offpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.offPushMessage)\n"},"getChannelManager":{"name":"## uni.getChannelManager() @getchannelmanager","description":"获取通知渠道管理器,Android 8系统以上才可以设置通知渠道,Android 8系统以下返回null。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [ChannelManager](#channelmanager-values) | \n\n#### ChannelManager 的方法 @channelmanager-values \n\n#### setPushChannel(options) @setpushchannel\n\n设置推送渠道\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetPushChannelOptions](#setpushchanneloptions-values) | 是 | - | - |\n###### SetPushChannelOptions 的属性值 @setpushchanneloptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| soundName | string \\| null | 否 | null | 添加的声音文件,注意raw目录下必须要有 ,不传此字段将使用默认铃音。 |\n| channelId | string | 是 | - | 通知渠道id |\n| channelDesc | string | 是 | - | 通知渠道描述 |\n| enableLights | boolean \\| null | 否 | false | 呼吸灯闪烁 |\n| enableVibration | boolean \\| null | 否 | false | 震动 |\n| importance | number \\| null | 否 | 3 | 通知的重要性级别,可选范围IMPORTANCE_LOW:2、IMPORTANCE_DEFAULT:3、IMPORTANCE_HIGH:4 。 |\n| lockscreenVisibility | number \\| null | 否 | -1000 | 锁屏可见性,可选范围VISIBILITY_PRIVATE:0、VISIBILITY_PUBLIC:1、VISIBILITY_SECRET:-1、VISIBILITY_NO_OVERRIDE:-1000。 |\n\n\n##### setPushChannel 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n\n\n#### getAllChannels() @getallchannels\n\n获取当前应用注册的所有的通知渠道。\n\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Array\\ | \n\n##### getAllChannels 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n\n","compatibility":"### getChannelManager 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.getChannelManager)\n"},"createPushMessage":{"name":"## uni.createPushMessage(options) @createpushmessage","description":"创建本地通知栏消息","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CreatePushMessageOptions](#createpushmessageoptions-values) | 是 | - | - |\n#### CreatePushMessageOptions 的属性值 @createpushmessageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| cover | boolean \\| null | 否 | false | 是否覆盖上一次提示的消息 |\n| delay | number \\| null | 否 | 0 | 提示消息延迟显示的时间,单位为s |\n| icon | string \\| null | 否 | null | 推送消息的图标 |\n| sound | string \\| null | 否 | \"system\" | 推送消息的提示音
- system: 使用系统通知提示音(默认值)
- none: 不使用提示音 |\n| title | string \\| null | 否 | App的名称 | 推送消息的标题 |\n| content | string | 是 | - | 消息显示的内容,在系统通知中心中显示的文本内容 |\n| payload | any \\| null | 否 | null | 消息承载的数据,可根据业务逻辑自定义数据格式 |\n| when | number \\| null | 否 | 当前时间 | 消息上显示的提示时间 |\n| channelId | string \\| null | 否 | \"DcloudChannelID\" | 渠道id |\n| category | string \\| null | 否 | null | 通知类别 |\n| success | (result: CreatePushMessageSuccess) => void \\| null | 否 | null | 接口调用成功的回调函数 |\n| fail | (result: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | null | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | null | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### CreatePushMessageOptions 兼容性 \n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| channelId | 4.4 | 3.98 | x | - |\n| category | 4.4 | 3.98 | x | - |\n","returnValue":"","compatibility":"### createPushMessage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.98 | x | - |\n","tutorial":"\n### 参见\n[createPushMessage](http://uniapp.dcloud.io/api/plugins/push.html#createpushmessage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.push.uni-push.createPushMessage)\n"},"getBatteryInfo":{"name":"## uni.getBatteryInfo(options) @getbatteryinfo","description":"获取电池电量信息\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetBatteryInfoOptions](#getbatteryinfooptions-values) | 是 | - | - |\n#### GetBatteryInfoOptions 的属性值 @getbatteryinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [GetBatteryInfoSuccess](#getbatteryinfosuccess-values)) => void | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n| fail | (res: UniError) => void | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void | 否 | - | 接口调用成功的回调 |\n\n##### GetBatteryInfoSuccess 的属性值 @getbatteryinfosuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n| level | number | 是 | - | 设备电量,范围1 - 100 |\n| isCharging | boolean | 是 | - | 是否正在充电中 |\n","returnValue":"","compatibility":"### getBatteryInfo 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfo)\n"},"getBatteryInfoSync":{"name":"## uni.getBatteryInfoSync() @getbatteryinfosync","description":"获取电池电量信息\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-getbatteryinfo](https://ext.dcloud.net.cn/plugin?name=uni-getbatteryinfo)\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetBatteryInfoResult](#getbatteryinforesult-values) | \n\n#### GetBatteryInfoResult 的属性值 @getbatteryinforesult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| level | number | 是 | - | 设备电量,范围1 - 100 |\n| isCharging | boolean | 是 | - | 是否正在充电中 |\n","compatibility":"### getBatteryInfoSync 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.get-battery-info.getBatteryInfoSync)\n"},"get-battery-info":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-battery-info/get-battery-info.uvue) \n ```vue\n\n\n\n\n```"},"startWifi":{"name":"## uni.startWifi(option) @startwifi","description":"\n初始化Wi-Fi模块\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | Wifi 函数通用入参封装 |\n#### WifiOption 的属性值 @wifioption-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### startWifi 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[startWifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#startwifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.startWifi)\n"},"connectWifi":{"name":"## uni.connectWifi(option) @connectwifi","description":"","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [WifiConnectOption](#wificonnectoption-values) | 是 | - | Wifi 链接参数封装 |\n#### WifiConnectOption 的属性值 @wificonnectoption-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 否 | - | - |\n| BSSID | string | 否 | - | - |\n| password | string | 否 | - | - |\n| maunal | boolean | 否 | - | - |\n| partialInfo | boolean | 否 | - | - |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### connectWifi 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| >=4.4 && <10.0 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[connectWifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#connectWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.connectWifi)\n"},"getWifiList":{"name":"## uni.getWifiList(option) @getwifilist","description":"\n请求获取 Wi-Fi 列表。wifiList 数据会在 onGetWifiList 注册的回调中返回。\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [WifiOption](#wifioption-values) | 是 | - | Wifi 函数通用入参封装 |\n#### WifiOption 的属性值 @wifioption-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### getWifiList 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[getWifiList](https://uniapp.dcloud.net.cn/api/system/wifi.html#getWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getWifiList)\n"},"onGetWifiList":{"name":"## uni.onGetWifiList(callback) @ongetwifilist","description":"\n监听获取到 Wi-Fi 列表数据事件。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (wifiInfo: any) => void | 是 | - | - |","returnValue":"","compatibility":"### onGetWifiList 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onGetWifiList](https://uniapp.dcloud.net.cn/api/system/wifi.html#onGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onGetWifiList)\n"},"offGetWifiList":{"name":"## uni.offGetWifiList(callback) @offgetwifilist","description":"\n移除获取到 Wi-Fi 列表数据事件的监听函数。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | () => void | 是 | - | - |","returnValue":"","compatibility":"### offGetWifiList 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[offGetWifiList](https://uniapp.dcloud.net.cn/api/system/wifi.html#offGetWifiList)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offGetWifiList)\n"},"getConnectedWifi":{"name":"## uni.getConnectedWifi(option) @getconnectedwifi","description":"\n获取已连接的 Wi-Fi 信息\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [GetConnectedWifiOptions](#getconnectedwifioptions-values) | 是 | - | 获取当前链接的wifi信息 |\n#### GetConnectedWifiOptions 的属性值 @getconnectedwifioptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| partialInfo | boolean | 否 | - | - |\n| success | (res: [UniWifiResult](#uniwifiresult-values)) => void | 否 | - | - |\n| fail | (res: UniError) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n##### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n###### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### getConnectedWifi 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[getConnectedWifi](https://uniapp.dcloud.net.cn/api/system/wifi.html#getConnectedWifi)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.getConnectedWifi)\n"},"onWifiConnected":{"name":"## uni.onWifiConnected(callback) @onwificonnected","description":"\n监听连接上 Wi-Fi 的事件\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (wifiInfo: [UniWifiResult](#uniwifiresult-values)) => void | 是 | - | - |\n#### UniWifiResult 的属性值 @uniwifiresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | - |\n| errSubject | string | 是 | - | - |\n| errMsg | string | 是 | - | - |\n| wifi | [UniWifiInfo](#uniwifiinfo-values) \\| null | 否 | - | |\n\n##### UniWifiInfo 的属性值 @uniwifiinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n| BSSID | string | 否 | - | - |\n| secure | boolean | 否 | - | - |\n| signalStrength | number | 否 | - | - |\n| frequency | number | 否 | - | - |\n","returnValue":"","compatibility":"### onWifiConnected 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onWifiConnected](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnected)\n"},"onWifiConnectedWithPartialInfo":{"name":"## uni.onWifiConnectedWithPartialInfo(callback) @onwificonnectedwithpartialinfo","description":"\n监听连接上 Wi-Fi 的事件。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (wifiInfo: [UniWifiInfoWithPartialInfo](#uniwifiinfowithpartialinfo-values)) => void | 是 | - | - |\n#### UniWifiInfoWithPartialInfo 的属性值 @uniwifiinfowithpartialinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| SSID | string | 是 | - | - |\n","returnValue":"","compatibility":"### onWifiConnectedWithPartialInfo 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onWifiConnectedWithPartialInfo](https://uniapp.dcloud.net.cn/api/system/wifi.html#onWifiConnectedWithPartialInfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.onWifiConnectedWithPartialInfo)\n"},"offWifiConnected":{"name":"## uni.offWifiConnected(callback?) @offwificonnected","description":"\n移除连接上 Wi-Fi 的事件的监听函数。\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-wifi](https://ext.dcloud.net.cn/plugin?name=uni-wifi)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | () => void \\| null | 否 | - | |","returnValue":"","compatibility":"### offWifiConnected 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[offWifiConnected](https://uniapp.dcloud.net.cn/api/system/wifi.html#offWifiConnected)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.wifi.offWifiConnected)\n"},"onMemoryWarning":{"name":"## uni.onMemoryWarning(callback) @onmemorywarning","description":"\n开启监听内存警告\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void | 是 | - | uni.onMemoryWarning/uni.offMemoryWarning回调函数定义 |\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| level | number | 是 | - | 内存警告等级(仅安卓平台有效,iOS始终是0) |\n","returnValue":"","compatibility":"### onMemoryWarning 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[onMemoryWarning](https://uniapp.dcloud.net.cn/api/system/memory.html#onmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.onMemoryWarning)\n"},"offMemoryWarning":{"name":"## uni.offMemoryWarning(callback?) @offmemorywarning","description":"\n取消监听内存不足告警事件\n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-memorywarning](https://ext.dcloud.net.cn/plugin?name=uni-memorywarning)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [MemoryWarningCallbackResult](#memorywarningcallbackresult-values)) => void \\| null | 否 | - | |\n#### MemoryWarningCallbackResult 的属性值 @memorywarningcallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| level | number | 是 | - | 内存警告等级(仅安卓平台有效,iOS始终是0) |\n","returnValue":"","compatibility":"### offMemoryWarning 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | x | - |\n","tutorial":"\n### 参见\n[offMemoryWarning](https://uniapp.dcloud.net.cn/api/system/memory.html#offmemorywarning)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.memory.offMemoryWarning)\n"},"onUserCaptureScreen":{"name":"## uni.onUserCaptureScreen(callback?) @onusercapturescreen","description":"\n开启截屏监听 \n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | 否 | - | uni.onUserCaptureScreen/uni.offUserCaptureScreen回调函数定义 |\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 否 | - | 截屏文件路径(仅Android返回) |\n","returnValue":"","compatibility":"### onUserCaptureScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | 3.9.0 | - |\n","tutorial":"\n### 参见\n[onUserCaptureScreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#onusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.onUserCaptureScreen)\n"},"offUserCaptureScreen":{"name":"## uni.offUserCaptureScreen(callback?) @offusercapturescreen","description":"\n关闭截屏监听 \n\n> 本 API 是 [uni ext api](https://uniapp.dcloud.net.cn/api/extapi.html),需下载插件:[uni-usercapturescreen](https://ext.dcloud.net.cn/plugin?name=uni-usercapturescreen)\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (res: [OnUserCaptureScreenCallbackResult](#onusercapturescreencallbackresult-values)) => void \\| null | 否 | - | |\n#### OnUserCaptureScreenCallbackResult 的属性值 @onusercapturescreencallbackresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 否 | - | 截屏文件路径(仅Android返回) |\n","returnValue":"","compatibility":"### offUserCaptureScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4.4 | 3.9.0 | 3.9.0 | - |\n","tutorial":"\n### 参见\n[offUserCaptureScreen](https://uniapp.dcloud.net.cn/api/system/capture-screen.html#offusercapturescreen)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.captureScreen.offUserCaptureScreen)\n"},"createRequestPermissionListener":{"name":"## uni.createRequestPermissionListener() @createrequestpermissionlistener","description":"创建一个监听权限申请的对象。","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RequestPermissionListener](#requestpermissionlistener-values) | \n\n#### RequestPermissionListener 的方法 @requestpermissionlistener-values \n\n#### onRequest(callback) @onrequest\n\n监听申请系统权限\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (permissions: Array\\) => void | 是 | - | 申请系统权限回调,permissions为触发权限申请的所有权限 |\n\n\n\n#### onConfirm(callback) @onconfirm\n\n监听弹出系统权限授权框\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (permissions: Array\\) => void | 是 | - | 弹出系统权限授权框回调,permissions为触发弹出权限授权框的所有权限 |\n\n\n\n#### onComplete(callback) @oncomplete\n\n监听权限申请完成\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (permissions: Array\\) => void | 是 | - | 权限申请完成回调,permissions为申请完成的所有权限 |\n\n\n\n#### stop() @stop\n\n取消所有监听\n\n\n\n","compatibility":"### createRequestPermissionListener 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 4.0 | - | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.device.createRequestPermissionListener)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/create-request-permission-listener/create-request-permission-listener.uvue) \n ```vue\n\n\n\n\n\n\n```"},"chooseImage":{"name":"## uni.chooseImage(options) @chooseimage","description":"从本地相册选择图片或使用相机拍照","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ChooseImageOptions](#chooseimageoptions-values) | 是 | - | - |\n#### ChooseImageOptions 的属性值 @chooseimageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| count | number \\| null | 否 | 9 | 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个。 |\n| sizeType | Array\\ \\| null | 否 | ['original','compressed'\\] | original 原图,compressed 压缩图,默认二者都有 |\n| sourceType | Array\\ \\| null | 否 | ['album','camera'\\] | album 从相册选图,camera 使用相机,默认二者都有 |\n| crop | [ChooseImageCropOptions](#chooseimagecropoptions-values) \\| null | 否 | - | 图像裁剪参数,设置后 sizeType 失效。 |\n| success | (callback: [ChooseImageSuccess](#chooseimagesuccess-values)) => void \\| null | 否 | - | 成功则返回图片的本地文件路径列表 tempFilePaths |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ChooseImageCropOptions 的属性值 @chooseimagecropoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| width | number | 是 | - | 裁剪的宽度,单位为px,用于计算裁剪宽高比。 |\n| height | number | 是 | - | 裁剪的高度,单位为px,用于计算裁剪宽高比。 |\n| quality | number \\| null | 否 | 80 | 取值范围为1-100,数值越小,质量越低(仅对jpg格式有效)。默认值为80。 |\n| resize | boolean \\| null | 否 | - | 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。 |\n\n##### ChooseImageSuccess 的属性值 @chooseimagesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errSubject | string | 是 | - | 调用API的名称 |\n| errMsg | string | 是 | - | 描述信息 |\n| tempFilePaths | Array\\ | 是 | - | 图片的本地文件路径列表 |\n| tempFiles | any | 是 | - | 图片的本地文件列表 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### chooseImage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | 4.0 |\n","tutorial":"\n### 参见\n[chooseImage](http://uniapp.dcloud.io/api/media/image?id=chooseimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.choose-image)\n"},"choose-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/choose-image/choose-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/choose-image/choose-image\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n var sourceTypeArray = [\n ['camera'],\n ['album'],\n ['camera', 'album']\n ]\n var sizeTypeArray = [\n ['compressed'],\n ['original'],\n ['compressed', 'original']\n ]\n export default {\n data() {\n return {\n title: 'choose/previewImage',\n imageList: [] as Array,\n sourceTypeIndex: 2,\n sourceType: ['拍照', '相册', '拍照或相册'],\n sizeTypeIndex: 2,\n sizeType: ['压缩', '原图', '压缩或原图'],\n countIndex: 8,\n count: [1, 2, 3, 4, 5, 6, 7, 8, 9],\n isCrop: false,\n cropPercent: 80,\n cropWidth: 100,\n cropHeight: 100,\n cropResize: false\n }\n },\n onUnload() {\n this.imageList = [];\n this.sourceTypeIndex = 2\n this.sourceType = ['拍照', '相册', '拍照或相册']\n this.sizeTypeIndex = 2\n this.sizeType = ['压缩', '原图', '压缩或原图']\n this.countIndex = 8\n },\n methods: {\n cropHeightConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropHeight = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"裁剪高度需要大于0\"\n })\n }\n },\n cropWidthConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0) {\n this.cropWidth = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"裁剪宽度需要大于0\"\n })\n }\n },\n cropPercentConfim(e : InputConfirmEvent) {\n let value = parseInt(e.detail.value)\n if (value > 0 && value <= 100) {\n this.cropPercent = value\n } else {\n uni.showToast({\n position: \"bottom\",\n title: \"请输入0~100之间的值\"\n })\n }\n },\n cropResizeChange(e : UniSwitchChangeEvent) {\n this.cropResize = e.detail.value\n },\n switchCrop(e : UniSwitchChangeEvent) {\n this.isCrop = e.detail.value\n },\n removeImage(index : number) {\n this.imageList.splice(index, 1)\n },\n chooseImageSource() {\n uni.showActionSheet({\n itemList: ['拍照', '相册', '拍照或相册'],\n success: (e) => {\n this.sourceTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageType() {\n uni.showActionSheet({\n itemList: ['压缩', '原图', '压缩或原图'],\n success: (e) => {\n this.sizeTypeIndex = e.tapIndex!\n }\n })\n },\n chooseImageCount(event : InputConfirmEvent) {\n let count = parseInt(event.detail.value) - 1\n if (count < 0) {\n uni.showToast({\n position: \"bottom\",\n title: \"图片数量应该大于0\"\n })\n return\n }\n this.countIndex = count\n },\n chooseImage: function () {\n // var cropOption:ChooseImageCropOptions|null = this.isCrop ? null : new ChooseImageCropOptions( )\n if (this.imageList.length >= 9) {\n uni.showToast({\n position: \"bottom\",\n title: \"已经有9张图片了,请删除部分图片之后重新选择\"\n })\n return\n }\n uni.chooseImage({\n sourceType: sourceTypeArray[this.sourceTypeIndex],\n sizeType: sizeTypeArray[this.sizeTypeIndex],\n crop: this.isCrop ? { \"quality\": this.cropPercent, \"width\": this.cropWidth, \"height\": this.cropHeight, \"resize\": this.cropResize } as ChooseImageCropOptions : null,\n count: this.imageList.length + this.count[this.countIndex] > 9 ? 9 - this.imageList.length : this.count[this.countIndex],\n success: (res) => {\n this.imageList = this.imageList.concat(res.tempFilePaths);\n },\n fail: (err) => {\n console.log(\"err: \", JSON.stringify(err));\n }\n })\n },\n previewImage: function (index : number) {\n uni.previewImage({\n current: index,\n urls: this.imageList\n })\n }\n }\n }\n\n```\n\n:::"},"previewImage":{"name":"## uni.previewImage(options) @previewimage","description":"预览图片","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [PreviewImageOptions](#previewimageoptions-values) | 是 | - | - |\n#### PreviewImageOptions 的属性值 @previewimageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| current | any \\| null | 否 | - | current 为当前显示图片的链接/索引值,不填或填写的值无效则为 urls 的第一张。 |\n| urls | Array\\ | 是 | - | 需要预览的图片链接列表 |\n| indicator | string \\| null | 否 | - | 图片指示器样式
- default: 底部圆点指示器
- number: 顶部数字指示器
- none: 不显示指示器 |\n| loop | boolean \\| null | 否 | - | 是否可循环预览 |\n| success | (callback: [PreviewImageSuccess](#previewimagesuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### PreviewImageSuccess 的属性值 @previewimagesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errSubject | string | 是 | - | 调用API的名称 |\n| errMsg | string | 是 | - | 描述信息 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### previewImage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | 4.0 |\n","tutorial":"\n### 参见\n[previewImage](http://uniapp.dcloud.io/api/media/image?id=previewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.previewImage)\n"},"closePreviewImage":{"name":"## uni.closePreviewImage(options) @closepreviewimage","description":"关闭图片预览","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ClosePreviewImageOptions](#closepreviewimageoptions-values) | 是 | - | - |\n#### ClosePreviewImageOptions 的属性值 @closepreviewimageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (callback: [ClosePreviewImageSuccess](#closepreviewimagesuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### ClosePreviewImageSuccess 的属性值 @closepreviewimagesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### closePreviewImage 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | - |\n","tutorial":"\n### 参见\n[closePreviewImage](http://uniapp.dcloud.io/api/media/image?id=closepreviewimage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.preview-image.closePreviewImage)\n"},"preview-image":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/preview-image/preview-image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/preview-image/preview-image\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : string,\n name : string\n }\n\n export default {\n data() {\n return {\n imageList: [\"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni@2x.png\", \"/static/uni.png\"],\n indicator: [{\n value: \"default\",\n name: \"圆点\"\n }, {\n value: \"number\",\n name: \"数字\"\n }, {\n value: \"none\",\n name: \"不显示\"\n }] as ItemType[],\n currentIndicator: \"default\",\n isLoop: true\n }\n },\n methods: {\n previewImage(index : number) {\n uni.previewImage({\n urls: this.imageList,\n current: index,\n indicator: this.currentIndicator,\n loop: this.isLoop\n })\n },\n chooseImage() {\n uni.chooseImage({\n sourceType: ['album'],\n success: (e) => {\n this.imageList = this.imageList.concat(e.tempFilePaths)\n },\n fail(_) {\n }\n })\n },\n onIndicatorChanged(e : UniRadioGroupChangeEvent) {\n this.currentIndicator = e.detail.value\n },\n onCheckboxChange(_ : UniCheckboxGroupChangeEvent) {\n this.isLoop = !this.isLoop\n }\n }\n }\n\n```\n\n:::"},"saveImageToPhotosAlbum":{"name":"## uni.saveImageToPhotosAlbum(options) @saveimagetophotosalbum","description":"保存图片到系统相册","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SaveImageToPhotosAlbumOptions](#saveimagetophotosalbumoptions-values) | 是 | - | - |\n#### SaveImageToPhotosAlbumOptions 的属性值 @saveimagetophotosalbumoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.ImageURIString | 是 | - | 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径 |\n| success | (callback: [SaveImageToPhotosAlbumSuccess](#saveimagetophotosalbumsuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (callback: [IMediaError](#imediaerror-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (callback: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### SaveImageToPhotosAlbumSuccess 的属性值 @saveimagetophotosalbumsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | 保存到相册的图片路径 |\n\n##### IMediaError 的属性值 @imediaerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1101001 \\| 1101002 \\| 1101003 \\| 1101004 \\| 1101005 \\| 1101006 \\| 1101007 \\| 1101008 \\| 1101009 \\| 1101010 | 是 | - | 错误码
- 1101001 用户取消
- 1101002 urls至少包含一张图片地址
- 1101003 文件不存在
- 1101004 图片加载失败
- 1101005 未获取权限
- 1101006 图片或视频保存失败
- 1101007 图片裁剪失败
- 1101008 拍照或录像失败
- 1101009 图片压缩失败
- 1101010 其他错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### saveImageToPhotosAlbum 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9 | - | - |\n","tutorial":"\n### 参见\n[saveImageToPhotosAlbum](http://uniapp.dcloud.io/api/media/image?id=saveimagetophotosalbum)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.media.save-image-to-photos-album)\n"},"save-image-to-photos-album":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/save-image-to-photos-album/save-image-to-photos-album.uvue) \n ```vue\n\n\n\n\n\n\n```"},"getLocation":{"name":"## uni.getLocation(options) @getlocation","description":"获取当前的地理位置、速度","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetLocationOptions](#getlocationoptions-values) | 是 | - | - |\n#### GetLocationOptions 的属性值 @getlocationoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | \"wgs84\" \\| \"gcj02\" \\| \"gps\" | 否 | wgs84 | 默认为 wgs84 返回 gps 坐标,gcj02 返回可用于uni.openLocation的坐标,web端需配置定位 SDK 信息才可支持 gcj02 |\n| altitude | boolean \\| null | 否 | false | 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 |\n| geocode | boolean \\| null | 否 | false | 传入 true 会解析地址 |\n| highAccuracyExpireTime | number \\| null | 否 | 3000 | 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 |\n| isHighAccuracy | boolean \\| null | 否 | false | 开启高精度定位 |\n| success | (result: [GetLocationSuccess](#getlocationsuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [IGetLocationFail](#igetlocationfail-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### GetLocationSuccess 的属性值 @getlocationsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| latitude | number | 是 | 0 | 纬度,浮点数,范围为-90~90,负数表示南纬 |\n| longitude | number | 是 | 0 | 经度,范围为-180~180,负数表示西经 |\n| speed | number | 是 | 0 | 速度,浮点数,单位m/s |\n| accuracy | number | 是 | - | 位置的精确度 |\n| altitude | number | 是 | 0 | 高度,单位 m |\n| verticalAccuracy | number | 是 | 0 | 垂直精度,单位 m(Android 无法获取,返回 0) |\n| horizontalAccuracy | number | 是 | 0 | 水平精度,单位 m |\n| address | any \\| null | 否 | null | 地址信息 |\n\n##### IGetLocationFail 的属性值 @igetlocationfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1505004 \\| 1505021 \\| 1505022 \\| 1505023 \\| 1505024 | 是 | - | 错误码
- 1505004 缺失权限
- 1505021 超时
- 1505022 不支持的定位类型
- 1505023 不支持逆地理编码
- 1505024 没有找到具体的定位引擎,请定位开关是否已打开 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### getLocation 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | x | 4.0 |\n","tutorial":"\n### 参见\n[getLocation]([](http://uniapp.dcloud.io/api/location/location?id=getlocation))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.location.get-location)\n"},"get-location":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-location/get-location.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/get-location/get-location\n>Template\n```vue\n\n\n\n```\n>Script\n```uts\n\n type ItemType = {\n value : 'wgs84' | 'gcj02',\n name : string,\n }\n export default {\n data() {\n return {\n title: 'get-location',\n altitudeSelect: false,\n isHighAccuracySelect: false,\n geocodeSelect: false,\n exeRet: '',\n items: [\n {\n value: 'wgs84',\n name: 'wgs84'\n },\n {\n value: 'gcj02',\n name: 'gcj02'\n }\n ] as ItemType[],\n current: 0,\n }\n },\n methods: {\n altitudeChange: function (e : UniSwitchChangeEvent) {\n this.altitudeSelect = e.detail.value\n },\n geocodeChange: function (e : UniSwitchChangeEvent) {\n this.geocodeSelect = e.detail.value\n },\n highAccuracySelectChange: function (e : UniSwitchChangeEvent) {\n this.isHighAccuracySelect = e.detail.value\n },\n radioChange(e : UniRadioGroupChangeEvent) {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].value === e.detail.value) {\n this.current = i;\n break;\n }\n }\n },\n getLocationTap: function () {\n uni.showLoading({\n title: '定位中'\n })\n uni.getLocation(({\n type: this.items[this.current].value,\n altitude: this.altitudeSelect,\n isHighAccuracy: this.isHighAccuracySelect,\n geocode: this.geocodeSelect,\n success: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n fail: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n },\n complete: (res : any) => {\n uni.hideLoading()\n console.log(res);\n this.exeRet = JSON.stringify(res)\n }\n }));\n\n\n }\n\n }\n }\n\n```\n\n:::"},"getStorageInfo":{"name":"## uni.getStorageInfo(options) @getstorageinfo","description":"\nuni.getStorageInfo函数定义\n异步获取当前 storage 的相关信息。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetStorageInfoOptions](#getstorageinfooptions-values) | 是 | - | uni.getStorageInfo参数定义 |\n#### GetStorageInfoOptions 的属性值 @getstorageinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: [GetStorageInfoSuccess](#getstorageinfosuccess-values)) => void \\| null | 否 | - | uni.getStorageInfo成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.getStorageInfo失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.getStorageInfo完成回调函数定义 |\n\n##### GetStorageInfoSuccess 的属性值 @getstorageinfosuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| keys | Array\\ | 是 | - | 当前 storage 中所有的 key |\n| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |\n| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |\n","returnValue":"","compatibility":"### getStorageInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorageInfo](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfo)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfo)\n"},"getStorageInfoSync":{"name":"## uni.getStorageInfoSync() @getstorageinfosync","description":"\nuni.getStorageInfoSync函数定义\n同步获取当前 storage 的相关信息。\n\n","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [GetStorageInfoSuccess](#getstorageinfosuccess-values) | \n\n#### GetStorageInfoSuccess 的属性值 @getstorageinfosuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| keys | Array\\ | 是 | - | 当前 storage 中所有的 key |\n| currentSize | number | 是 | - | 当前占用的空间大小, 单位:kb |\n| limitSize | number | 是 | - | 限制的空间大小, 单位:kb |\n","compatibility":"### getStorageInfoSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorageInfoSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorageinfosync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageInfoSync)\n"},"getStorage":{"name":"## uni.getStorage(options) @getstorage","description":"\nuni.getStorage函数定义\n从本地存储中异步获取指定 key 对应的内容。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetStorageOptions](#getstorageoptions-values) | 是 | - | uni.getStorage参数定义 |\n#### GetStorageOptions 的属性值 @getstorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |\n| success | (res: [GetStorageSuccess](#getstoragesuccess-values)) => void \\| null | 否 | - | uni.getStorage成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.getStorage失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.getStorage完成回调函数定义 |\n\n##### GetStorageSuccess 的属性值 @getstoragesuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any \\| null | 否 | - | key 对应的内容 |\n","returnValue":"","compatibility":"### getStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorage)\n"},"getStorageSync":{"name":"## uni.getStorageSync(key) @getstoragesync","description":"\nuni.getStorageSync函数定义\n从本地存储中同步获取指定 key 对应的内容。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | 否 | \n","compatibility":"### getStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[getStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#getstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.getStorageSync)\n"},"setStorage":{"name":"## uni.setStorage(options) @setstorage","description":"\nuni.setStorage函数定义\n将数据存储在本地storage存储中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个异步接口。 \n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [SetStorageOptions](#setstorageoptions-values) | 是 | - | uni.setStorage参数定义 |\n#### SetStorageOptions 的属性值 @setstorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |\n| data | any | 是 | - | 需要存储的内容,只支持原生类型、及能够通过 JSON.stringify 序列化的对象 |\n| success | (res: SetStorageSuccess) => void \\| null | 否 | - | uni.setStorage成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.setStorage失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.setStorage完成回调函数定义 |\n","returnValue":"","compatibility":"### setStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[setStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorage)\n"},"setStorageSync":{"name":"## uni.setStorageSync(key, data) @setstoragesync","description":"\nuni.setStorageSync函数定义\n将 data 存储在本地storage存储中指定的 key 中,会覆盖掉原来该 key 对应的内容,这是一个同步接口。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地storage存储中的指定的 key |\n| data | any | 是 | - | 需要存储的内容,只支持原生类型、及能够通过 JSON.stringify 序列化的对象 |","returnValue":"","compatibility":"### setStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[setStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#setstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.setStorageSync)\n"},"removeStorage":{"name":"## uni.removeStorage(options) @removestorage","description":"\nuni.removeStorage函数定义\n从本地存储中异步移除指定 key。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RemoveStorageOptions](#removestorageoptions-values) | 是 | - | uni.removeStorage参数定义 |\n#### RemoveStorageOptions 的属性值 @removestorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |\n| success | (res: RemoveStorageSuccess) => void \\| null | 否 | - | uni.removeStorage成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.removeStorage失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.removeStorage完成回调函数定义 |\n","returnValue":"","compatibility":"### removeStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[removeStorage](hhttps://uniapp.dcloud.net.cn/api/storage/storage.html#removestorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorage)\n"},"removeStorageSync":{"name":"## uni.removeStorageSync(key) @removestoragesync","description":"\nuni.removeStorageSync函数定义\n从本地存储中同步移除指定 key。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| key | string | 是 | - | 本地存储中的指定的 key |","returnValue":"","compatibility":"### removeStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[removeStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#removestoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.removeStorageSync)\n"},"clearStorage":{"name":"## uni.clearStorage(option?) @clearstorage","description":"\nuni.clearStorage函数定义\n清除本地数据存储。\n","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [ClearStorageOptions](#clearstorageoptions-values) \\| null | 否 | - | uni.removeStorage参数定义 |\n#### ClearStorageOptions 的属性值 @clearstorageoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | (res: ClearStorageSuccess) => void \\| null | 否 | - | uni.clearStorage 成功回调函数定义 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | uni.clearStorage 失败回调函数定义 |\n| complete | (res: any) => void \\| null | 否 | - | uni.clearStorage 完成回调函数定义 |\n","returnValue":"","compatibility":"### clearStorage 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[clearStorage](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstorage)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorage)\n"},"clearStorageSync":{"name":"## uni.clearStorageSync() @clearstoragesync","description":"\nuni.clearStorageSync函数定义\n清除本地数据存储。\n","param":"","returnValue":"","compatibility":"### clearStorageSync 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | 3.9.0 | 4.0 |\n","tutorial":"\n### 参见\n[clearStorageSync](https://uniapp.dcloud.net.cn/api/storage/storage.html#clearstoragesync)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.storage.storage.clearStorageSync)\n"},"storage":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/storage/storage.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/storage/storage\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'get/set/clearStorage',\n key: '',\n data: '' as any,\n apiGetData: '' as any | null,\n storageInfo: '',\n }\n },\n methods: {\n getStorageInfo() {\n uni.getStorageInfo({\n success: (res) => {\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n },\n })\n },\n getStorageInfoSync() {\n try {\n const res = uni.getStorageInfoSync()\n this.apiGetData = res\n this.storageInfo = JSON.stringify(res)\n } catch (e) {\n // error\n console.log(e)\n }\n },\n jsonLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = JSON.stringify({\n name: \"james\",\n age: 12,\n from: \"american\"\n });\n\n },\n longLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"1234567890\"\n },\n floatLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"321456.1234567890\"\n },\n negativeLikeMock() {\n this.key = 'key_' + Math.random()\n this.data = \"-321456\"\n },\n strMock() {\n this.key = 'key_' + Math.random()\n this.data = '测试字符串数据,长度为16个字符'\n },\n complexMock() {\n this.key = 'key_' + Math.random()\n let jsonObj = {\n name: '张三',\n age: 12,\n classMate: [\n {\n id: 1001,\n name: '李四',\n },\n {\n id: 1002,\n name: 'jack ma',\n },\n ],\n }\n this.data = jsonObj\n },\n numberMock() {\n this.key = 'key_' + Math.random()\n this.data = 10011\n },\n floatMock() {\n this.key = 'key_' + Math.random()\n this.data = 3.1415926535893384626\n },\n\n keyChange: function (e : InputEvent) {\n this.key = e.detail.value\n },\n dataChange: function (e : InputEvent) {\n this.data = e.detail.value\n },\n getStorage: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读取数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n let that = this\n uni.getStorage({\n key: key,\n success: (res) => {\n\n that.apiGetData = res.data\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读取数据成功',\n content: desc,\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '读取数据失败',\n content: '找不到 key 对应的数据',\n showCancel: false,\n })\n },\n })\n }\n },\n getStorageSync: function () {\n var key = this.key\n if (key.length == 0) {\n uni.showModal({\n title: '读取数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n this.apiGetData = uni.getStorageSync(key)\n\n let desc : string = typeof this.apiGetData\n if (\"object\" == desc) {\n desc = desc + \": \" + JSON.stringify(this.apiGetData)\n } else {\n desc = desc + \": \" + this.apiGetData\n }\n\n uni.showModal({\n title: '读取数据成功',\n content: desc,\n showCancel: false,\n })\n }\n },\n setStorage: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: '保存数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n uni.setStorage({\n key: key,\n data: data,\n success: () => {\n uni.showModal({\n title: '存储数据成功',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '储存数据失败!',\n showCancel: false,\n })\n },\n })\n }\n },\n setStorageSync: function () {\n var key = this.key\n var data = this.data\n if (key.length == 0) {\n uni.showModal({\n title: '保存数据失败',\n content: 'key 不能为空',\n showCancel: false,\n })\n } else {\n uni.setStorageSync(key, data)\n uni.showModal({\n title: '存储数据成功',\n showCancel: false,\n })\n }\n },\n removeStorage: function () {\n uni.removeStorage({\n key: this.key,\n success: () => {\n uni.showModal({\n title: '移除数据成功',\n showCancel: false,\n })\n },\n fail: () => {\n uni.showModal({\n title: '移除数据失败',\n showCancel: false,\n })\n },\n })\n },\n removeStorageSync: function () {\n uni.removeStorageSync(this.key)\n uni.showModal({\n title: '移除数据成功',\n showCancel: false,\n })\n },\n clearStorage: function () {\n this.key = ''\n this.data = ''\n uni.clearStorage({\n success: function (_) {\n uni.showModal({\n title: '清除数据成功',\n showCancel: false,\n })\n },\n fail: function (_) {\n uni.showModal({\n title: '清除数据失败',\n showCancel: false,\n })\n },\n })\n },\n clearStorageSync: function () {\n this.key = ''\n this.data = ''\n uni.clearStorageSync()\n uni.showModal({\n title: '清除数据成功',\n content: ' ',\n showCancel: false,\n })\n },\n },\n }\n\n```\n\n:::"},"getFileSystemManager":{"name":"## uni.getFileSystemManager() @getfilesystemmanager","description":"\n获取文件管理器","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [FileSystemManager](#filesystemmanager-values) | \n\n#### FileSystemManager 的方法 @filesystemmanager-values \n\n#### readFile(options) @readfile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ReadFileOptions](#readfileoptions-values) | 是 | - | - |\n###### ReadFileOptions 的属性值 @readfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| encoding | \"base64\" \\| \"utf-8\" | 是 | - | base64 / utf-8 |\n| filePath | string.URIString | 是 | - | 文件路径,支持相对地址和绝对地址 |\n| success | (res: [ReadFileSuccessResult](#readfilesuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 通用的错误返回结果回调 |\n| complete | (res: any) => void \\| null | 否 | - | 通用的结束返回结果回调 |\n\n###### ReadFileSuccessResult 的属性值 @readfilesuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | string | 是 | - | - |\n\n\n\n\n#### writeFile(options) @writefile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [WriteFileOptions](#writefileoptions-values) | 是 | - | - |\n###### WriteFileOptions 的属性值 @writefileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.URIString | 是 | - | 文件路径,只支持绝对地址 |\n| encoding | \"ascii\" \\| \"base64\" \\| \"utf-8\" | 是 | - | 指定写入文件的字符编码
支持:ascii base64 utf-8 |\n| data | string | 是 | - | 写入的文本内容 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 通用的正确返回结果回调 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### FileManagerSuccessResult 的属性值 @filemanagersuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n\n\n\n\n#### unlink(options) @unlink\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UnLinkOptions](#unlinkoptions-values) | 是 | - | - |\n###### UnLinkOptions 的属性值 @unlinkoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.URIString | 是 | - | 文件路径,只支持绝对地址 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### mkdir(options) @mkdir\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [MkDirOptions](#mkdiroptions-values) | 是 | - | - |\n###### MkDirOptions 的属性值 @mkdiroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dirPath | string.URIString | 是 | - | 创建的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### rmdir(options) @rmdir\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RmDirOptions](#rmdiroptions-values) | 是 | - | - |\n###### RmDirOptions 的属性值 @rmdiroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dirPath | string.URIString | 是 | - | 要删除的目录路径 (本地路径) |\n| recursive | boolean | 是 | - | 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### readdir(options) @readdir\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [ReadDirOptions](#readdiroptions-values) | 是 | - | - |\n###### ReadDirOptions 的属性值 @readdiroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dirPath | string.URIString | 是 | - | 要读取的目录路径 (本地路径) |\n| success | (res: [ReadDirSuccessResult](#readdirsuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### ReadDirSuccessResult 的属性值 @readdirsuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| files | Array\\ | 是 | - | - |\n\n\n\n\n#### access(options) @access\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [AccessOptions](#accessoptions-values) | 是 | - | - |\n###### AccessOptions 的属性值 @accessoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string.URIString | 是 | - | 要删除的目录路径 (本地路径) |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### rename(options) @rename\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RenameOptions](#renameoptions-values) | 是 | - | - |\n###### RenameOptions 的属性值 @renameoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| oldPath | string.URIString | 是 | - | 源文件路径,支持本地路径 |\n| newPath | string.URIString | 是 | - | 新文件路径,支持本地路径 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### copyFile(options) @copyfile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [CopyFileOptions](#copyfileoptions-values) | 是 | - | - |\n###### CopyFileOptions 的属性值 @copyfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| srcPath | string.URIString | 是 | - | 源文件路径,支持本地路径 |\n| destPath | string.URIString | 是 | - | 新文件路径,支持本地路径 |\n| success | (res: [FileManagerSuccessResult](#filemanagersuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n\n\n\n#### getFileInfo(options) @getfileinfo\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [GetFileInfoOptions](#getfileinfooptions-values) | 是 | - | - |\n###### GetFileInfoOptions 的属性值 @getfileinfooptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string.URIString | 是 | - | 要读取的文件路径 (本地路径) |\n| digestAlgorithm | \"md5\" \\| \"sha1\" | 是 | - | md5 / sha1 |\n| success | (res: [GetFileInfoSuccessResult](#getfileinfosuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### GetFileInfoSuccessResult 的属性值 @getfileinfosuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| digest | string | 是 | - | - |\n| size | number | 是 | - | - |\n| errMsg | string | 是 | - | - |\n\n\n\n\n#### stat(options) @stat\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [StatOptions](#statoptions-values) | 是 | - | - |\n###### StatOptions 的属性值 @statoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string.URIString | 是 | - | 文件/目录路径 (本地路径) |\n| recursive | boolean | 是 | - | 是否递归获取目录下的每个文件的 Stats 信息 |\n| success | (res: [StatSuccessResult](#statsuccessresult-values)) => void \\| null | 否 | - | 接口调用的回调函数 |\n| fail | (res: [UniError](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (res: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n###### StatSuccessResult 的属性值 @statsuccessresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | - |\n| stats | Array\\<[FileStats](#filestats-values)\\> | 是 | - | - |\n\n###### FileStats 的属性值 @filestats-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| path | string | 是 | - | - |\n| stats | [Stats](#stats-values) | 是 | - | - |\n\n###### Stats 的属性值 @stats-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| mode | number | 是 | - | - |\n| size | number | 是 | - | - |\n| lastAccessedTime | number | 是 | - | - |\n| lastModifiedTime | number | 是 | - | - |\n| mIsFile | boolean | 是 | - | - |\n\n###### Stats 的方法 @stats-values \n\n##### isDirectory() @isdirectory\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean | \n\n\n\n##### isFile() @isfile\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| boolean | \n\n\n\n##### toLog() @tolog\n\n\n###### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | 否 | \n\n\n\n##### toJSON() @tojson\n\n\n###### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | 否 | \n\n\n\n\n\n","compatibility":"### getFileSystemManager 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | x | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.file.filemanager.getFileSystemManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-file-system-manager/get-file-system-manager.uvue) \n ```vue\n\n\n\n\n\n\n```"},"getUniverifyManager":{"name":"## uni.getUniverifyManager() @getuniverifymanager","description":"获取一键登录管理对象","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UniverifyManager](#univerifymanager-values) | \n\n#### UniverifyManager 的方法 @univerifymanager-values \n\n#### preLogin(options) @prelogin\n预登录\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [PreLoginOptions](#preloginoptions-values) | 是 | - | 预登录参数 |\n###### PreLoginOptions 的属性值 @preloginoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| success | () => void | 否 | - | - |\n| fail | (err: [PreLoginFail](#preloginfail-values)) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n###### PreLoginFail 的属性值 @preloginfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | 1000 当前应用appid尚未开通uni一键登录
1001 应用所有者账号信息异常,请检查账号一键登录服务是否正常
1002 应用所有者账号信息异常,请检查账号余额是否充足
1004 uni一键登录应用不存在
4001 参数异常
30004 其他错误
30005 预登录失败
30006 一键登录失败 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n##### preLogin 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n\n#### login(options) @login\n登录\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [LoginOptions](#loginoptions-values) | 是 | - | 登录参数 |\n###### LoginOptions 的属性值 @loginoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| univerifyStyle | [UniverifyStyle](#univerifystyle-values) | 否 | - | 登录页样式 |\n| success | (res: [LoginSuccess](#loginsuccess-values)) => void | 否 | - | - |\n| fail | (err: [LoginFail](#loginfail-values)) => void | 否 | - | - |\n| complete | (res: any) => void | 否 | - | - |\n\n###### UniverifyStyle 的属性值 @univerifystyle-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fullScreen | boolean | 否 | - | 是否全屏 |\n| logoPath | string | 否 | - | logo路径 |\n| backgroundColor | string | 否 | - | 登录页背景色 |\n| loginBtnText | string | 否 | - | 登录按钮文字 |\n\n###### LoginSuccess 的属性值 @loginsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| openId | string | 是 | - | 登录授权唯一标识 |\n| accessToken | string | 是 | - | token |\n\n###### LoginFail 的属性值 @loginfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 1000 \\| 1001 \\| 1002 \\| 1004 \\| 4001 \\| 30004 \\| 30005 \\| 30006 | 是 | - | 1000 当前应用appid尚未开通uni一键登录
1001 应用所有者账号信息异常,请检查账号一键登录服务是否正常
1002 应用所有者账号信息异常,请检查账号余额是否充足
1004 uni一键登录应用不存在
4001 参数异常
30004 其他错误
30005 预登录失败
30006 一键登录失败 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n##### login 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n\n#### close() @close\n关闭登录页\n\n\n##### close 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n\n#### isPreLoginValid() @ispreloginvalid\n预登录是否有效\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| boolean | \n\n##### isPreLoginValid 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n\n","compatibility":"### getUniverifyManager 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.99 | x | - |\n","tutorial":"\n### 参见\n[getUniverifyManager](https://uniapp.dcloud.net.cn/univerify.html#univerifymanager)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.univerify.getUniverifyManager)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/get-univerify-manager/get-univerify-manager.uvue) \n ```vue\n\n\n\n\n\n\n```"},"getFacialRecognitionMetaInfo":{"name":"## uni.getFacialRecognitionMetaInfo() @getfacialrecognitionmetainfo","description":"获取阿里云实人认证meta info","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| string | \n","compatibility":"### getFacialRecognitionMetaInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | 3.9 | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.getFacialRecognitionMetaInfo)\n"},"startFacialRecognitionVerify":{"name":"## uni.startFacialRecognitionVerify(faceStyle) @startfacialrecognitionverify","description":"启动人脸识别","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| faceStyle | [StartFacialRecognitionVerifyOptions](#startfacialrecognitionverifyoptions-values) | 是 | - | - |\n#### StartFacialRecognitionVerifyOptions 的属性值 @startfacialrecognitionverifyoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| certifyId | string | 是 | - | certifyId 调用实人认证的id |\n| progressBarColor | string \\| null | 否 | - | 活体检测页面的进度条颜色。 |\n| screenOrientation | Union \\| null | 否 | \"port\" | 认证时屏幕方向
- land 横屏
- port 竖屏 |\n| success | (res: [StartFacialRecognitionVerifySuccess](#startfacialrecognitionverifysuccess-values)) => void \\| null | 否 | - | 成功回调 |\n| fail | (res: [IFacialRecognitionVerifyError](#ifacialrecognitionverifyerror-values)) => void \\| null | 否 | - | 失败回调 |\n| complete | (res: any) => void \\| null | 否 | - | 完成回调 |\n\n##### StartFacialRecognitionVerifySuccess 的属性值 @startfacialrecognitionverifysuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | number | 是 | - | 错误码 |\n| errSubject | string | 是 | - | 调用API的名称 |\n| errMsg | string | 是 | - | 错误的详细信息 |\n| cause | [SourceError](#sourceerror-values) | 否 | - | 错误来源 |\n\n###### SourceError 的属性值 @sourceerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| subject | string \\| null | 否 | - | 源错误模块名称 |\n| message | string | 是 | - | 源错误描述信息 |\n| code | number | 是 | - | 源错误的错误码 |\n| name | string | 是 | - | - |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | |\n\n##### IFacialRecognitionVerifyError 的属性值 @ifacialrecognitionverifyerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 10010 \\| 10012 \\| 10011 \\| 10013 \\| 10020 \\| 10001 \\| 10002 | 是 | - | 错误码
- 10001 certifyId 不能为空
- 10002 \"当前设备不支持\"
- 10010 刷脸异常
- 10012 网络异常
- 10011 验证中断
- 10013 刷脸验证失败
- 10020 设备设置时间异常 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n##### StartFacialRecognitionVerifyOptions 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| screenOrientation | 3.9 | x | - |\n","returnValue":"","compatibility":"### startFacialRecognitionVerify 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | 3.9 | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.login_verify.facial-recognition-verify.startFacialRecognitionVerify)\n"},"facial-recognition-verify":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/facial-recognition-verify/facial-recognition-verify.uvue) \n ```vue\n\n\n\n\n\n\n```"},"createRewardedVideoAd":{"name":"## uni.createRewardedVideoAd(option) @createrewardedvideoad","description":"创建激励视频广告对象","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| option | [CreateRewardedVideoAdOptions](#createrewardedvideoadoptions-values) | 是 | - | - |\n#### CreateRewardedVideoAdOptions 的属性值 @createrewardedvideoadoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| adpid | string | 是 | - | 广告位 id |\n| urlCallback | [UrlCallbackOptions](#urlcallbackoptions-values) \\| null | 否 | - | 服务器回调透传参数 |\n\n##### UrlCallbackOptions 的属性值 @urlcallbackoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| userId | string \\| null | 否 | - | 透传到服务器端的userId |\n| extra | string \\| null | 否 | - | 透传到服务器端的extra,不推荐设置过于复杂的字符串 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [RewardedVideoAd](#rewardedvideoad-values) | \n\n#### RewardedVideoAd 的方法 @rewardedvideoad-values \n\n#### show() @show\n\n广告加载成功之后,调用此方法展示广告\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\ | \n\n\n\n#### load() @load\n\n加载广告\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\ | \n\n\n\n#### destroy() @destroy\n\n销毁广告\n\n\n\n\n#### onLoad(callback) @onload\n\n绑定广告 load 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n\n\n#### offLoad(callback) @offload\n\n解除绑定 load 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n\n\n#### onError(callback) @onerror\n\n绑定 error 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - |\n###### IUniAdError 的属性值 @iuniaderror-values \n\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 \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n\n\n\n\n#### offError(callback) @offerror\n\n解除绑定 error 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [IUniAdError](#iuniaderror-values)) => void | 是 | - | - |\n\n\n\n#### onClose(callback) @onclose\n\n绑定 close 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - |\n###### VideoAdClose 的属性值 @videoadclose-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| isEnded | boolean | 是 | - | true标识广告播放完毕或者达到发放奖励的条件 |\n\n\n\n\n#### offClose(callback) @offclose\n\n解除绑定 close 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [VideoAdClose](#videoadclose-values)) => void | 是 | - | - |\n\n\n\n#### onAdClicked(callback) @onadclicked\n\n绑定广告可点击屏幕区域事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: any) => void | 是 | - | - |\n\n\n\n#### onVerify(callback) @onverify\n\n绑定 verify 事件的监听器\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (result: [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | 是 | - | - |\n\n\n","compatibility":"### createRewardedVideoAd 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 4.0 | - | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.ad.createRewardedVideoAd)\n","example":"### 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/rewarded-video-ad/rewarded-video-ad.uvue) \n ```vue\n\n\n\n\n\n\n```"},"requestPayment":{"name":"## uni.requestPayment(options) @requestpayment","description":"支付","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [RequestPaymentOptions](#requestpaymentoptions-values) | 是 | - | - |\n#### RequestPaymentOptions 的属性值 @requestpaymentoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| provider | string | 是 | - | 支付服务提供商,通过 uni.getProvider 获取 - alipay: 支付宝支付 - wxpay: 微信支付 - baidu: 百度收银台 - appleiap: 苹果应用内支付 |\n| orderInfo | string | 是 | - | 订单数据 |\n| timeStamp | string \\| null | 否 | - | 时间戳从1970年1月1日至今的秒数,即当前的时间,微信小程序独有 |\n| nonceStr | string \\| null | 否 | - | 随机字符串,长度为32个字符以下,微信小程序独有 。 |\n| package | string \\| null | 否 | - | 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=xx,微信小程序独有 |\n| signType | string \\| null | 否 | - | 签名算法,暂支持 MD5 ,微信小程序独有 |\n| paySign | string \\| null | 否 | - | 签名,具体签名方案参见小程序支付接口文档,微信小程序独有 |\n| success | (result: [RequestPaymentSuccess](#requestpaymentsuccess-values)) => void \\| null | 否 | - | 接口调用成功的回调函数 |\n| fail | (result: [IRequestPaymentFail](#irequestpaymentfail-values)) => void \\| null | 否 | - | 接口调用失败的回调函数 |\n| complete | (result: any) => void \\| null | 否 | - | 接口调用结束的回调函数(调用成功、失败都会执行) |\n\n##### RequestPaymentSuccess 的属性值 @requestpaymentsuccess-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any \\| null | 否 | - | |\n\n##### IRequestPaymentFail 的属性值 @irequestpaymentfail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 700710 \\| 700711 \\| 700712 \\| 700713 \\| 700714 \\| 700715 \\| 700716 | 是 | - | 错误码
- 700710 正在处理中,支付结果未知(有可能已经支付成功),请查询商家订单列表中订单的支付状态
- 700711 订单支付失败。
- 700712 重复请求。
- 700713 用户中途取消。
- 700714 网络连接出错。
- 700715 支付结果未知(有可能已经支付成功),请查询商家订单列表中订单的支付状态。
- 700716 其它支付错误。 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | 源错误信息,可以包含多个错误,详见SourceError |\n| errMsg | string | 是 | - | - |\n","returnValue":"","compatibility":"### requestPayment 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 4.0 | x | x |\n","tutorial":"\n### 参见\n[requestPayment]([](https://uniapp.dcloud.net.cn/api/plugins/payment.html))\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.payment.requestPayment)\n","example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/request-payment/request-payment.uvue) \n ```vue\n\r\n\r\n\r\n\r\n\n\n```"},"createWebviewContext":{"name":"## uni.createWebviewContext(webviewId, component?) @createwebviewcontext","description":"创建 web-view 组件的上下文对象,用于操作 web-view 的行为。","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| webviewId | string.WebviewIdString | 是 | - | - |\n| component | ComponentPublicInstance \\| null | 否 | - | |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [WebviewContext](#webviewcontext-values) \\| null | 否 | \n\n#### WebviewContext 的方法 @webviewcontext-values \n\n#### back() @back\n后退到 web-view 组件网页加载历史的上一页,如果不存在上一页则没有任何效果。\n\n\n##### back 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### forward() @forward\n前进到 web-view 组件网页加载历史的下一页,如果不存在下一页则没有任何效果。\n\n\n##### forward 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### reload() @reload\n重新加载 web-view 组件当前页面。\n\n\n##### reload 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### stop() @stop\n停止加载 web-view 组件当前网页,该方法不能阻止已经加载的 html 文档,但是能够阻止未完成的图片及延迟加载的资源。\n\n\n##### stop 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n\n#### evalJS(js) @evaljs\n在网页中执行指定的js脚本,在 uvue 页面中可通过此方法向 web-view 组件加载的页面发送数据\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| js | string | 是 | - | - |\n\n##### evalJS 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | - |\n\n","compatibility":"### createWebviewContext 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9.0 | - | x |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-webview-context)\n"},"createVideoContext":{"name":"## uni.createVideoContext(videoId, component?) @createvideocontext","description":"创建并返回 video 上下文 videoContext 对象","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| videoId | string.VideoIdString | 是 | - | - |\n| component | ComponentPublicInstance \\| null | 否 | - | |","returnValue":"### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| [VideoContext](#videocontext-values) \\| null | 否 | \n\n#### VideoContext 的方法 @videocontext-values \n\n#### play() @play\n播放\n\n\n##### play 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### pause() @pause\n暂停\n\n\n##### pause 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### seek(position) @seek\n跳转到指定位置\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| position | number | 是 | - | 跳转到指定位置(秒) |\n\n##### seek 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### stop() @stop\n停止视频\n\n\n##### stop 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### sendDanmu(danmu) @senddanmu\n发送弹幕\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| danmu | [Danmu](#danmu-values) | 是 | - | text, color |\n###### Danmu 的属性值 @danmu-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string \\| null | 否 | - | 弹幕文字 |\n| color | string \\| null | 否 | - | 弹幕颜色 |\n| time | number \\| null | 否 | - | 显示时刻 |\n\n\n##### sendDanmu 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### playbackRate(rate) @playbackrate\n设置倍速播放\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| rate | number | 是 | - | , 支持倍率 0.5/0.8/1.0/1.25/1.5 |\n\n##### playbackRate 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### requestFullScreen(direction?) @requestfullscreen\n进入全屏\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | [RequestFullScreenOptions](#requestfullscreenoptions-values) | 否 | - | , 0\\|正常竖向, 90\\|屏幕逆时针90度, -90\\|屏幕顺时针90度 |\n###### RequestFullScreenOptions 的属性值 @requestfullscreenoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | number \\| null | 否 | - | direction
- 0: 正常竖向
- 90: 屏幕逆时针90度
- -90: 屏幕顺时针90度 |\n\n###### RequestFullScreenOptions 兼容性 \n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| direction | 4.4 | 3.9.0 | - | x |\n\n\n##### requestFullScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n\n#### exitFullScreen() @exitfullscreen\n退出全屏\n\n\n##### exitFullScreen 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | 3.9.0 | - | 4.0 |\n\n","compatibility":"### createVideoContext 兼容性 \n| Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- |\n| 4.4 | √ | - | 4.0 |\n","tutorial":"\n### 参见\n[createVideoContext](http://uniapp.dcloud.io/api/media/video-context?id=createVideoContext)\n\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.component.create-video-context)\n"},"general_type":{"name":"## 通用类型\n","param":"### GeneralCallbackResult \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n"}} \ No newline at end of file diff --git a/docs/.vuepress/utils/utsComJson.json b/docs/.vuepress/utils/utsComJson.json index 0dce35f7..e76c95d6 100644 --- a/docs/.vuepress/utils/utsComJson.json +++ b/docs/.vuepress/utils/utsComJson.json @@ -1 +1 @@ -{"animation-view":{"name":"## animation-view","description":"Lottie 动画","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| path | string | \"\" | 动画资源地址,目前只支持绝对路径 |\n| loop | boolean | false | 动画是否循环播放 |\n| autoplay | boolean | false | 动画是否自动播放 |\n| action | string | \"stop\" | 动画操作,可取值 play、pause、stop [action](#animation-view-action-values) |\n| hidden | boolean | false | 是否隐藏动画 |\n| @ended | (event: [UniEvent](/component/common#unievent)) => void | - | - |\n\n#### action @animation-view-action-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| play | 播放 |\n| pause | 暂停 |\n| stop | 停止 |\n\n\n##### action 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| play | 3.9 | x | - |\n| pause | 3.9 | x | - |\n| stop | 3.9 | x | - |\n","event":"","example":"","compatibility":"### animation-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| path | 3.9 | x | - |\n| loop | 3.9 | x | - |\n| autoplay | 3.9 | x | - |\n| action | 3.9 | x | - |\n| hidden | 3.9 | x | - |\n| @ended | 3.9 | x | - |\n\n### animation-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | - |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/animation-view)\n- [插件市场](https://ext.dcloud.net.cn/plugin?id=10674)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/animation-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.animation-view)\n"},"button":{"name":"## button","description":"> 组件类型:UniButtonElement \n\n 按钮","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| disabled | boolean | false | 是否禁用 |\n| hover-class | string(string.ClassString) | \"button-hover\" | 指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果 |\n| hover-start-time | number | 20 | 按住后多久出现点击态,单位毫秒 |\n| hover-stay-time | number | 70 | 手指松开后点击态保留时间,单位毫秒 |\n| size | string | \"default\" | 按钮的大小 [size](#button-size-values) |\n| type | string | \"default\" | 按钮的样式类型 [type](#button-type-values) |\n| plain | boolean | false | 按钮是否镂空,背景色透明 |\n\n#### size @button-size-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| default | 默认大小 |\n| mini | 小尺寸 |\n\n\n\n#### type @button-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| default | 白色 |\n| primary | 蓝色 |\n| warn | 红色 |\n\n","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>Template\n```vue\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'\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: 'uni-app-x'\r\n }\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 }\r\n }\r\n\n```\n\n:::","compatibility":"### button 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| disabled | √ | x | 4.0 |\n| hover-class | √ | x | 4.0 |\n| hover-start-time | √ | x | 4.0 |\n| hover-stay-time | √ | x | 4.0 |\n| size | √ | x | 4.0 |\n| type | √ | x | 4.0 |\n| plain | √ | x | 4.0 |\n\n### button 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/button)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/button.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.button)\n"},"checkbox":{"name":"## checkbox","description":"> 组件类型:UniCheckboxElement \n\n 多选项。在1组check-group中可选择多个","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| disabled | boolean | false | 是否禁用 |\n| value | string | - | checkbox 标识,选中时触发 checkbox-group 的 change 事件,并携带 checkbox 的 value |\n| checked | boolean | false | 当前是否选中,可用来设置默认选中 |\n| color | string(string.ColorString) | \"#007aff\" | checkbox的颜色 |\n| backgroundColor | string(string.ColorString) | \"#ffffff\" | checkbox默认的背景颜色 |\n| borderColor | string(string.ColorString) | \"#d1d1d1\" | checkbox默认的边框颜色 |\n| activeBackgroundColor | string(string.ColorString) | \"#ffffff\" | checkbox选中时的背景颜色 |\n| activeBorderColor | string(string.ColorString) | \"#d1d1d1\" | checkbox选中时的边框颜色 |\n| iconColor | string(string.ColorString) | \"#007aff\" | checkbox的图标颜色,优先级大于color属性 |","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>Template\n```vue\n\r\n\r\n\r\n\r\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\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 // 组件属性 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 }\r\n },\r\n methods: {\r\n checkboxChange: function (e : UniCheckboxGroupChangeEvent) {\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 }\r\n }\r\n\n```\n\n:::","compatibility":"### checkbox 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| disabled | √ | x | 4.0 |\n| value | √ | x | 4.0 |\n| checked | √ | x | 4.0 |\n| color | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| borderColor | √ | x | 4.0 |\n| activeBackgroundColor | √ | x | 4.0 |\n| activeBorderColor | √ | x | 4.0 |\n| iconColor | √ | x | 4.0 |\n\n### checkbox 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/checkbox)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/checkbox-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.checkbox)\n"},"checkbox-group":{"name":"## checkbox-group","description":"> 组件类型:UniCheckboxGroupElement \n\n 多项组,内部由多个checkbox组成","attrubute":"### 属性 \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##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | Array\\ | 是 | - | - |\n\n##### UniCheckboxGroupChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniCheckboxGroupChangeEventDetail](#unicheckboxgroupchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniCheckboxGroupChangeEventDetail 的属性值 @unicheckboxgroupchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | Array\\ | 是 | - | - |\n\n##### UniCheckboxGroupChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n","example":"","compatibility":"### checkbox-group 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| @change | √ | x | 4.0 |\n\n### checkbox-group 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [checkbox](#checkbox)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/checkbox)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/checkbox-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.checkbox-group)\n"},"image":{"name":"## image","description":"> 组件类型:UniImageElement \n\n 图片","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| src | string(string.ImageURIString) | - | 图片资源地址 |\n| mode | string | \"scaleToFill\" | 图片裁剪、缩放的模式 [mode](#image-mode-values) |\n| fade-show | boolean | false | 图片显示动画效果 |\n| @error | (event: [UniImageErrorEvent](#uniimageerrorevent)) => void | - | 图片加载错误时触发,event.detail = { errMsg } |\n| @load | (event: [UniImageLoadEvent](#uniimageloadevent)) => void | - | 图片加载完成时触发,event.detail = { width: '图片宽度px', height: '图片高度px' } |\n\n#### mode @image-mode-values \n\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\n\n##### mode 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| scaleToFill | 3.9 | x | - |\n| aspectFit | 3.9 | x | - |\n| aspectFill | 3.9 | x | - |\n| widthFix | 3.9 | x | - |\n| heightFix | 3.9 | x | - |\n| top | 3.9 | x | - |\n| bottom | 3.9 | x | - |\n| center | 3.9 | x | - |\n| left | 3.9 | x | - |\n| right | 3.9 | x | - |\n| top left | 3.9 | x | - |\n| top right | 3.9 | x | - |\n| bottom left | 3.9 | x | - |\n| bottom right | 3.9 | x | - |\n","event":"\n### 事件\n#### UniImageErrorEvent\n\n##### UniImageErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniImageErrorEventDetail](#uniimageerroreventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniImageErrorEventDetail 的属性值 @uniimageerroreventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n\n##### UniImageErrorEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniImageLoadEvent\n\n##### UniImageLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniImageLoadEventDetail](#uniimageloadeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniImageLoadEventDetail 的属性值 @uniimageloadeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| width | number | 是 | - | 图片宽度 |\n| height | number | 是 | - | 图片高度 |\n\n##### UniImageLoadEvent 的方法\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/image/image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/image/image\n>Template\n```vue\n\r\n\r\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 },\r\n methods: {\r\n error(event : ImageErrorEvent) {\r\n this.loadError = true\r\n console.log(event.type, event.detail);\r\n },\r\n load(event : ImageLoadEvent) {\r\n console.log(event.type, event.detail);\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:::","compatibility":"### image 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| src | 3.9 | x | 4.0 |\n| mode | 3.9 | x | 4.0 |\n| fade-show | 3.9 | x | 4.0 |\n| @error | 3.9 | x | - |\n| @load | 3.9 | x | - |\n\n### image 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/image)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/image.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.image)\n"},"input":{"name":"## input","description":"> 组件类型:[UniInputElement](#uniinputelement) \n\n 输入框","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| name | string | - | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| disabled | boolean | false | 是否禁用 |\n| value | string | \"\" | 输入框的初始内容 |\n| type | text \\| number \\| digit \\| tel | \"text\" | input的类型 [type](#input-type-values) |\n| password | boolean | false | 是否是密码类型 |\n| placeholder | string | \"\" | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | 指定 placeholder 的样式 |\n| placeholder-class | string(string.ClassString) | \"\" | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | 140 | 最大输入长度,设置为 -1 的时候不限制最大长度 |\n| cursor-spacing | number | 0 | 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 |\n| cursor-color | string(string.ColorString) | \"\" | 指定光标颜色 |\n| auto-focus | boolean | false | 自动获取焦点 |\n| focus | boolean | false | 获取焦点 |\n| confirm-type | send \\| search \\| next \\| go \\| done | \"done\" | 设置键盘右下角按钮的文字 [confirm-type](#input-confirm-type-values) |\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| hold-keyboard | boolean | false | focus时,点击页面的时候不收起键盘 |\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\n#### type @input-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| text | 文本输入键盘 |\n| number | 数字输入键盘 |\n| digit | 带小数点数字输入键盘 |\n| tel | 电话输入键盘 |\n\n\n##### type 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| text | 3.9 | x | - |\n| number | 3.9 | x | - |\n| digit | 3.9 | x | - |\n| tel | 3.9 | x | - |\n\n\n#### confirm-type @input-confirm-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| send | 发送 |\n| search | 搜索 |\n| next | 下一个 |\n| go | 前往 |\n| done | 完成 |\n\n\n##### confirm-type 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| send | 3.9 | x | - |\n| search | 3.9 | x | - |\n| next | 3.9 | x | - |\n| go | 3.9 | x | - |\n| done | 3.9 | x | - |\n","event":"\n### 事件\n#### UniInputEvent\n\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputEventDetail](#uniinputeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputEventDetail 的属性值 @uniinputeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 光标的位置 |\n| keyCode | number | 是 | - | 输入字符的Unicode值 |\n\n##### UniInputEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputFocusEvent\n\n##### UniInputFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputFocusEventDetail](#uniinputfocuseventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputFocusEventDetail 的属性值 @uniinputfocuseventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| value | string | 是 | - | 输入框内容 |\n\n###### UniInputFocusEventDetail 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| height | √ | - | 4.0 |\n\n##### UniInputFocusEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputBlurEvent\n\n##### UniInputBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputBlurEventDetail](#uniinputblureventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputBlurEventDetail 的属性值 @uniinputblureventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 选择区域的起始位置 |\n\n##### UniInputBlurEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputKeyboardHeightChangeEvent\n\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputKeyboardHeightChangeEventDetail](#uniinputkeyboardheightchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputKeyboardHeightChangeEventDetail 的属性值 @uniinputkeyboardheightchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| duration | number | 是 | - | 持续时间 |\n\n##### UniInputKeyboardHeightChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputConfirmEvent\n\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputConfirmEventDetail](#uniinputconfirmeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputConfirmEventDetail 的属性值 @uniinputconfirmeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n\n##### UniInputConfirmEvent 的方法\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/input/input.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/input/input\n>Template\n```vue\n\r\n\r\n\r\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: \"\",\r\n inputFocusKeyBoardChangeValue: true,\r\n holdKeyboard: false\r\n }\r\n },\r\n methods: {\r\n inputFocusKeyBoardChange(e : InputKeyboardHeightChangeEvent) {\r\n this.inputFocusKeyBoardChangeValue = e.detail.height > 50\r\n },\r\n onMaxLengthInput(event : InputEvent) {\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 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 clearInput: function (event : InputEvent) {\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 : InputEvent) {\r\n console.log(\"键盘输入\", JSON.stringify(event.detail));\r\n this.inputEventDetail = JSON.stringify(event.detail)\r\n },\r\n onFocus: function (event : InputFocusEvent) {\r\n console.log(\"输入框聚焦\", JSON.stringify(event.detail));\r\n this.focusAndBlurEventDetail = JSON.stringify(event.detail);\r\n },\r\n onBlur: function (event : InputBlurEvent) {\r\n console.log(\"输入框失去焦点\", JSON.stringify(event.detail));\r\n this.focusAndBlurEventDetail = JSON.stringify(event.detail);\r\n },\r\n onConfirm: function (event : InputConfirmEvent) {\r\n console.log(\"点击完成按钮\", JSON.stringify(event.detail));\r\n this.confirmEventDetail = JSON.stringify(event.detail);\r\n },\r\n onKeyborardHeightChange: function (event : InputKeyboardHeightChangeEvent) {\r\n console.log(\"键盘高度发生变化\", JSON.stringify(event.detail));\r\n this.keyboardHeightChangeEventDetail = JSON.stringify(event.detail);\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 }\r\n }\r\n\n```\n\n:::","compatibility":"### input 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| disabled | 3.9 | x | - |\n| value | 3.9 | x | - |\n| type | 3.9 | x | - |\n| password | 3.9 | x | - |\n| placeholder | 3.9 | x | - |\n| placeholder-style | 3.9 | x | - |\n| placeholder-class | 3.9 | x | - |\n| maxlength | 3.9 | x | - |\n| cursor-spacing | 3.9 | x | 4.0 |\n| cursor-color | 3.99 | x | - |\n| auto-focus | 3.9 | x | - |\n| focus | 3.9 | x | - |\n| confirm-type | 3.9 | x | - |\n| confirm-hold | 3.9 | x | - |\n| cursor | 3.9 | x | - |\n| selection-start | 3.9 | x | - |\n| selection-end | 3.9 | x | - |\n| adjust-position | 3.9 | x | 4.0 |\n| hold-keyboard | 4.0 | x | 4.0 |\n| @input | 3.9 | x | - |\n| @focus | 3.9 | x | - |\n| @blur | 3.9 | x | - |\n| @keyboardheightchange | 3.9 | x | 4.0 |\n| @confirm | 3.9 | x | - |\n\n### input 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/input)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/input.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.input)\n","component_type":"### UniInputElement\n\ninput元素对象\n#### UniInputElement 的属性值\n| 名称 | 类型 | 必填 | 描述 |\n| :- | :- | :- | :- |\n| name | string | 是 | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交\n |\n| type | string | 是 | input的类型\n |\n| disabled | boolean | 是 | 是否禁用\n |\n| autofocus | boolean | 是 | 自动获取焦点\n |\n| value | string | 是 | 输入框的初始内容\n |"},"list-item":{"name":"## list-item","description":"> 组件类型:UniListItemElement \n\n list-view组件的唯一合法子组件。每个item是一行","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| type | number | 0 | 对应list-item的类型 list-view 将对同类型条目进行复用,所以合理的类型拆分,可以很好地提升 list-view 性能 |","event":"","example":"","compatibility":"### list-item 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| type | 3.9 | - | - |\n\n### list-item 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | - |\n","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.list-item)\n"},"sticky-header":{"name":"## sticky-header","description":"> 组件类型:UniStickyHeaderElement \n\n 吸顶布局容器 \n\n 注意:暂时仅支持作为list-view、sticky-section的子节点, sticky-header不支持css样式!当一个容器视图设置多个sticky-header时,后一个sticky-header会停靠在前一个sticky-header的末尾处。","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\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-header/sticky-header.uvue) \n ```vue\n\n\n\n\n\n\n```","compatibility":"### sticky-header 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| padding | 3.98 | - | - |\n\n### sticky-header 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.93 | - | - |\n","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.sticky-header)\n"},"sticky-section":{"name":"## sticky-section","description":"> 组件类型:UniStickySectionElement \n\n 吸顶布局容器 \n\n 注意:暂时仅支持作为list-view的子节点, sticky-section不支持css样式!","attrubute":"### 属性 \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 ```vue\n\r\n\r\n\r\n\r\n\r\n\n```","compatibility":"### sticky-section 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| push-pinned-header | 3.98 | - | - |\n| padding | 3.98 | - | - |\n\n### sticky-section 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.98 | - | - |\n","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.sticky-section)\n"},"list-view":{"name":"## list-view","description":"> 组件类型:UniListViewElement \n\n 列表组件","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| direction | string | \"vertical\" | 滚动方向,可取值 none、all、horizontal、vertical,默认值vertical [direction](#list-view-direction-values) |\n| ~~scroll-x~~ | boolean | false | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-y~~ | boolean | true | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~rebound~~ | boolean | true | 控制是否回弹效果。已废弃,请改用bounces |\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) | - | 值应为某子元素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 表示不使用默认样式 [refresher-default-style](#list-view-refresher-default-style-values) |\n| refresher-background | string(string.ColorString) | \"#FFF\" | 设置下拉刷新区域背景颜色 |\n| refresher-triggered | boolean | false | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\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\n#### direction @list-view-direction-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| none | 禁止滚动 |\n| all | 横向竖向都可滚动 app端不支持 |\n| horizontal | 横向滚动 |\n| vertical | 竖向滚动 |\n\n\n##### direction 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| none | 4.0 | - | - |\n| all | 4.0 | - | - |\n| horizontal | 4.0 | - | - |\n| vertical | 4.0 | - | - |\n\n\n#### refresher-default-style @list-view-refresher-default-style-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| black | 深颜色雪花样式 |\n| white | 浅白色雪花样式 |\n| none | 不使用默认样式 |\n\n\n##### refresher-default-style 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| black | 3.9 | - | - |\n| white | 3.9 | - | - |\n| none | 3.93 | - | - |\n","event":"\n### 事件\n#### UniRefresherEvent\n\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRefresherEventDetail](#unirefreshereventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRefresherEventDetail 的属性值 @unirefreshereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dy | number | 是 | - | - |\n\n##### UniRefresherEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToUpperEvent\n\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToUpperEventDetail](#uniscrolltouppereventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToUpperEventDetail 的属性值 @uniscrolltouppereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 top 或 left |\n\n##### UniScrollToUpperEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToLowerEvent\n\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToLowerEventDetail](#uniscrolltolowereventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToLowerEventDetail 的属性值 @uniscrolltolowereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 bottom 或 right |\n\n##### UniScrollToLowerEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollEvent\n\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollEventDetail](#uniscrolleventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollEventDetail 的属性值 @uniscrolleventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| scrollTop | number | 是 | - | 竖向滚动的距离 |\n| scrollLeft | number | 是 | - | 横向滚动的距离 |\n| scrollHeight | number | 是 | - | 滚动区域的高度 |\n| scrollWidth | number | 是 | - | 滚动区域的宽度 |\n| deltaY | number | 是 | - | 当次滚动事件竖向滚动量 |\n| deltaX | number | 是 | - | 当次滚动事件横向滚动量 |\n\n##### UniScrollEvent 的方法\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/list-view/list-view.uvue) \n ```vue\n\n\n\n\n\n\n```","compatibility":"### list-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| direction | 4.0 | - | - |\n| scroll-x | 3.9 | - | - |\n| scroll-y | 3.9 | - | - |\n| rebound | 3.9 | - | - |\n| bounces | 4.0 | - | - |\n| upper-threshold | 3.9 | - | - |\n| lower-threshold | 3.9 | - | - |\n| scroll-top | 3.9 | - | - |\n| scroll-left | 3.9 | - | - |\n| show-scrollbar | 3.9 | - | - |\n| scroll-into-view | 3.9 | - | - |\n| scroll-with-animation | 3.9 | - | - |\n| refresher-enabled | 3.9 | - | - |\n| refresher-threshold | 3.9 | - | - |\n| refresher-max-drag-distance | 3.9 | - | - |\n| refresher-default-style | 3.9 | - | - |\n| refresher-background | 3.9 | - | - |\n| refresher-triggered | 3.9 | - | - |\n| custom-nested-scroll | 3.9 | - | - |\n| @refresherpulling | 3.9 | - | - |\n| @refresherrefresh | 3.9 | - | - |\n| @refresherrestore | 3.9 | - | - |\n| @refresherabort | 3.9 | - | - |\n| @scrolltoupper | 3.9 | - | - |\n| @scrolltolower | 3.9 | - | - |\n| @scroll | 3.9 | - | - |\n| @scrollend | 3.9 | - | - |\n\n### list-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | - |\n","children":"### 子组件 @children-tags \n - [list-item](#list-item)\n- [sticky-header](https://uniapp.dcloud.net.cn/uni-app-x/component/sticky.html#sticky-header)\n- [sticky-section](https://uniapp.dcloud.net.cn/uni-app-x/component/sticky.html#sticky-section)","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.list-view)\n"},"navigator":{"name":"## navigator","description":"> 组件类型:UniNavigatorElement \n\n 页面链接","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| target | string | - | 在哪个目标上发生跳转,默认当前应用 |\n| url | string(string.PageURIString) | - | 当前应用内的跳转链接 |\n| open-type | string | \"navigate\" | 跳转方式 [open-type](#navigator-open-type-values) |\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| animation-type | string | \"pop-in/out\" | 当 open-type=\"navigateTo\" 或 open-type=\"navigateBack\" 时有效,窗口的显示/关闭的动画类型。 [animation-type](#navigator-animation-type-values) |\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\n#### open-type @navigator-open-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| navigate | 对应 wx.navigateTo 或 wx.navigateToMiniProgram 的功能 |\n| redirect | 对应 wx.redirectTo 的功能 |\n| switchTab | 对应 wx.switchTab 的功能 |\n| reLaunch | 对应 wx.reLaunch 的功能 |\n| navigateBack | 对应 wx.navigateBack 的功能 |\n\n\n\n#### animation-type @navigator-animation-type-values \n\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\n","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>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'navigator'\n }\n }\n }\n\n```\n\n:::","compatibility":"### navigator 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| url | 3.9 | x | 4.0 |\n| open-type | 3.9 | x | 4.0 |\n| path | 3.9 | x | 4.0 |\n| animation-type | 3.9 | x | 4.0 |\n| animation-duration | 3.9 | x | 4.0 |\n\n### navigator 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/navigator)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/navigator.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.navigator)\n"},"picker-view-column":{"name":"## picker-view-column","description":"仅可放置于 picker-view 中,其子节点未继承 picker-view 的选中框的高度,需要自己设置高度并居中","attrubute":"","event":"","example":"","compatibility":"\n### picker-view-column 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.net.cn/component/picker-view.html#picker-view-column)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/picker-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.picker-view-column)\n"},"picker-view":{"name":"## picker-view","description":"> 组件类型:UniPickerViewElement \n\n 嵌入页面的滚动选择器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| value | array\\ | - | picker-view-column 选择的第几项 |\n| indicator-style | string(string.CSSString) | - | 设置选择器中间选中框的样式 |\n| mask-top-style | string(string.CSSString) | - | 设置蒙层上半部分的样式 |\n| mask-bottom-style | string(string.CSSString) | - | 设置蒙层下半部分的样式 |\n| @change | (event: [UniPickerViewChangeEvent](#unipickerviewchangeevent)) => void | - | 当滚动选择,value 改变时触发 change 事件,event.detail = {value: value};value为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0 \t\t开始) |","event":"\n### 事件\n#### UniPickerViewChangeEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | Array\\ | 是 | - | - |\n\n##### UniPickerViewChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniPickerViewChangeEventDetail](#unipickerviewchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniPickerViewChangeEventDetail 的属性值 @unipickerviewchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | Array\\ | 是 | - | - |\n\n##### UniPickerViewChangeEvent 的方法\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/picker-view/picker-view.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/picker-view/picker-view\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n const date = new Date()\r\n const _years : number[] = []\r\n const _year = date.getFullYear()\r\n const _months : number[] = []\r\n const _month : number = date.getMonth() + 1\r\n const _days : number[] = []\r\n const _day = date.getDate()\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 maskTopStyle: '',\r\n maskBottomStyle: ''\r\n }\r\n },\r\n methods: {\r\n bindChange(e : UniPickerViewChangeEvent) {\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, 0, 0] 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:::","compatibility":"### picker-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| value | √ | x | 4.0 |\n| indicator-style | √ | x | 4.0 |\n| mask-top-style | √ | x | x |\n| mask-bottom-style | √ | x | x |\n| @change | √ | x | 4.0 |\n\n### picker-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [picker-view-column](#picker-view-column)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/picker-view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/picker-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.picker-view)\n"},"progress":{"name":"## progress","description":"> 组件类型:UniProgressElement \n\n 进度条","attrubute":"### 属性 \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| color | string(string.ColorString) | - | 进度条颜色 (请使用 activeColor) |\n| activeColor | string(string.ColorString) | \"#09BB07\" | 已选择的进度条的颜色 |\n| backgroundColor | string(string.ColorString) | \"#EBEBEB\" | 未选择的进度条的颜色 |\n| active | boolean | false | 进度条从左往右的动画 |\n| active-mode | string | \"backwards\" | backwards: 动画从头播;forwards:动画从上次结束点接着播 [active-mode](#progress-active-mode-values) |\n| @activeend | (event: [UniProgressActiveendEvent](#uniprogressactiveendevent)) => void | - | 动画完成事件 |\n\n#### active-mode @progress-active-mode-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| backwards | 动画从头播 |\n| forwards | 动画从上次结束点接着播 |\n\n","event":"\n### 事件\n#### UniProgressActiveendEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | number | 是 | - | - |\n\n##### UniProgressActiveendEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniProgressActiveendEventDetail](#uniprogressactiveendeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniProgressActiveendEventDetail 的属性值 @uniprogressactiveendeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| curPercent | number | 是 | - | - |\n\n##### UniProgressActiveendEvent 的方法\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/progress/progress.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/progress/progress\n>Template\n```vue\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'\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 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 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:::","compatibility":"### progress 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| duration | √ | x | 4.0 |\n| percent | √ | x | 4.0 |\n| show-info | √ | x | 4.0 |\n| border-radius | √ | x | x |\n| font-size | √ | x | x |\n| stroke-width | √ | x | 4.0 |\n| activeColor | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| active | √ | x | 4.0 |\n| active-mode | √ | x | 4.0 |\n| @activeend | √ | x | x |\n\n### progress 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/progress)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/progress.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.progress)\n"},"radio":{"name":"## radio","description":"> 组件类型:UniRadioElement \n\n 单选项。在1组radio-group中只能选中1个","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| disabled | boolean | false | 是否禁用 |\n| value | string | - | \\ 标识。当该radio 选中时,radio-group的 change 事件会携带radio的value |\n| checked | boolean | false | \\ 当前是否选中 |\n| color | string(string.ColorString) | \"#007AFF\" | radio的颜色 |\n| backgroundColor | string(string.ColorString) | \"#ffffff\" | radio默认的背景颜色 |\n| borderColor | string(string.ColorString) | \"#d1d1d1\" | radio默认的边框颜色 |\n| activeBackgroundColor | string(string.ColorString) | \"#007AFF\" | radio选中时的背景颜色,优先级大于color属性 |\n| activeBorderColor | string(string.ColorString) | \"\" | radio选中时的边框颜色 |\n| iconColor | string(string.ColorString) | \"#ffffff\" | radio的图标颜色 |","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>Template\n```vue\n\r\n\r\n\r\n\r\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\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 methods: {\r\n radioChange(e : UniRadioGroupChangeEvent) {\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 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:::","compatibility":"### radio 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| disabled | √ | x | 4.0 |\n| value | √ | x | 4.0 |\n| checked | √ | x | 4.0 |\n| color | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| borderColor | √ | x | 4.0 |\n| activeBackgroundColor | √ | x | 4.0 |\n| activeBorderColor | √ | x | 4.0 |\n| iconColor | √ | x | 4.0 |\n\n### radio 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/radio)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/radio-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.radio)\n"},"radio-group":{"name":"## radio-group","description":"> 组件类型:UniRadioGroupElement \n\n 单选组,内部由多个 radio 组成","attrubute":"### 属性 \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##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | - |\n\n##### UniRadioGroupChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRadioGroupChangeEventDetail](#uniradiogroupchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRadioGroupChangeEventDetail 的属性值 @uniradiogroupchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | string | 是 | - | - |\n\n##### UniRadioGroupChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n","example":"","compatibility":"### radio-group 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| @change | √ | x | 4.0 |\n\n### radio-group 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [radio](#radio)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/radio)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/radio-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.radio-group)\n"},"form":{"name":"## form","description":"> 组件类型:UniFormElement \n\n 表单","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| disabled | boolean | - | 是否禁用 |\n| @submit | (event: [UniFormSubmitEvent](#uniformsubmitevent)) => void | - | 携带 form 中的数据触发 submit 事件,event.detail = {value : {'name': 'value'}} |\n| @reset | (event: [UniFormResetEvent](#uniformresetevent)) => void | - | 表单重置时会触发 reset 事件 |","event":"\n### 事件\n#### UniFormSubmitEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | - |\n\n##### UniFormSubmitEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniFormSubmitEventDetail](#uniformsubmiteventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniFormSubmitEventDetail 的属性值 @uniformsubmiteventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | - |\n\n##### UniFormSubmitEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniFormResetEvent\n\n##### 构造函数\n##### UniFormResetEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniFormResetEventDetail](#uniformreseteventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniFormResetEventDetail 的属性值 @uniformreseteventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n\n##### UniFormResetEvent 的方法\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/form/form.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/form/form\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n nickname: '',\n gender: '0',\n age: 18,\n loves: ['0'],\n switch: true,\n formData: {} as UTSJSONObject\n }\n },\n computed: {\n formDataText() : string {\n return JSON.stringify(this.formData)\n }\n },\n methods: {\n onFormSubmit: function (e : UniFormSubmitEvent) {\n this.formData = e.detail.value\n },\n onFormReset: function (_ : UniFormResetEvent) {\n this.formData = {}\n }\n }\n }\n\n```\n\n:::","compatibility":"### form 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| disabled | 3.97 | x | 4.0 |\n\n### form 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/form)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/form.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form)\n"},"rich-text":{"name":"## rich-text","description":"> 组件类型:UniRichTextElement \n\n 富文本。可渲染文字样式、图片、超链接。支持部分HTML标签","attrubute":"### 属性 \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={ ref \\| src \\| href } |","event":"\n### 事件\n#### UniRichTextItemClickEvent\n\n##### UniRichTextItemClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRichTextItemClickEventDetail](#unirichtextitemclickeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRichTextItemClickEventDetail 的属性值 @unirichtextitemclickeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ref | string | 否 | - | 自定义数据 |\n| src | string | 否 | - | \\图片链接 |\n| href | string | 否 | - | \\超链接 |\n\n##### UniRichTextItemClickEvent 的方法\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/rich-text/rich-text.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/rich-text/rich-text\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n\n\n```\n\n:::","compatibility":"### rich-text 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| nodes | 3.9 | x | - |\n| selectable | 3.9 | - | 4.0 |\n| @itemclick | 3.9 | x | - |\n\n### rich-text 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/rich-text)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/rich-text.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.rich-text)\n"},"scroll-view":{"name":"## scroll-view","description":"> 组件类型:UniScrollViewElement \n\n 可滚动视图容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| direction | string | \"vertical\" | 滚动方向,可取值 none、all、horizontal、vertical,默认值vertical [direction](#scroll-view-direction-values) |\n| ~~scroll-x~~ | boolean | false | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-y~~ | boolean | true | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~rebound~~ | boolean | true | 控制是否回弹效果。已废弃,请改用bounces |\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) | - | 值应为某子元素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 表示不使用默认样式 [refresher-default-style](#scroll-view-refresher-default-style-values) |\n| refresher-background | string(string.ColorString) | \"#FFF\" | 设置下拉刷新区域背景颜色 |\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) | \"\" | 嵌套滚动子元素的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 ture表示与子元素开启滚动协商 默认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\n#### direction @scroll-view-direction-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| none | 禁止滚动 |\n| all | 横向竖向都可滚动 app端不支持 |\n| horizontal | 横向滚动 |\n| vertical | 竖向滚动 |\n\n\n##### direction 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| none | 4.0 | - | - |\n| all | 4.0 | - | - |\n| horizontal | 4.0 | - | - |\n| vertical | 4.0 | - | - |\n\n\n#### refresher-default-style @scroll-view-refresher-default-style-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| black | 深颜色雪花样式 |\n| white | 浅白色雪花样式 |\n| none | 不使用默认样式 |\n\n\n##### refresher-default-style 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| black | 3.9 | - | - |\n| white | 3.9 | - | - |\n| none | 3.9 | - | - |\n","event":"\n### 事件\n#### UniRefresherEvent\n\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRefresherEventDetail](#unirefreshereventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRefresherEventDetail 的属性值 @unirefreshereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dy | number | 是 | - | - |\n\n##### UniRefresherEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToUpperEvent\n\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToUpperEventDetail](#uniscrolltouppereventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToUpperEventDetail 的属性值 @uniscrolltouppereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 top 或 left |\n\n##### UniScrollToUpperEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToLowerEvent\n\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToLowerEventDetail](#uniscrolltolowereventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToLowerEventDetail 的属性值 @uniscrolltolowereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 bottom 或 right |\n\n##### UniScrollToLowerEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollEvent\n\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollEventDetail](#uniscrolleventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollEventDetail 的属性值 @uniscrolleventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| scrollTop | number | 是 | - | 竖向滚动的距离 |\n| scrollLeft | number | 是 | - | 横向滚动的距离 |\n| scrollHeight | number | 是 | - | 滚动区域的高度 |\n| scrollWidth | number | 是 | - | 滚动区域的宽度 |\n| deltaY | number | 是 | - | 当次滚动事件竖向滚动量 |\n| deltaX | number | 是 | - | 当次滚动事件横向滚动量 |\n\n##### UniScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniStartNestedScrollEvent\n\n##### UniStartNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| node | [UniElement](/dom/unielement.md) | 是 | - | 开始滚动子节点对象 |\n| isTouch | boolean | 是 | - | 是否由触摸行为发生的Event |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n\n##### UniStartNestedScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniNestedPreScrollEvent\n\n##### UniNestedPreScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| deltaX | number | 是 | - | x轴滚动距离 |\n| deltaY | number | 是 | - | y轴滚动距离 |\n| isTouch | boolean | 是 | - | 是否由触摸行为发生的Event |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n\n##### UniNestedPreScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| consumed | (consumedX: number, consumedY: number) => void | 是 | - | 通知到子节点x,y轴滚动距离的消耗 |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniStopNestedScrollEvent\n\n##### UniStopNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| isTouch | boolean | 是 | - | 是否由触摸行为发生的Event |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n\n##### UniStopNestedScrollEvent 的方法\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/scroll-view/scroll-view.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/scroll-view/scroll-view\n>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n scrollTop: 0,\n oldScrollTop: 0,\n showScrollbar: true\n }\n },\n methods: {\n upper: function (e : ScrollToUpperEvent) {\n console.log(e)\n },\n lower: function (e : ScrollToLowerEvent) {\n console.log(e)\n },\n scroll: function (e : ScrollEvent) {\n this.oldScrollTop = e.detail.scrollTop\n },\n goTop: function () {\n // 解决view层不同步的问题\n this.scrollTop = this.oldScrollTop\n this.$nextTick(function () {\n this.scrollTop = 0\n })\n uni.showToast({\n icon: 'none',\n title: '纵向滚动 scrollTop 值已被修改为 0',\n })\n }\n },\n }\n\n```\n\n:::","compatibility":"### scroll-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| direction | 4.0 | - | 4.0 |\n| scroll-x | 3.9 | - | 4.0 |\n| scroll-y | 3.9 | - | 4.0 |\n| rebound | 3.9 | - | - |\n| bounces | 4.0 | - | x |\n| upper-threshold | 3.9 | - | 4.0 |\n| lower-threshold | 3.9 | - | 4.0 |\n| scroll-top | 3.9 | - | 4.0 |\n| scroll-left | 3.9 | - | 4.0 |\n| scroll-into-view | 3.9 | - | 4.0 |\n| scroll-with-animation | 3.9 | - | 4.0 |\n| refresher-enabled | 3.9 | - | x |\n| refresher-threshold | 3.9 | - | x |\n| refresher-max-drag-distance | 3.9 | - | x |\n| refresher-default-style | 3.9 | - | x |\n| refresher-background | 3.9 | - | x |\n| refresher-triggered | 3.9 | - | x |\n| show-scrollbar | 3.9 | - | 4.0 |\n| custom-nested-scroll | 3.9 | - | x |\n| nested-scroll-child | 3.97 | - | x |\n| @refresherpulling | 3.9 | - | x |\n| @refresherrefresh | 3.9 | - | x |\n| @refresherrestore | 3.9 | - | x |\n| @refresherabort | 3.9 | - | x |\n| @scrolltoupper | 3.9 | - | 4.0 |\n| @scrolltolower | 3.9 | - | 4.0 |\n| @scroll | 3.9 | - | 4.0 |\n| @scrollend | 3.9 | - | 4.0 |\n| @startnestedscroll | 3.9 | - | x |\n| @nestedprescroll | 3.9 | - | x |\n| @stopnestedscroll | 3.9 | - | x |\n\n### scroll-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/scroll-view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/scroll-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.scroll-view)\n"},"slider":{"name":"## slider","description":"> 组件类型:UniSliderElement \n\n 滑动选择器","attrubute":"### 属性 \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| activeColor | string(string.ColorString) | \"#007aff\" | slider 滑块左侧已选择部分的线条颜色 |\n| backgroundColor | string(string.ColorString) | \"#e9e9e9\" | radio背景条的颜色 |\n| block-size | number | 28 | radio滑块的大小,取值范围为 12 - 28 |\n| block-color | string(string.ColorString) | \"#ffffff\" | 滑块颜色 |\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} |","event":"\n### 事件\n#### UniSliderChangeEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | number | 是 | - | - |\n\n##### UniSliderChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSliderChangeEventDetail](#unisliderchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSliderChangeEventDetail 的属性值 @unisliderchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | number | 是 | - | - |\n\n##### UniSliderChangeEvent 的方法\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/slider/slider.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/slider/slider\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n sliderValue: 50,\n sliderBlockSize: 20,\n sliderBackgroundColor: \"#000000\",\n sliderActiveColor: \"#FFCC33\",\n sliderBlockColor: \"#8A6DE9\",\n // 组件属性 autotest\n show_value_boolean: false,\n disabled_boolean: false,\n min_input: 0,\n max_input: 100,\n step_input: 1,\n value_input: 0,\n activeColor_input: \"#007aff\",\n backgroundColor_input: \"#e9e9e9\",\n block_size_input: 28,\n block_color_input: \"#ffffff\",\n };\n },\n methods: {\n sliderChange(e : UniSliderChangeEvent) {\n console.log(\"value 发生变化:\" + e.detail.value);\n },\n slider_click() {\n console.log(\"组件被点击时触发\");\n },\n slider_touchstart() {\n console.log(\"手指触摸动作开始\");\n },\n slider_touchmove() {\n console.log(\"手指触摸后移动\");\n },\n slider_touchcancel() {\n console.log(\"手指触摸动作被打断,如来电提醒,弹窗\");\n },\n slider_touchend() {\n console.log(\"手指触摸动作结束\");\n },\n slider_tap() {\n console.log(\"手指触摸后马上离开\");\n },\n slider_longpress() {\n console.log(\n \"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\"\n );\n },\n slider_change() {\n console.log(\"完成一次拖动后触发的事件,event.detail = {value: value}\");\n },\n slider_changing() {\n console.log(\"拖动过程中触发的事件,event.detail = {value: value}\");\n },\n change_show_value_boolean(checked : boolean) {\n this.show_value_boolean = checked;\n },\n change_disabled_boolean(checked : boolean) {\n this.disabled_boolean = checked;\n },\n confirm_min_input(value : number) {\n this.min_input = value;\n },\n confirm_max_input(value : number) {\n this.max_input = value;\n },\n confirm_step_input(value : number) {\n this.step_input = value;\n },\n confirm_value_input(value : number) {\n this.value_input = value;\n },\n confirm_activeColor_input(value : string) {\n this.activeColor_input = value;\n },\n confirm_backgroundColor_input(value : string) {\n this.backgroundColor_input = value;\n },\n confirm_block_size_input(value : number) {\n this.block_size_input = value;\n },\n confirm_block_color_input(value : string) {\n this.block_color_input = value;\n },\n },\n };\n\n```\n\n:::","compatibility":"### slider 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| disabled | 3.9 | x | 4.0 |\n| min | 3.9 | x | 4.0 |\n| max | 3.9 | x | 4.0 |\n| step | 3.9 | x | 4.0 |\n| value | 3.9 | x | 4.0 |\n| activeColor | 3.9 | x | 4.0 |\n| backgroundColor | 3.9 | x | 4.0 |\n| block-size | 3.9 | x | 4.0 |\n| block-color | 3.9 | x | 4.0 |\n| show-value | 3.9 | x | 4.0 |\n| @change | 3.9 | x | 4.0 |\n| @changing | 3.9 | x | 4.0 |\n\n### slider 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/slider)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/slider.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.slider)\n"},"swiper-item":{"name":"## swiper-item","description":"> 组件类型:UniSwiperItemElement \n\n swiper的唯一合法子组件。每个swiper-item代表一个滑块。宽高自动设置为100%","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| item-id | string | - | 该 swiper-item 的标识符 |","event":"","example":"","compatibility":"### swiper-item 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| item-id | 3.9 | x | 4.0 |\n\n### swiper-item 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.net.cn/component/swiper.html#swiper-item)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/swiper.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.swiper-item)\n"},"swiper":{"name":"## swiper","description":"> 组件类型:UniSwiperElement \n\n 滑块视图容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| indicator-dots | boolean | false | 是否显示面板指示点 |\n| indicator-color | string(string.ColorString) | \"rgba(0, 0, 0, .3)\" | 指示点颜色 |\n| indicator-active-color | string(string.ColorString) | \"#000000\" | 当前选中的指示点颜色 |\n| disable-touch | boolean | false | 是否禁止用户 touch 操作 |\n| autoplay | boolean | false | 是否自动切换 |\n| current | number | 0 | 当前所在滑块的 index |\n| current-item-id | string | - | 当前所在滑块的 item-id ,不能与 current 被同时指定 |\n| interval | number | 3000 | 自动切换时间间隔 |\n| circular | boolean | false | 是否采用衔接滑动 |\n| vertical | boolean | false | 滑动方向是否为纵向 |\n| rebound | boolean | false | 控制是否回弹效果 |\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##### UniSwiperChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwiperChangeEventDetail](#uniswiperchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwiperChangeEventDetail 的属性值 @uniswiperchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| current | number | 是 | - | 发生change事件的滑块下标 |\n| source | string | 是 | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n##### UniSwiperChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniSwiperTransitionEvent\n\n##### UniSwiperTransitionEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwiperTransitionEventDetail](#uniswipertransitioneventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwiperTransitionEventDetail 的属性值 @uniswipertransitioneventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dx | number | 是 | - | 横向偏移量,单位是逻辑像素px |\n| dy | number | 是 | - | 纵向偏移量,单位是逻辑像素px |\n\n##### UniSwiperTransitionEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniSwiperAnimationFinishEvent\n\n##### UniSwiperAnimationFinishEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwiperAnimationFinishEventDetail](#uniswiperanimationfinisheventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwiperAnimationFinishEventDetail 的属性值 @uniswiperanimationfinisheventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| current | number | 是 | - | 发生动画结束事件的滑块下标 |\n| source | string | 是 | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n##### UniSwiperAnimationFinishEvent 的方法\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/swiper/swiper.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/swiper/swiper\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\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 },\r\n methods: {\r\n\r\n swiperChange: function (e : SwiperChangeEvent) {\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 : SwiperTransitionEvent) {\r\n if (this.swiperTransitionSelect) {\r\n console.log(\"swiperTransition\")\r\n console.log(e)\r\n }\r\n },\r\n swiperAnimationfinish: function (e : SwiperAnimationFinishEvent) {\r\n if (this.swiperAnimationfinishSelect) {\r\n console.log(\"swiperAnimationfinish\")\r\n console.log(e)\r\n }\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:::","compatibility":"### swiper 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| indicator-dots | 3.9 | x | 4.0 |\n| indicator-color | 3.9 | x | 4.0 |\n| indicator-active-color | 3.9 | x | 4.0 |\n| disable-touch | 3.9 | x | - |\n| autoplay | 3.9 | x | 4.0 |\n| current | 3.9 | x | 4.0 |\n| current-item-id | 3.9 | x | 4.0 |\n| interval | 3.9 | x | 4.0 |\n| circular | 3.9 | x | 4.0 |\n| vertical | 3.9 | x | 4.0 |\n| rebound | 3.9 | x | - |\n| @change | 3.9 | x | 4.0 |\n| @transition | 3.9 | x | 4.0 |\n| @animationfinish | 3.9 | x | 4.0 |\n\n### swiper 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [swiper-item](#swiper-item)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/swiper)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/swiper.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.swiper)\n"},"switch":{"name":"## switch","description":"> 组件类型:UniSwitchElement \n\n 开关选择器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| name | string | - | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| checked | boolean | - | 是否选中 |\n| color | string(string.ColorString) | - | switch 的颜色,同 css 的 color |\n| disabled | boolean | - | 是否禁用 |\n| @change | (event: [UniSwitchChangeEvent](#uniswitchchangeevent)) => void | - | checked 改变时触发 change 事件,event.detail={ value:checked} |","event":"\n### 事件\n#### UniSwitchChangeEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | boolean | 是 | - | - |\n\n##### UniSwitchChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwitchChangeEventDetail](#uniswitchchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwitchChangeEventDetail 的属性值 @uniswitchchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | boolean | 是 | - | - |\n\n##### UniSwitchChangeEvent 的方法\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/switch/switch.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/switch/switch\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'switch 开关',\n checked: true,\n color: '#FFCC33',\n clickCheckedValue: true\n }\n },\n methods: {\n switch1Change: function (e : UniSwitchChangeEvent) {\n this.clickCheckedValue = e.detail.value\n console.log('switch1 发生 change 事件,携带值为', e.detail.value)\n },\n switch2Change: function (e : UniSwitchChangeEvent) {\n console.log('switch2 发生 change 事件,携带值为', e.detail.value)\n }\n }\n }\n\n```\n\n:::","compatibility":"### switch 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| checked | 3.9 | x | 4.0 |\n| color | 3.9 | x | 4.0 |\n| disabled | 3.9 | x | 4.0 |\n| @change | 3.9 | x | 4.0 |\n\n### switch 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/switch)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/switch.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.switch)\n"},"text":{"name":"## text","description":"> 组件类型:[UniTextElement](#unitextelement) \n\n 文本","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| selectable | boolean | false | 文本是否可选 |\n| space | string | - | 显示连续空格 [space](#text-space-values) |\n| decode | boolean | false | 是否解码 |\n\n#### space @text-space-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| ensp | 中文字符空格一半大小 |\n| emsp | 中文字符空格大小 |\n| nbsp | 根据字体设置的空格大小 |\n\n\n##### space 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| ensp | 3.9 | x | - |\n| emsp | 3.9 | x | - |\n| nbsp | 3.9 | x | - |\n","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>Template\n```vue\n\n\r\n\r\n\r\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:::","compatibility":"### text 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| selectable | 3.9 | x | 4.0 |\n| space | 3.9 | x | 4.0 |\n| decode | 3.9 | x | - |\n\n### text 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n - [text](#text)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/text)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/text.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.text)\n","component_type":"### UniTextElement\n\ntext元素对象\n#### UniTextElement 的属性值\n| 名称 | 类型 | 必填 | 描述 |\n| :- | :- | :- | :- |\n| value | string | 是 | 只读属性 text元素的文案内容 |\n#### UniTextElement 的方法\n##### getTextExtra() @gettextextra\n\n\n###### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any | 否 | \n\n\n"},"textarea":{"name":"## textarea","description":"> 组件类型:[UniTextareaElement](#unitextareaelement) \n\n 多行输入框","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| name | string | - | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| value | string | \"\" | 输入框的初始内容 |\n| placeholder | string | \"\" | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | 指定 placeholder 的样式 |\n| placeholder-class | string(string.ClassString) | \"\" | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | 140 | 最大输入长度,设置为 -1 的时候不限制最大长度 |\n| auto-focus | boolean | false | 自动获取焦点 |\n| focus | boolean | false | 获取焦点 |\n| cursor | number | 0 | 指定focus时的光标位置 |\n| confirm-hold | boolean | false | 点击键盘右下角按钮时是否保持键盘不收起 |\n| auto-height | boolean | false | 是否自动增高,设置auto-height时,style.height不生效 |\n| cursor-spacing | number | 0 | 指定光标与键盘的距离,单位 px 。取 textarea 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 |\n| cursor-color | string(string.ColorString) | \"\" | 指定光标颜色 |\n| selection-start | number | -1 | 光标起始位置,自动聚集时有效,需与selection-end搭配使用 |\n| selection-end | number | -1 | 光标结束位置,自动聚集时有效,需与selection-satrt搭配使用 |\n| adjust-position | boolean | true | 键盘弹起时,是否自动上推页面 |\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 起支持 |","event":"\n### 事件\n#### UniInputConfirmEvent\n\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputConfirmEventDetail](#uniinputconfirmeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputConfirmEventDetail 的属性值 @uniinputconfirmeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n\n##### UniInputConfirmEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputEvent\n\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputEventDetail](#uniinputeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputEventDetail 的属性值 @uniinputeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 光标的位置 |\n| keyCode | number | 是 | - | 输入字符的Unicode值 |\n\n##### UniInputEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniTextareaLineChangeEvent\n\n##### UniTextareaLineChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniTextareaLineChangeEventDetail](#unitextarealinechangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniTextareaLineChangeEventDetail 的属性值 @unitextarealinechangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| lineCount | number | 是 | - | 行数 |\n| heightRpx | number | 是 | - | textarea的高度 |\n| height | number | 是 | - | textarea的高度 |\n\n##### UniTextareaLineChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniTextareaBlurEvent\n\n##### UniTextareaBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniTextareaBlurEventDetail](#unitextareablureventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniTextareaBlurEventDetail 的属性值 @unitextareablureventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 选择区域的起始位置 |\n\n##### UniTextareaBlurEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputKeyboardHeightChangeEvent\n\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputKeyboardHeightChangeEventDetail](#uniinputkeyboardheightchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputKeyboardHeightChangeEventDetail 的属性值 @uniinputkeyboardheightchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| duration | number | 是 | - | 持续时间 |\n\n##### UniInputKeyboardHeightChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniTextareaFocusEvent\n\n##### UniTextareaFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniTextareaFocusEventDetail](#unitextareafocuseventdetail-values) | 是 | - | - |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniTextareaFocusEventDetail 的属性值 @unitextareafocuseventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| value | string | 是 | - | 输入框内容 |\n\n###### UniTextareaFocusEventDetail 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| height | √ | - | 4.0 |\n\n##### UniTextareaFocusEvent 的方法\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/textarea/textarea.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/textarea/textarea\n>Template\n```vue\n\r\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\nimport { ItemType } from '@/components/enum-data/enum-data'\r\nexport default {\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tadjust_position_boolean: false,\r\n\t\t\tshow_confirm_bar_boolean: false,\r\n\t\t\tfixed_boolean: false,\r\n\t\t\tauto_height_boolean: false,\r\n\t\t\tconfirm_hold_boolean: false,\r\n\t\t\tfocus_boolean: true,\r\n\t\t\tauto_focus_boolean: false,\n default_value:\"\",\n maxlength:-1,\r\n\t\t\tinputmode_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[],\n cursor_color: \"#3393E2\",\r\n\t\t\tinputmode_enum_current: 0\r\n\t\t}\r\n\t},\n\r\n\tmethods: {\r\n\t\ttextarea_click() { console.log(\"组件被点击时触发\") },\r\n\t\ttextarea_touchstart() { console.log(\"手指触摸动作开始\") },\r\n\t\ttextarea_touchmove() { console.log(\"手指触摸后移动\") },\r\n\t\ttextarea_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n\t\ttextarea_touchend() { console.log(\"手指触摸动作结束\") },\r\n\t\ttextarea_tap() { console.log(\"手指触摸后马上离开\") },\r\n\t\ttextarea_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n\t\ttextarea_confirm() { console.log(\"点击完成时, 触发 confirm 事件,event.detail = {value: value}\") },\r\n\t\ttextarea_input() { console.log(\"当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上\") },\r\n\t\ttextarea_linechange() { console.log(\"输入框行数变化时调用,event.detail = {height: 0, height: 0, lineCount: 0}\") },\r\n\t\ttextarea_blur() { console.log(\"输入框失去焦点时触发,event.detail = {value, cursor}\") },\r\n\t\ttextarea_keyboardheightchange() { console.log(\"键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration}\") },\r\n\t\ttextarea_focus() { console.log(\"输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\") },\r\n\t\tchange_adjust_position_boolean(checked : boolean) { this.adjust_position_boolean = checked },\r\n\t\tchange_show_confirm_bar_boolean(checked : boolean) { this.show_confirm_bar_boolean = checked },\r\n\t\tchange_fixed_boolean(checked : boolean) { this.fixed_boolean = checked },\r\n\t\tchange_auto_height_boolean(checked : boolean) { this.auto_height_boolean = checked },\r\n\t\tchange_confirm_hold_boolean(checked : boolean) { this.confirm_hold_boolean = checked },\r\n\t\tchange_focus_boolean(checked : boolean) { this.focus_boolean = checked },\r\n\t\tchange_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked },\n change_cursor_color_boolean(checked : boolean) { if(checked){ this.cursor_color = \"transparent\"} else {this.cursor_color = \"#3393E2\"}},\r\n\t\tradio_change_inputmode_enum(checked : number) { this.inputmode_enum_current = checked }\r\n\t}\r\n}\r\n\n```\n\n:::","compatibility":"### textarea 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| value | 3.9 | x | - |\n| placeholder | 3.9 | x | - |\n| placeholder-style | 3.9 | x | - |\n| placeholder-class | 3.9 | x | - |\n| maxlength | 3.9 | x | - |\n| auto-focus | 3.9 | x | - |\n| focus | 3.9 | x | - |\n| cursor | 3.9 | x | - |\n| confirm-hold | 3.9 | x | - |\n| auto-height | 3.9 | x | - |\n| cursor-spacing | 3.9 | x | 4.0 |\n| cursor-color | 3.99 | x | - |\n| selection-start | 3.9 | x | - |\n| selection-end | 3.9 | x | - |\n| adjust-position | 3.9 | x | 4.0 |\n| hold-keyboard | 4.0 | x | 4.0 |\n| @confirm | 3.9 | x | - |\n| @input | 3.9 | x | - |\n| @linechange | 3.9 | x | - |\n| @blur | 3.9 | x | - |\n| @keyboardheightchange | 3.9 | x | 4.0 |\n| @focus | 3.9 | x | - |\n\n### textarea 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/textarea)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/textarea.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.textarea)\n","component_type":"### UniTextareaElement\n\ntextarea元素对象\n#### UniTextareaElement 的属性值\n| 名称 | 类型 | 必填 | 描述 |\n| :- | :- | :- | :- |\n| name | string | 是 | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交\n |\n| type | string | 是 | input的类型\n |\n| disabled | boolean | 是 | 是否禁用\n |\n| autofocus | boolean | 是 | 自动获取焦点\n |\n| value | string | 是 | 输入框的初始内容\n |"},"video":{"name":"## video","description":"> 组件类型:[UniVideoElement](#univideoelement) \n\n 视频","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| loop | boolean | false | 是否循环播放 |\n| src | string(string.VideoURIString) | - | 视频资源地址 |\n| initial-time | number | - | 指定视频初始播放位置 |\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 | -90 | 设置全屏时视频的方向,不指定则根据宽高比自动判断。有效值为 0(正常竖向), 90(屏幕逆时针90度), -90(屏幕顺时针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| objectFit | string | \"contain\" | 当视频大小与 video 容器大小不一致时,视频的表现形式。 [objectFit](#video-objectFit-values) |\n| poster | string | - | 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效 |\n| show-mute-btn | boolean | false | 是否显示静音按钮 |\n| title | string | - | 视频的标题,全屏时在顶部展示 |\n| play-btn-position | string | - | 播放按钮的位置 |\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| @play | (event: [UniEvent](/component/common#unievent)) => void | - | 当开始/继续播放时触发 |\n| @pause | (event: [UniEvent](/component/common#unievent)) => void | - | 当暂停播放时触发 |\n| @ended | (event: [UniEvent](/component/common#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#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\n#### objectFit @video-objectFit-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| contain | 包含 |\n| fill | 填充 |\n| cover | 覆盖 |\n\n\n##### objectFit 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| contain | 3.9 | x | - |\n| fill | 3.9 | x | - |\n| cover | 3.9 | x | - |\n","event":"\n### 事件\n#### UniVideoTimeUpdateEvent\n\ntimeupdate 事件\n播放进度变化时触发\n##### UniVideoTimeUpdateEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoTimeUpdateEventDetail](#univideotimeupdateeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoTimeUpdateEventDetail 的属性值 @univideotimeupdateeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| currentTime | number | 是 | - | 当前进度 |\n| duration | number | 是 | - | 总进度 |\n\n#### UniVideoFullScreenChangeEvent\n\nfullscreenchange 事件\n当视频进入和退出全屏是触发\n##### UniVideoFullScreenChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoFullScreenChangeEventDetail](#univideofullscreenchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoFullScreenChangeEventDetail 的属性值 @univideofullscreenchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fullScreen | boolean | 是 | - | 是否全屏 |\n| direction | string | 是 | - | 横竖屏,取值 vertical 或 horizontal |\n\n#### UniVideoErrorEvent\n\nerror 事件\n视频播放出错时触发\n##### UniVideoErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [VideoError](#videoerror-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - |\n| timeStamp | Long | 是 | - | - |\n\n###### VideoError 的属性值 @videoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100001 \\\\| 200001 \\\\| 300001 | 是 | - | 统一错误码
100001 网络错误
200001 内部错误
300001 SDK错误 |\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#### UniVideoProgressEvent\n\nprogress 事件\n加载进度变化时触发\n##### UniVideoProgressEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoProgressEventDetail](#univideoprogresseventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoProgressEventDetail 的属性值 @univideoprogresseventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| buffered | number | 是 | - | 加载进度百分比 |\n\n#### UniVideoFullScreenClickEvent\n\nfullscreenclick 事件\n视频播放全屏播放时点击事件\n##### UniVideoFullScreenClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoFullScreenClickEventDetail](#univideofullscreenclickeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoFullScreenClickEventDetail 的属性值 @univideofullscreenclickeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| screenX | number | 是 | - | 点击点相对于屏幕左侧边缘的 X 轴坐标 |\n| screenY | number | 是 | - | 点击点相对于屏幕顶部边缘的 Y 轴坐标 |\n| screenWidth | number | 是 | - | 屏幕总宽度 |\n| screenHeight | number | 是 | - | 屏幕总高度 |\n\n#### UniVideoControlsToggleEvent\n\ncontrolstoggle 事件\n切换播放控件显示隐藏时触发\n##### UniVideoControlsToggleEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoControlsToggleEventDetail](#univideocontrolstoggleeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | - |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | - |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoControlsToggleEventDetail 的属性值 @univideocontrolstoggleeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| show | boolean | 是 | - | 是否显示 |\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>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n onReady() {\n this.videoContext = uni.createVideoContext('video', this);\n },\n data() {\n return {\n videoContext: null as VideoContext | null,\n // 属性\n src: \"https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4\",\n _src: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app-video-courses.mp4\",\n autoplay: false,\n loop: false,\n muted: false,\n initialTime: 0,\n _initialTime: 6,\n duration: -1,\n _duration: 60,\n controls: true,\n danmuList: [{\n text: '要显示的文本',\n color: '#FF0000',\n time: 3\n }, {\n text: '要显示的文本2',\n color: '#31ff23',\n time: 5\n }, {\n text: '要显示的文本3',\n color: '#f13ef8',\n time: 7\n }, {\n text: '要显示的文本4',\n color: '#4972f8',\n time: 9\n }, {\n text: '要显示的文本5',\n color: '#000000',\n time: 11\n }] as Array,\n danmuBtn: false,\n enableDanmu: true,\n pageGesture: false,\n direction: -90,\n _direction: 0,\n requestFullScreenOptions: {\n direction: -90\n } as RequestFullScreenOptions,\n showProgress: true,\n showFullscreenBtn: true,\n showPlayBtn: true,\n showCenterPlayBtn: true,\n showLoading: true,\n enableProgressGesture: true,\n objectFit: \"contain\",\n _objectFit: \"fill\",\n poster: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-android.png\",\n _poster: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-ios.png\",\n showMuteBtn: false,\n title: \"video-component\",\n _title: \"video-component video-component\",\n enablePlayGesture: false,\n vslideGesture: false,\n vslideGestureInFullscreen: true,\n codec: \"hardware\",\n _codec: \"software\",\n httpCache: true,\n playStrategy: 0,\n _playStrategy: 2,\n header: {\n 'User-Agent': 'header test'\n } as UTSJSONObject,\n _header: {\n 'User-Agent': 'header test2'\n } as UTSJSONObject,\n // API\n pos: 10,\n rate: 1.5,\n danmu: {\n text: '要显示的文本',\n color: '#FF0000'\n } as Danmu,\n // 自动化测试\n isPlaying: false,\n isPause: false,\n isFullScreen: false\n }\n },\n onLoad() {\n // #ifdef WEB\n this.muted = true // web端非静音视频不可自动播放\n // #endif\n },\n methods: {\n // API\n play: function () {\n console.log(\"play\");\n this.videoContext?.play();\n },\n pause: function () {\n console.log(\"pause\");\n (uni.getElementById(\"video\") as UniVideoElement).pause(); //as写法测试。注意id不对时as会崩溃\n // this.videoContext?.pause();\n },\n seek: function (pos : number) {\n console.log(\"seek -> \" + pos);\n this.videoContext?.seek(pos);\n },\n requestFullScreen: function (options : RequestFullScreenOptions | null) {\n console.log(\"requestFullScreen -> \" + options);\n this.videoContext?.requestFullScreen(options);\n },\n exitFullScreen: function () {\n console.log(\"exitFullScreen\");\n this.videoContext?.exitFullScreen();\n },\n stop: function () {\n console.log(\"stop\");\n uni.getElementById(\"video\")?.stop(); //泛型写法测试\n // this.videoContext?.stop();\n },\n sendDanmu: function (danmu : Danmu) {\n console.log(\"sendDanmu -> \" + danmu);\n this.videoContext?.sendDanmu(danmu);\n },\n playbackRate: function (rate : number) {\n console.log(\"playbackRate -> \" + rate);\n this.videoContext?.playbackRate(rate);\n },\n // 属性\n setSrc: function (src : string) {\n this.src = src;\n console.log(\"src -> \" + this.src)\n },\n setAutoplay: function () {\n this.autoplay = !this.autoplay;\n console.log(\"autoplay -> \" + this.autoplay)\n },\n setLoop: function () {\n this.loop = !this.loop;\n console.log(\"loop -> \" + this.loop)\n },\n setMuted: function () {\n this.muted = !this.muted;\n console.log(\"muted -> \" + this.muted)\n },\n setInitialTime: function (initialTime : number) {\n this.initialTime = initialTime;\n console.log(\"initialTime -> \" + this.initialTime)\n },\n setDuration: function (duration : number) {\n this.duration = duration;\n console.log(\"duration -> \" + this.duration)\n },\n setControls: function () {\n this.controls = !this.controls;\n console.log(\"controls -> \" + this.controls)\n },\n setDanmuBtn: function () {\n this.danmuBtn = !this.danmuBtn;\n console.log(\"danmuBtn -> \" + this.danmuBtn)\n },\n setPageGesture: function () {\n this.pageGesture = !this.pageGesture;\n console.log(\"pageGesture -> \" + this.pageGesture)\n },\n setDirection: function (direction : number) {\n this.direction = direction;\n console.log(\"direction -> \" + this.direction)\n },\n setShowProgress: function () {\n this.showProgress = !this.showProgress;\n console.log(\"showProgress -> \" + this.showProgress)\n },\n setShowFullscreenBtn: function () {\n this.showFullscreenBtn = !this.showFullscreenBtn;\n console.log(\"showFullscreenBtn -> \" + this.showFullscreenBtn)\n },\n setShowPlayBtn: function () {\n this.showPlayBtn = !this.showPlayBtn;\n console.log(\"showPlayBtn -> \" + this.showPlayBtn)\n },\n setShowCenterPlayBtn: function () {\n this.showCenterPlayBtn = !this.showCenterPlayBtn;\n console.log(\"showCenterPlayBtn -> \" + this.showCenterPlayBtn)\n },\n setShowLoading: function () {\n this.showLoading = !this.showLoading;\n console.log(\"showLoading -> \" + this.showLoading)\n },\n setEnableProgressGesture: function () {\n this.enableProgressGesture = !this.enableProgressGesture;\n console.log(\"enableProgressGesture -> \" + this.enableProgressGesture)\n },\n setObjectFit: function (objectFit : string) {\n this.objectFit = objectFit;\n console.log(\"objectFit -> \" + this.objectFit)\n },\n setPoster: function (poster : string) {\n this.poster = poster;\n console.log(\"poster -> \" + this.poster)\n },\n setShowMuteBtn: function () {\n this.showMuteBtn = !this.showMuteBtn;\n console.log(\"showMuteBtn -> \" + this.showMuteBtn)\n },\n setTitle: function (title : string) {\n this.title = title;\n console.log(\"title -> \" + this.title)\n },\n setEnablePlayGesture: function () {\n this.enablePlayGesture = !this.enablePlayGesture;\n console.log(\"enablePlayGesture -> \" + this.enablePlayGesture)\n },\n setVslideGesture: function () {\n this.vslideGesture = !this.vslideGesture;\n console.log(\"vslideGesture -> \" + this.vslideGesture)\n },\n setVslideGestureInFullscreen: function () {\n this.vslideGestureInFullscreen = !this.vslideGestureInFullscreen;\n console.log(\"vslideGestureInFullscreen -> \" + this.vslideGestureInFullscreen)\n },\n setCodec: function (codec : string) {\n this.codec = codec;\n console.log(\"codec -> \" + this.codec)\n },\n setHttpCache: function () {\n this.httpCache = !this.httpCache;\n console.log(\"httpCache -> \" + this.httpCache)\n },\n setPlayStrategy: function (playStrategy : number) {\n this.playStrategy = playStrategy;\n console.log(\"playStrategy -> \" + this.playStrategy)\n },\n setHeader: function (header : UTSJSONObject) {\n this.header = header;\n console.log(\"header -> \" + this.header)\n },\n // 事件\n onPlay: function (res : UniEvent) {\n console.log(res.type);\n this.isPlaying = true;\n this.isPause = false;\n },\n onPause: function (res : UniEvent) {\n console.log(res.type);\n this.isPlaying = false;\n this.isPause = true;\n },\n onEnded: function (res : UniEvent) {\n console.log(res.type);\n },\n onTimeUpdate: function (res : UniVideoTimeUpdateEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onFullScreenChange: function (res : UniVideoFullScreenChangeEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n this.isFullScreen = !this.isFullScreen;\n },\n onWaiting: function (res : UniEvent) {\n console.log(res.type);\n },\n onError: function (res : UniVideoErrorEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onProgress: function (res : UniVideoProgressEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onFullScreenClick: function (res : UniVideoFullScreenClickEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onControlsToggle: function (res : UniVideoControlsToggleEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n }\n }\n }\n\n```\n\n:::","compatibility":"### video 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| loop | 3.9 | x | - |\n| src | 3.9 | x | - |\n| initial-time | 3.9 | x | - |\n| duration | 3.9 | x | - |\n| controls | 3.9 | x | - |\n| danmu-list | 3.9 | x | - |\n| danmu-btn | 3.9 | x | - |\n| enable-danmu | 3.9 | x | - |\n| autoplay | 3.9 | x | - |\n| muted | 3.9 | x | - |\n| page-gesture | 3.9 | x | - |\n| direction | 3.9 | x | 4.0 |\n| show-progress | 3.9 | x | - |\n| show-fullscreen-btn | 3.9 | x | - |\n| show-play-btn | 3.9 | x | - |\n| show-center-play-btn | 3.9 | x | - |\n| show-loading | 3.9 | x | 4.0 |\n| enable-progress-gesture | 3.9 | x | - |\n| objectFit | 3.9 | x | - |\n| poster | 3.9 | x | - |\n| show-mute-btn | 3.9 | x | 4.0 |\n| title | 3.9 | x | 4.0 |\n| play-btn-position | x | - | 4.0 |\n| enable-play-gesture | 3.9 | x | 4.0 |\n| auto-pause-if-navigate | x | - | 4.0 |\n| auto-pause-if-open-native | x | - | 4.0 |\n| vslide-gesture | 3.9 | x | 4.0 |\n| vslide-gesture-in-fullscreen | 3.9 | x | 4.0 |\n| ad-unit-id | x | - | x |\n| poster-for-crawler | x | - | 4.0 |\n| codec | 3.9 | x | x |\n| http-cache | 3.9 | x | x |\n| play-strategy | 3.9 | x | 4.0 |\n| is-live | x | - | 4.0 |\n| @play | 3.9 | x | - |\n| @pause | 3.9 | x | - |\n| @ended | 3.9 | x | - |\n| @timeupdate | 3.9 | x | - |\n| @fullscreenchange | 3.9 | x | - |\n| @waiting | 3.9 | x | - |\n| @error | 3.9 | x | - |\n| @progress | 3.9 | x | - |\n| @fullscreenclick | 3.9 | x | 4.0 |\n| @controlstoggle | 3.9 | x | 4.0 |\n\n### video 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/video)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/video.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.video)\n","component_type":"### UniVideoElement\n\nvideo元素对象\n#### UniVideoElement 的方法\n##### play() @play\n\n播放\n\n\n\n\n##### pause() @pause\n\n暂停\n\n\n\n\n##### seek(position) @seek\n\n跳转到指定位置\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| position | number | 是 | - | 跳转到指定位置(秒) |\n\n\n\n##### stop() @stop\n\n停止视频\n\n\n\n\n##### sendDanmu(danmu) @senddanmu\n\n发送弹幕\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| danmu | [Danmu](#danmu-values) | 是 | - | 弹幕数据 |\n###### Danmu 的属性值 @danmu-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string | 否 | - | 弹幕文字 |\n| color | string | 否 | - | 弹幕颜色 |\n| time | number | 否 | - | 显示时刻 |\n\n\n\n\n##### playbackRate(rate) @playbackrate\n\n设置倍速播放\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| rate | number | 是 | - | 支持倍率 0.5/0.8/1.0/1.25/1.5 |\n\n\n\n##### requestFullScreen(direction?) @requestfullscreen\n\n进入全屏\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | [RequestFullScreenOptions](#requestfullscreenoptions-values) | 否 | - | 0\\|正常竖向, 90\\|屏幕逆时针90度, -90\\|屏幕顺时针90度 |\n###### RequestFullScreenOptions 的属性值 @requestfullscreenoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | number | 否 | - | direction - 0: 正常竖向 - 90: 屏幕逆时针90度 - -90: 屏幕顺时针90度 |\n\n\n\n\n##### exitFullScreen() @exitfullscreen\n\n退出全屏\n\n\n\n"},"unicloud-db":{"name":"## unicloud-db","description":"> 组件类型:UniCloudDBElement \n\n 是一个数据库查询组件,它将clientDB的API封装为组件,进一步减少开发者使用所需的代码量。","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| id | string(string.IDString) | - | 唯一标识 |\n| v-slot:default | string | - | {data, loading, hasMore, pagination, error} [v-slot:default](#unicloud-db-v-slot-default-values) |\n| collection | string(string.DBCollectionString) | - | 表名 |\n| field | string(string.DBFieldString) | - | 查询字段,多个字段用 `,` 分割 |\n| where | string(string.JQLString) | - | 查询条件 |\n| orderby | string | - | 排序字段及正序倒叙设置 |\n| groupby | string | - | 对数据进行分组 |\n| group-field | string | - | 对数据进行分组统计 |\n| distinct | boolean | - | 是否对数据查询结果中重复的记录进行去重 [distinct](#unicloud-db-distinct-values) |\n| page-data | string | - | add 多次查询的集合, replace 当前查询的集合 [page-data](#unicloud-db-page-data-values) |\n| page-current | number | - | 当前页 |\n| page-size | number | - | 每页数据数量 |\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 [loadtime](#unicloud-db-loadtime-values) |\n| @load | (data : Array\\, ended : boolean, pagination : [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | - | 成功回调。如联网返回结果后,想修改下数据再渲染界面,则在本方法里对data进行修改 |\n| @error | (event: [UniEvent](/component/common#unievent)) => void | - | 失败回调 |\n\n#### v-slot:default @unicloud-db-v-slot-default-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| data | 查询结果,类型为Array\\ |\n| loading | 查询中的状态。可根据此状态,在template中通过v-if显示等待内容 |\n| hasMore | 是否有更多数据。可根据此状态,在template中通过v-if显示没有更多数据了 |\n| error | 查询错误。可根据此状态,在template中通过v-if显示等待内容 |\n| pagination | 分页属性 [v-slot:default](#unicloud-db-v-slot-default-values) |\n\n\n\n##### pagination @unicloud-db-v-slot-default-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| current | 当前页号 |\n| size | 分页大小 |\n| count | 数据库的总数据量, 设置 :getcount=true 时有效 |\n\n\n\n#### distinct @unicloud-db-distinct-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| true | 去重 |\n| false | 不去重 |\n\n\n\n#### page-data @unicloud-db-page-data-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| add | 多次查询的集合 |\n| replace | 当前查询的集合 |\n\n\n\n#### loadtime @unicloud-db-loadtime-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| auto | 页面就绪后或属性变化后加载数据,默认为auto |\n| onready | 页面就绪后不自动加载数据,属性变化后加载。适合在onLoad中接收上个页面的参数作为where条件时 |\n| manual | 手动模式,不自动加载数据。如果涉及到分页,需要先手动修改当前页,在调用加载数据 |\n\n","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 ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/unicloud-db/unicloud-db\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n const db = uniCloud.databaseForJQL()\n\n export default {\n data() {\n return {\n collection: 'unicloud-db-test',\n collectionList: [\n db.collection('book').where('name == \"水浒传\"').getTemp(),\n ] as UTSJSONObject[],\n $uniCloudElement: null as UniCloudDBElement | null,\n $isTesting: false,\n $addResult: {},\n $updateResult: {},\n $removeResult: {}\n }\n },\n onReady() {\n this.$uniCloudElement = this.$refs['udb'] as UniCloudDBElement\n this.get();\n },\n onPullDownRefresh() {\n this.$uniCloudElement!.loadData({\n clear: true,\n success: (_ : UniCloudDBGetResult) => {\n uni.stopPullDownRefresh()\n }\n })\n },\n methods: {\n loadMore() {\n this.$uniCloudElement!.loadMore()\n },\n get() {\n this.$uniCloudElement!.loadData({\n clear: true\n })\n },\n add() {\n const value = {\n title: \"title-\" + Date.now(),\n comment: \"comment\" + Date.now()\n };\n this.$uniCloudElement!.add(value, {\n showToast: false,\n success: (res : UniCloudDBAddResult) => {\n this.$addResult = {\n id: res.id\n };\n this.get();\n },\n fail: (err : any | null) => {\n this.showError(err)\n }\n })\n },\n update(id : string) {\n const value = {\n title: \"title-\" + Date.now(),\n comment: \"comment\" + Date.now()\n };\n this.$uniCloudElement!.update(id, value, {\n showToast: false,\n needLoading: true,\n needConfirm: false,\n loadingTitle: \"正在更新...\",\n success: (res : UniCloudDBUpdateResult) => {\n this.$updateResult = {\n updated: res.updated\n }\n },\n fail: (err : any | null) => {\n this.showError(err)\n }\n })\n },\n remove(id : string) {\n this.$uniCloudElement!.remove(id, {\n showToast: false,\n needConfirm: false,\n needLoading: false,\n success: (res : UniCloudDBRemoveResult) => {\n this.$removeResult = {\n deleted: res.deleted\n }\n },\n fail: (err : any | null) => {\n this.showError(err)\n }\n })\n },\n onQueryLoad(data : Array, ended : boolean, pagination : UTSJSONObject) {\n console.log(data, ended, pagination);\n },\n showError(err : any | null) {\n const error = err as UniCloudError\n uni.showModal({\n content: error.errMsg,\n showCancel: false\n })\n }\n }\n }\n\n```\n\n:::","compatibility":"### unicloud-db 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| v-slot:default | 3.93 | x | 4.0 |\n| collection | 3.93 | x | 4.0 |\n| field | 3.93 | x | 4.0 |\n| where | 3.93 | x | 4.0 |\n| orderby | 3.93 | x | 4.0 |\n| groupby | 3.93 | x | 4.0 |\n| group-field | 3.93 | x | 4.0 |\n| distinct | 3.93 | x | 4.0 |\n| page-data | 3.93 | x | 4.0 |\n| page-current | 3.93 | x | 4.0 |\n| page-size | 3.93 | x | 4.0 |\n| getcount | 3.93 | x | 4.0 |\n| gettree | 3.93 | x | 4.0 |\n| startwith | 3.93 | x | 4.0 |\n| limitlevel | 3.93 | x | 4.0 |\n| manual | 3.93 | x | 4.0 |\n| loadtime | 3.93 | x | 4.0 |\n| @load | 3.93 | x | 4.0 |\n| @error | 3.93 | x | 4.0 |\n\n### unicloud-db 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.93 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [unicloud-db组件教程](https://uniapp.dcloud.io/uniCloud/unicloud-db)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/unicloud-db.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.unicloud-db)\n"},"view":{"name":"## view","description":"> 组件类型:UniViewElement \n\n 基本视图容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| hover-class | string(string.ClassString) | \"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>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n import { ItemType } from '@/components/enum-data/enum-data'\n export default {\n data() {\n return {\n hover_class: false,\n stop_propagation: false,\n start_time: 50,\n stay_time: 400,\n start_time_enum: [{ \"value\": 50, \"name\": \"50毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[],\n stay_time_enum: [{ \"value\": 400, \"name\": \"400毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[]\n }\n },\n methods: {\n change_hover_class_boolean(checked : boolean) {\n this.hover_class = checked\n },\n change_stop_propagation_boolean(checked : boolean) {\n this.stop_propagation = checked\n },\n radio_change_start_time_enum(time : number) {\n this.start_time = time\n },\n radio_change_stay_time_enum(time : number) {\n this.stay_time = time\n },\n },\n }\n\n```\n\n:::","compatibility":"### view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| hover-class | 3.9 | - | 4.0 |\n| hover-stop-propagation | 3.9 | - | 4.0 |\n| hover-start-time | 3.9 | - | 4.0 |\n| hover-stay-time | 3.9 | - | 4.0 |\n\n### view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view)\n"},"web-view":{"name":"## web-view","description":"> 组件类型:[UniWebViewElement](#uniwebviewelement) \n\n 承载网页的容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| src | string(string.URIString) | - | webview 指向网页的链接 |\n| webview-styles | [WebViewStyles](#webviewstyles) | {\"progress\":{\"color\":\"#00FF00\"}} | webview 网络地址页面加载进度条样式 |\n| @message | (event: [UniWebViewMessageEvent](#uniwebviewmessageevent)) => void | - | 网页向应用 postMessage 时触发。e.detail = { data } |\n| @error | (event: [UniWebViewErrorEvent](#uniwebviewerrorevent)) => void | - | 网页加载错误时触发。e.detail = { errSubject, errCode, errMsg } |\n| @load | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | 网页加载完成后触发。e.detail = { url } |\n| ~~@loaded~~ | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | 网页加载完成后触发。e.detail = { url }。已废弃,请改用load |\n| @loading | (event: [UniWebViewLoadingEvent](#uniwebviewloadingevent)) => void | - | 网页加载中触发。e.detail = { url } |\n| @download | (event: [UniWebViewDownloadEvent](#uniwebviewdownloadevent)) => void | - | 点击网页中可下载链接时触发。e.detail = { url, userAgent, contentDisposition, mimetype, contentLength } | \n### WebViewStyles \nweb-view组件的样式 \n#### WebViewStyles 的属性值 @webviewstyles-values\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | [WebViewProgressStyles](#webviewprogressstyles-values) \\| boolean | 是 | false | 网络地址页面加载进度条样式,设置为 false 时表示不显示加载进度条。 |\n ### WebViewProgressStyles \nweb-view组件的进度条样式 \n#### WebViewProgressStyles 的属性值 @webviewprogressstyles-values\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| color | string.ColorString | 是 | - | 网页加载进度条颜色,默认值为 #00FF00 。 |\n ","event":"\n### 事件\n#### UniWebViewMessageEvent\n\n##### UniWebViewMessageEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值message |\n| detail | [UniWebViewMessageEventDetail](#uniwebviewmessageeventdetail-values) | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewMessageEventDetail 的属性值 @uniwebviewmessageeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | Map\\ | 否 | - | 消息包含的数据 |\n\n##### UniWebViewMessageEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewErrorEvent\n\n##### UniWebViewErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值error |\n| detail | [UniWebViewErrorEventDetail](#uniwebviewerroreventdetail-values) | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewErrorEventDetail 的属性值 @uniwebviewerroreventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称,固定值uni-web-view |\n| errCode | 100001 \\\\| 100002 \\\\| 100003 | 是 | - | 统一错误码
100001 ssl error
100002 page error
100003 http error |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n\n##### UniWebViewErrorEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewLoadEvent\n\n##### UniWebViewLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值load |\n| detail | [UniWebViewLoadEventDetail](#uniwebviewloadeventdetail-values) | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewLoadEventDetail 的属性值 @uniwebviewloadeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 加载完成的网页链接 |\n\n##### UniWebViewLoadEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewLoadingEvent\n\n##### UniWebViewLoadingEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值loading |\n| detail | [UniWebViewLoadingEventDetail](#uniwebviewloadingeventdetail-values) | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewLoadingEventDetail 的属性值 @uniwebviewloadingeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 加载中的网页链接 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewLoadingEventDetail 的方法 @uniwebviewloadingeventdetail-values \n\n##### stopPropagation() @stoppropagation\n\n阻止当前事件的进一步传播\n\n\n\n\n##### preventDefault() @preventdefault\n\n阻止当前事件的默认行为\n\n\n\n\n##### UniWebViewLoadingEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewDownloadEvent\n\n##### UniWebViewDownloadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值download |\n| detail | [UniWebViewDownloadEventDetail](#uniwebviewdownloadeventdetail-values) | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) | 否 | - | 触发事件的组件 |\n| currentTarget | [UniElement](/dom/unielement.md) | 否 | - | 当前组件 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewDownloadEventDetail 的属性值 @uniwebviewdownloadeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 下载链接 |\n| userAgent | string | 是 | - | 用户代理 |\n| contentDisposition | string | 是 | - | 指示回复的内容该以何种形式展示,是以内联的形式(即网页或者页面的一部分),还是以附件的形式下载并保存到本地 |\n| mimetype | string | 是 | - | 媒体类型 |\n| contentLength | number | 是 | - | 文件大小 |\n\n##### UniWebViewDownloadEvent 的方法\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/web-view/web-view.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/web-view/web-view\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n src: 'https://www.dcloud.io',\n webview_styles: {\n progress: {\n color: '#FF3333'\n }\n },\n webviewContext: null as WebviewContext | null,\n loadError: false\n }\n },\n onReady() {\n // #ifdef APP\n // TODO web 实现createWebviewContext\n this.webviewContext = uni.createWebviewContext('web-view', this)\n // #endif\n },\n methods: {\n back() {\n this.webviewContext?.back();\n },\n forward() {\n this.webviewContext?.forward();\n },\n reload() {\n this.webviewContext?.reload();\n },\n stop() {\n this.webviewContext?.stop();\n },\n nativeToWeb() {\n this.webviewContext?.evalJS(\"alert('hello uni-app x')\");\n },\n message(event : UniWebViewMessageEvent) {\n console.log(JSON.stringify(event));\n },\n error(event : UniWebViewErrorEvent) {\n this.loadError = true\n console.log(JSON.stringify(event));\n },\n loading(event : UniWebViewLoadingEvent) {\n console.log(JSON.stringify(event));\n },\n load(event : UniWebViewLoadEvent) {\n console.log(JSON.stringify(event));\n },\n download(event : UniWebViewDownloadEvent) {\n console.log(JSON.stringify(event));\n uni.showModal({\n content: \"下载链接: \" + event.detail.url + \"\\n文件大小: \" + event.detail.contentLength / 1024 + \"KB\",\n showCancel: false\n });\n },\n confirm(event : UniInputConfirmEvent) {\n console.log(JSON.stringify(event));\n let url = event.detail.value;\n if (!url.startsWith('https://') && !url.startsWith('http://')) {\n url = 'https://' + url;\n }\n this.src = url;\n }\n }\n }\n\n```\n\n:::","compatibility":"### web-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| src | 3.9 | x | 4.0 |\n| webview-styles | 3.9 | - | x |\n| @message | 3.9 | x | x |\n| @error | 3.9 | x | x |\n| @load | 4.0 | x | x |\n| @loading | 3.9 | x | x |\n| @download | 3.9 | x | x |\n\n### web-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/web-view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/web-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.web-view)\n","component_type":"### UniWebViewElement\n\nweb-view元素对象\n#### UniWebViewElement 的方法\n##### back() @back\n\n后退\n\n\n\n\n##### forward() @forward\n\n前进\n\n\n\n\n##### reload() @reload\n\n重新加载\n\n\n\n\n##### stop() @stop\n\n停止加载\n\n\n\n\n##### evalJS(js) @evaljs\n\n原生和WebView通信(执行JS脚本)\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| js | string | 是 | - | - |\n\n\n"}} \ No newline at end of file +{"animation-view":{"name":"## animation-view","description":"Lottie 动画","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| path | string | \"\" | 动画资源地址,目前只支持绝对路径 |\n| loop | boolean | false | 动画是否循环播放 |\n| autoplay | boolean | false | 动画是否自动播放 |\n| action | string | \"stop\" | 动画操作,可取值 play、pause、stop [action](#animation-view-action-values) |\n| hidden | boolean | false | 是否隐藏动画 |\n| @ended | (event: [UniEvent](/component/common#unievent)) => void | - | - |\n\n#### action @animation-view-action-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| play | 播放 |\n| pause | 暂停 |\n| stop | 停止 |\n\n\n##### action 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| play | 3.9 | x | - |\n| pause | 3.9 | x | - |\n| stop | 3.9 | x | - |\n","event":"","example":"","compatibility":"### animation-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| path | 3.9 | x | - |\n| loop | 3.9 | x | - |\n| autoplay | 3.9 | x | - |\n| action | 3.9 | x | - |\n| hidden | 3.9 | x | - |\n| @ended | 3.9 | x | - |\n\n### animation-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | - |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/animation-view)\n- [插件市场](https://ext.dcloud.net.cn/plugin?id=10674)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/animation-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.animation-view)\n"},"button":{"name":"## button","description":"> 组件类型:UniButtonElement \n\n 按钮","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| disabled | boolean | false | 是否禁用 |\n| hover-class | string(string.ClassString) | \"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\" | 按钮的大小 [size](#button-size-values) |\n| type | string | \"default\" | 按钮的样式类型 [type](#button-type-values) |\n| plain | boolean | false | 按钮是否镂空,背景色透明 |\n| loading | boolean | - | 名称前是否带 loading 图标 |\n| form-type | string | - | 用于 form 组件,点击分别会触发 form 组件的 submit/reset 事件 [form-type](#button-form-type-values) |\n| lang | string | - | 指定返回用户信息的语言,zh_CN 简体中文,zh_TW 繁体中文,en 英文。 |\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#unievent)) => void | - | 用户点击该按钮时,会返回获取到的用户信息,回调的detail数据与wx.getUserInfo返回的一致 |\n| @contact | (event: [UniEvent](/component/common#unievent)) => void | - | 客服消息回调 |\n| @getphonenumber | (event: [UniEvent](/component/common#unievent)) => void | - | 获取用户手机号回调 |\n| @opensetting | (event: [UniEvent](/component/common#unievent)) => void | - | 在打开授权设置页后回调 |\n| @launchapp | (event: [UniEvent](/component/common#unievent)) => void | - | 打开 APP 成功的回调 |\n| @chooseavatar | (event: [UniEvent](/component/common#unievent)) => void | - | 获取用户头像回调 |\n| @chooseaddress | (event: [UniEvent](/component/common#unievent)) => void | - | 调起用户编辑并选择收货地址的回调 |\n| @addgroupapp | (event: [UniEvent](/component/common#unievent)) => void | - | 添加群应用的回调 |\n\n#### size @button-size-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| default | 默认大小 |\n| mini | 小尺寸 |\n\n\n##### size 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| default | √ | x | 4.0 |\n| mini | √ | x | 4.0 |\n\n\n#### type @button-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| default | 白色 |\n| primary | 蓝色 |\n| warn | 红色 |\n\n\n##### type 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| default | √ | x | 4.0 |\n| primary | √ | x | 4.0 |\n| warn | √ | x | 4.0 |\n\n\n#### form-type @button-form-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| submit | 提交表单 |\n| reset | 重置表单 |\n\n\n##### form-type 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| submit | √ | x | 4.0 |\n| reset | √ | x | 4.0 |\n","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>Template\n```vue\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'\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: 'uni-app-x'\r\n }\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 }\r\n }\r\n\n```\n\n:::","compatibility":"### button 属性兼容性\n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| disabled | 5.0 | √ | x | 4.0 |\n| hover-class | 5.0 | √ | x | 4.0 |\n| hover-stop-propagation | x | x | x | 4.0 |\n| hover-start-time | 5.0 | √ | x | 4.0 |\n| hover-stay-time | 5.0 | √ | x | 4.0 |\n| size | 5.0 | √ | x | 4.0 |\n| type | 5.0 | √ | x | 4.0 |\n| plain | 5.0 | √ | x | 4.0 |\n| loading | 5.0 | x | x | 4.0 |\n| form-type | 5.0 | √ | x | 4.0 |\n| lang | x | x | x | x |\n| session-from | x | x | x | x |\n| send-message-title | x | x | x | x |\n| send-message-path | x | x | x | x |\n| send-message-img | x | x | x | x |\n| show-message-card | x | x | x | x |\n| app-parameter | x | x | x | x |\n| group-id | x | x | x | x |\n| guild-id | x | x | x | x |\n| public-id | x | x | x | x |\n| @getuserinfo | x | x | x | x |\n| @contact | x | x | x | x |\n| @getphonenumber | x | x | x | x |\n| @opensetting | x | x | x | x |\n| @launchapp | x | x | x | x |\n| @chooseavatar | x | x | x | x |\n| @chooseaddress | x | x | x | x |\n| @addgroupapp | x | x | x | x |\n\n### button 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/button)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/button.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.button)\n"},"checkbox":{"name":"## checkbox","description":"> 组件类型:UniCheckboxElement \n\n 多选项。在1组check-group中可选择多个","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| disabled | boolean | false | 是否禁用 |\n| value | string | - | checkbox 标识,选中时触发 checkbox-group 的 change 事件,并携带 checkbox 的 value |\n| checked | boolean | false | 当前是否选中,可用来设置默认选中 |\n| color | string(string.ColorString) | \"#007aff\" | checkbox的颜色 |\n| backgroundColor | string(string.ColorString) | \"#ffffff\" | checkbox默认的背景颜色 |\n| borderColor | string(string.ColorString) | \"#d1d1d1\" | checkbox默认的边框颜色 |\n| activeBackgroundColor | string(string.ColorString) | \"#ffffff\" | checkbox选中时的背景颜色 |\n| activeBorderColor | string(string.ColorString) | \"#d1d1d1\" | checkbox选中时的边框颜色 |\n| iconColor | string(string.ColorString) | \"#007aff\" | checkbox的图标颜色,优先级大于color属性 |","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>Template\n```vue\n\r\n\r\n\r\n\r\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\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 // 组件属性 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 }\r\n },\r\n methods: {\r\n checkboxChange: function (e : UniCheckboxGroupChangeEvent) {\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 }\r\n }\r\n\n```\n\n:::","compatibility":"### checkbox 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| disabled | √ | x | 4.0 |\n| value | √ | x | 4.0 |\n| checked | √ | x | 4.0 |\n| color | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| borderColor | √ | x | 4.0 |\n| activeBackgroundColor | √ | x | 4.0 |\n| activeBorderColor | √ | x | 4.0 |\n| iconColor | √ | x | 4.0 |\n\n### checkbox 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/checkbox)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/checkbox-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.checkbox)\n"},"checkbox-group":{"name":"## checkbox-group","description":"> 组件类型:UniCheckboxGroupElement \n\n 多项组,内部由多个checkbox组成","attrubute":"### 属性 \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##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | Array\\ | 是 | - | - |\n\n##### UniCheckboxGroupChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniCheckboxGroupChangeEventDetail](#unicheckboxgroupchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniCheckboxGroupChangeEventDetail 的属性值 @unicheckboxgroupchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | Array\\ | 是 | - | - |\n\n##### UniCheckboxGroupChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n","example":"","compatibility":"### checkbox-group 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| @change | √ | x | 4.0 |\n\n### checkbox-group 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [checkbox](#checkbox)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/checkbox)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/checkbox-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.checkbox-group)\n"},"image":{"name":"## image","description":"> 组件类型:UniImageElement \n\n 图片","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| src | string(string.ImageURIString) | - | 图片资源地址 |\n| mode | string | \"scaleToFill\" | 图片裁剪、缩放的模式 [mode](#image-mode-values) |\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' } |\n\n#### mode @image-mode-values \n\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\n\n##### mode 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| scaleToFill | 3.9 | x | 4.0 |\n| aspectFit | 3.9 | x | 4.0 |\n| aspectFill | 3.9 | x | 4.0 |\n| widthFix | 3.9 | x | 4.0 |\n| heightFix | 3.9 | x | 4.0 |\n| top | 3.9 | x | 4.0 |\n| bottom | 3.9 | x | 4.0 |\n| center | 3.9 | x | 4.0 |\n| left | 3.9 | x | 4.0 |\n| right | 3.9 | x | 4.0 |\n| top left | 3.9 | x | 4.0 |\n| top right | 3.9 | x | 4.0 |\n| bottom left | 3.9 | x | 4.0 |\n| bottom right | 3.9 | x | 4.0 |\n","event":"\n### 事件\n#### UniImageErrorEvent\n\n##### UniImageErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniImageErrorEventDetail](#uniimageerroreventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniImageErrorEventDetail 的属性值 @uniimageerroreventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errMsg | string | 是 | - | 错误信息 |\n\n##### UniImageErrorEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniImageLoadEvent\n\n##### UniImageLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniImageLoadEventDetail](#uniimageloadeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniImageLoadEventDetail 的属性值 @uniimageloadeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| width | number | 是 | - | 图片宽度 |\n| height | number | 是 | - | 图片高度 |\n\n##### UniImageLoadEvent 的方法\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/image/image.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/image/image\n>Template\n```vue\n\r\n\r\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 },\r\n methods: {\r\n error(event : ImageErrorEvent) {\r\n this.loadError = true\r\n console.log(event.type, event.detail);\r\n },\r\n load(event : ImageLoadEvent) {\r\n console.log(event.type, event.detail);\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:::","compatibility":"### image 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| src | 3.9 | x | 4.0 |\n| mode | 3.9 | x | 4.0 |\n| lazy-load | x | x | 4.0 |\n| fade-show | 3.9 | x | 4.0 |\n| webp | x | x | 4.0 |\n| show-menu-by-longpress | x | x | 4.0 |\n| draggable | x | x | 4.0 |\n| @error | 3.9 | x | 4.0 |\n| @load | 3.9 | x | 4.0 |\n\n### image 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/image)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/image.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.image)\n"},"input":{"name":"## input","description":"> 组件类型:[UniInputElement](#uniinputelement) \n\n 输入框","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| name | string | - | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| disabled | boolean | false | 是否禁用 |\n| value | string | \"\" | 输入框的初始内容 |\n| type | text \\| number \\| digit \\| tel \\| safe-password \\| nickname | \"text\" | input的类型 [type](#input-type-values) |\n| password | boolean | false | 是否是密码类型 |\n| placeholder | string | \"\" | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | 指定 placeholder 的样式 |\n| placeholder-class | string(string.ClassString) | \"\" | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | 140 | 最大输入长度,设置为 -1 的时候不限制最大长度 |\n| cursor-spacing | number | 0 | 指定光标与键盘的距离,单位 px 。取 input 距离底部的距离和 cursor-spacing 指定的距离的最小值作为光标与键盘的距离 |\n| cursor-color | string(string.ColorString) | \"\" | 指定光标颜色 |\n| auto-focus | boolean | false | 自动获取焦点 |\n| focus | boolean | false | 获取焦点 |\n| confirm-type | send \\| search \\| next \\| go \\| done | \"done\" | 设置键盘右下角按钮的文字 [confirm-type](#input-confirm-type-values) |\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 | - | 文本区域的语义,根据类型自动填充 [text-content-type](#input-text-content-type-values) |\n| hold-keyboard | boolean | false | focus时,点击页面的时候不收起键盘 |\n| controlled | boolean | - | 是否为受控组件。为 true 时,value 内容会完全受 setData 控制 |\n| always-system | boolean | - | 是否强制使用系统键盘和 Web-view 创建的 input 元素。为 true 时,confirm-type、confirm-hold 可能失效 |\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\n#### type @input-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| text | 文本输入键盘 |\n| number | 数字输入键盘 |\n| digit | 带小数点数字输入键盘 |\n| tel | 电话输入键盘 |\n| safe-password | 密码安全输入键盘 |\n| nickname | 昵称输入键盘 |\n\n\n##### type 兼容性\n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| text | 5.0 | 3.9 | x | - |\n| number | 5.0 | 3.9 | x | - |\n| digit | 5.0 | 3.9 | x | - |\n| tel | 5.0 | 3.9 | x | - |\n| safe-password | x | x | x | 4.0 |\n| nickname | x | x | x | 4.0 |\n\n\n#### confirm-type @input-confirm-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| send | 发送 |\n| search | 搜索 |\n| next | 下一个 |\n| go | 前往 |\n| done | 完成 |\n\n\n##### confirm-type 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| send | 3.9 | x | - |\n| search | 3.9 | x | - |\n| next | 3.9 | x | - |\n| go | 3.9 | x | - |\n| done | 3.9 | x | - |\n\n\n#### text-content-type @input-text-content-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| oneTimeCode | 一次性验证码 |\n\n\n##### text-content-type 兼容性\n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| oneTimeCode | x | x | x | 4.0 |\n","event":"\n### 事件\n#### UniInputEvent\n\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputEventDetail](#uniinputeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputEventDetail 的属性值 @uniinputeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 光标的位置 |\n| keyCode | number | 是 | - | 输入字符的Unicode值 |\n\n##### UniInputEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputFocusEvent\n\n##### UniInputFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputFocusEventDetail](#uniinputfocuseventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputFocusEventDetail 的属性值 @uniinputfocuseventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| value | string | 是 | - | 输入框内容 |\n\n###### UniInputFocusEventDetail 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| height | √ | - | 4.0 |\n\n##### UniInputFocusEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputBlurEvent\n\n##### UniInputBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputBlurEventDetail](#uniinputblureventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputBlurEventDetail 的属性值 @uniinputblureventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 选择区域的起始位置 |\n\n##### UniInputBlurEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputKeyboardHeightChangeEvent\n\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputKeyboardHeightChangeEventDetail](#uniinputkeyboardheightchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputKeyboardHeightChangeEventDetail 的属性值 @uniinputkeyboardheightchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| duration | number | 是 | - | 持续时间 |\n\n##### UniInputKeyboardHeightChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputConfirmEvent\n\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputConfirmEventDetail](#uniinputconfirmeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputConfirmEventDetail 的属性值 @uniinputconfirmeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n\n##### UniInputConfirmEvent 的方法\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/input/input.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/input/input\n>Template\n```vue\n\r\n\r\n\r\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: \"\",\r\n inputFocusKeyBoardChangeValue: true,\r\n holdKeyboard: false\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;\n },\n onCursorBlurChange(){\n this.cursor = 0\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;\n },\n onSelectionBlurChange(){\n this.selectionEnd = 0;\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 },\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 }\r\n }\r\n\n```\n\n:::","compatibility":"### input 属性兼容性\n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| name | 5.0 | 3.9 | x | 4.0 |\n| disabled | 5.0 | 3.9 | x | 4.0 |\n| value | 5.0 | 3.9 | x | 4.0 |\n| type | 5.0 | 3.9 | x | - |\n| password | 5.0 | 3.9 | x | 4.0 |\n| placeholder | 5.0 | 3.9 | x | 4.0 |\n| placeholder-style | 5.0 | 3.9 | x | 4.0 |\n| placeholder-class | 5.0 | 3.9 | x | 4.0 |\n| maxlength | 5.0 | 3.9 | x | 4.0 |\n| cursor-spacing | 5.0 | 3.9 | x | 4.0 |\n| cursor-color | 5.0 | 3.99 | x | - |\n| auto-focus | 5.0 | 3.9 | x | 4.0 |\n| focus | 5.0 | 3.9 | x | 4.0 |\n| confirm-type | 5.0 | 3.9 | x | - |\n| always-embed | x | x | x | 4.0 |\n| confirm-hold | 5.0 | 3.9 | x | 4.0 |\n| cursor | 5.0 | 3.9 | x | 4.0 |\n| selection-start | 5.0 | 3.9 | x | 4.0 |\n| selection-end | 5.0 | 3.9 | x | 4.0 |\n| adjust-position | 5.0 | 3.9 | x | 4.0 |\n| text-content-type | x | x | x | 4.0 |\n| hold-keyboard | 5.0 | 4.0 | x | 4.0 |\n| controlled | x | x | x | 4.0 |\n| always-system | x | x | x | 4.0 |\n| @input | 5.0 | 3.9 | x | 4.0 |\n| @focus | 5.0 | 3.9 | x | 4.0 |\n| @blur | 5.0 | 3.9 | x | 4.0 |\n| @keyboardheightchange | 5.0 | 3.9 | x | 4.0 |\n| @confirm | 5.0 | 3.9 | x | 4.0 |\n\n### input 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/input)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/input.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.input)\n","component_type":"### UniInputElement\n\ninput元素对象\n#### UniInputElement 的属性值\n| 名称 | 类型 | 必填 | 描述 |\n| :- | :- | :- | :- |\n| name | string | 是 | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交\n |\n| type | string | 是 | input的类型\n |\n| disabled | boolean | 是 | 是否禁用\n |\n| autofocus | boolean | 是 | 自动获取焦点\n |\n| value | string | 是 | 输入框的初始内容\n |"},"list-item":{"name":"## list-item","description":"> 组件类型:UniListItemElement \n\n list-view组件的唯一合法子组件。每个item是一行","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| type | number | 0 | 对应list-item的类型 list-view 将对同类型条目进行复用,所以合理的类型拆分,可以很好地提升 list-view 性能 |","event":"","example":"","compatibility":"### list-item 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| type | 3.9 | - | 4.0 |\n\n### list-item 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.02 |\n","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.list-item)\n"},"sticky-header":{"name":"## sticky-header","description":"> 组件类型:UniStickyHeaderElement \n\n 吸顶布局容器 \n\n 注意:暂时仅支持作为list-view、sticky-section的子节点, sticky-header不支持css样式!当一个容器视图设置多个sticky-header时,后一个sticky-header会停靠在前一个sticky-header的末尾处。","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\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-header/sticky-header.uvue) \n ```vue\n\n\n\n\n\n\n```","compatibility":"### sticky-header 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| padding | 3.98 | x | x |\n\n### sticky-header 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.93 | x | x |\n","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.sticky-header)\n"},"sticky-section":{"name":"## sticky-section","description":"> 组件类型:UniStickySectionElement \n\n 吸顶布局容器 \n\n 注意:暂时仅支持作为list-view的子节点, sticky-section不支持css样式!","attrubute":"### 属性 \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 ```vue\n\r\n\r\n\r\n\r\n\r\n\n```","compatibility":"### sticky-section 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| push-pinned-header | 3.98 | x | x |\n| padding | 3.98 | x | x |\n\n### sticky-section 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.98 | x | x |\n","children":"","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.sticky-section)\n"},"list-view":{"name":"## list-view","description":"> 组件类型:UniListViewElement \n\n 列表组件","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| direction | string | \"vertical\" | 滚动方向,可取值 none、horizontal、vertical,默认值vertical [direction](#list-view-direction-values) |\n| ~~scroll-x~~ | boolean | false | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-y~~ | boolean | true | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~rebound~~ | boolean | true | 控制是否回弹效果。已废弃,请改用bounces |\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) | - | 值应为某子元素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 表示不使用默认样式 [refresher-default-style](#list-view-refresher-default-style-values) |\n| refresher-background | string(string.ColorString) | \"#FFF\" | 设置下拉刷新区域背景颜色 |\n| refresher-triggered | boolean | false | 设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发 |\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\n#### direction @list-view-direction-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| none | 禁止滚动 |\n| horizontal | 横向滚动 |\n| vertical | 竖向滚动 |\n\n\n##### direction 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| none | 4.0 | x | 4.02 |\n| horizontal | 4.0 | x | x |\n| vertical | 4.0 | x | 4.02 |\n\n\n#### refresher-default-style @list-view-refresher-default-style-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| black | 深颜色雪花样式 |\n| white | 浅白色雪花样式 |\n| none | 不使用默认样式 |\n\n\n##### refresher-default-style 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| black | 3.9 | - | - |\n| white | 3.9 | - | - |\n| none | 3.93 | - | - |\n","event":"\n### 事件\n#### UniRefresherEvent\n\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRefresherEventDetail](#unirefreshereventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRefresherEventDetail 的属性值 @unirefreshereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dy | number | 是 | - | - |\n\n##### UniRefresherEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToUpperEvent\n\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToUpperEventDetail](#uniscrolltouppereventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToUpperEventDetail 的属性值 @uniscrolltouppereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 top 或 left |\n\n##### UniScrollToUpperEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToLowerEvent\n\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToLowerEventDetail](#uniscrolltolowereventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToLowerEventDetail 的属性值 @uniscrolltolowereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 bottom 或 right |\n\n##### UniScrollToLowerEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollEvent\n\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollEventDetail](#uniscrolleventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollEventDetail 的属性值 @uniscrolleventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| scrollTop | number | 是 | - | 竖向滚动的距离 |\n| scrollLeft | number | 是 | - | 横向滚动的距离 |\n| scrollHeight | number | 是 | - | 滚动区域的高度 |\n| scrollWidth | number | 是 | - | 滚动区域的宽度 |\n| deltaY | number | 是 | - | 当次滚动事件竖向滚动量 |\n| deltaX | number | 是 | - | 当次滚动事件横向滚动量 |\n\n##### UniScrollEvent 的方法\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/list-view/list-view.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/list-view/list-view\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n import { ItemType } from '@/components/enum-data/enum-data'\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 },\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 : ScrollToUpperEvent) { console.log(\"滚动到顶部/左边,会触发 scrolltoupper 事件 direction=\" + e.detail.direction) },\n list_view_scrolltolower(e : ScrollToLowerEvent) { console.log(\"滚动到底部/右边,会触发 scrolltolower 事件 direction=\" + e.detail.direction) },\n list_view_scroll() { console.log(\"滚动时触发,event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY}\") },\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 //自动化测试例专用\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:::","compatibility":"### list-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| direction | 4.0 | x | x |\n| scroll-x | 3.9 | x | x |\n| scroll-y | 3.9 | x | x |\n| rebound | 3.9 | x | x |\n| bounces | 4.0 | x | x |\n| upper-threshold | 3.9 | x | 4.02 |\n| lower-threshold | 3.9 | x | 4.02 |\n| scroll-top | 3.9 | x | 4.02 |\n| scroll-left | 3.9 | x | x |\n| show-scrollbar | 3.9 | x | 4.02 |\n| scroll-into-view | 3.9 | x | x |\n| scroll-with-animation | 3.9 | x | 4.02 |\n| refresher-enabled | 3.9 | x | x |\n| refresher-threshold | 3.9 | x | x |\n| refresher-max-drag-distance | 3.9 | x | x |\n| refresher-default-style | 3.9 | x | x |\n| refresher-background | 3.9 | x | x |\n| refresher-triggered | 3.9 | x | x |\n| custom-nested-scroll | 3.9 | x | x |\n| @refresherpulling | 3.9 | x | x |\n| @refresherrefresh | 3.9 | x | x |\n| @refresherrestore | 3.9 | x | x |\n| @refresherabort | 3.9 | x | x |\n| @scrolltoupper | 3.9 | x | 4.02 |\n| @scrolltolower | 3.9 | x | 4.02 |\n| @scroll | 3.9 | x | 4.02 |\n| @scrollend | 3.9 | x | x |\n\n### list-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.02 |\n","children":"### 子组件 @children-tags \n - [list-item](#list-item)\n- [sticky-header](https://uniapp.dcloud.net.cn/uni-app-x/component/sticky.html#sticky-header)\n- [sticky-section](https://uniapp.dcloud.net.cn/uni-app-x/component/sticky.html#sticky-section)","reference":"\n### 参见\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.list-view)\n"},"navigator":{"name":"## navigator","description":"> 组件类型:UniNavigatorElement \n\n 页面链接","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| target | string | - | 在哪个目标上发生跳转,默认当前应用 |\n| url | string(string.PageURIString) | - | 当前应用内的跳转链接 |\n| open-type | string | \"navigate\" | 跳转方式 [open-type](#navigator-open-type-values) |\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| animation-type | string | \"pop-in/out\" | 当 open-type=\"navigateTo\" 或 open-type=\"navigateBack\" 时有效,窗口的显示/关闭的动画类型。 [animation-type](#navigator-animation-type-values) |\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\n#### open-type @navigator-open-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| navigate | 对应 wx.navigateTo 或 wx.navigateToMiniProgram 的功能 |\n| redirect | 对应 wx.redirectTo 的功能 |\n| switchTab | 对应 wx.switchTab 的功能 |\n| reLaunch | 对应 wx.reLaunch 的功能 |\n| navigateBack | 对应 wx.navigateBack 的功能 |\n\n\n\n#### animation-type @navigator-animation-type-values \n\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\n","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>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'navigator'\n }\n }\n }\n\n```\n\n:::","compatibility":"### navigator 属性兼容性\n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| target | 5.0 | 3.9 | x | 4.0 |\n| url | 5.0 | 3.9 | x | 4.0 |\n| open-type | 5.0 | 3.9 | x | 4.0 |\n| delta | 5.0 | 3.9 | x | 4.0 |\n| path | 5.0 | 3.9 | x | 4.0 |\n| animation-type | 5.0 | 3.9 | x | 4.0 |\n| animation-duration | 5.0 | 3.9 | x | 4.0 |\n| render-link | x | x | x | 4.0 |\n\n### navigator 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/navigator)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/navigator.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.navigator)\n"},"picker-view-column":{"name":"## picker-view-column","description":"仅可放置于 picker-view 中,其子节点未继承 picker-view 的选中框的高度,需要自己设置高度并居中","attrubute":"","event":"","example":"","compatibility":"\n### picker-view-column 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.net.cn/component/picker-view.html#picker-view-column)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/picker-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.picker-view-column)\n"},"picker-view":{"name":"## picker-view","description":"> 组件类型:UniPickerViewElement \n\n 嵌入页面的滚动选择器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| value | array\\ | - | picker-view-column 选择的第几项 |\n| indicator-style | string(string.CSSString) | - | 设置选择器中间选中框的样式 |\n| indicator-class | string(string.ClassString) | - | 设置选择器中间选中框的类名 |\n| mask-style | string(string.CSSString) | - | 设置蒙层的样式 |\n| mask-top-style | string(string.CSSString) | - | 设置蒙层上半部分的样式 |\n| mask-bottom-style | string(string.CSSString) | - | 设置蒙层下半部分的样式 |\n| mask-class | string(string.ClassString) | - | 设置蒙层的类名 |\n| @change | (event: [UniPickerViewChangeEvent](#unipickerviewchangeevent)) => void | - | 当滚动选择,value 改变时触发 change 事件,event.detail = {value: value};value为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0 \t\t开始) |","event":"\n### 事件\n#### UniPickerViewChangeEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | Array\\ | 是 | - | - |\n\n##### UniPickerViewChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniPickerViewChangeEventDetail](#unipickerviewchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniPickerViewChangeEventDetail 的属性值 @unipickerviewchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | Array\\ | 是 | - | - |\n\n##### UniPickerViewChangeEvent 的方法\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/picker-view/picker-view.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/picker-view/picker-view\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n const date = new Date()\r\n const _years : number[] = []\r\n const _year = date.getFullYear()\r\n const _months : number[] = []\r\n const _month : number = date.getMonth() + 1\r\n const _days : number[] = []\r\n const _day = date.getDate()\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 maskTopStyle: '',\r\n maskBottomStyle: ''\r\n }\r\n },\r\n methods: {\r\n bindChange(e : UniPickerViewChangeEvent) {\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, 0, 0] 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:::","compatibility":"### picker-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| value | √ | x | 4.0 |\n| indicator-style | √ | x | 4.0 |\n| indicator-class | x | x | 4.0 |\n| mask-style | x | x | 4.0 |\n| mask-top-style | √ | x | x |\n| mask-bottom-style | √ | x | x |\n| mask-class | x | x | 4.0 |\n| @change | √ | x | 4.0 |\n\n### picker-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [picker-view-column](#picker-view-column)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/picker-view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/picker-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.picker-view)\n"},"progress":{"name":"## progress","description":"> 组件类型:UniProgressElement \n\n 进度条","attrubute":"### 属性 \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) | \"#09BB07\" | 已选择的进度条的颜色 |\n| backgroundColor | string(string.ColorString) | \"#EBEBEB\" | 未选择的进度条的颜色 |\n| active | boolean | false | 进度条从左往右的动画 |\n| active-mode | string | \"backwards\" | backwards: 动画从头播;forwards:动画从上次结束点接着播 [active-mode](#progress-active-mode-values) |\n| @activeend | (event: [UniProgressActiveendEvent](#uniprogressactiveendevent)) => void | - | 动画完成事件 |\n\n#### active-mode @progress-active-mode-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| backwards | 动画从头播 |\n| forwards | 动画从上次结束点接着播 |\n\n\n##### active-mode 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| backwards | √ | x | 4.0 |\n| forwards | √ | x | 4.0 |\n","event":"\n### 事件\n#### UniProgressActiveendEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | number | 是 | - | - |\n\n##### UniProgressActiveendEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniProgressActiveendEventDetail](#uniprogressactiveendeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniProgressActiveendEventDetail 的属性值 @uniprogressactiveendeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| curPercent | number | 是 | - | - |\n\n##### UniProgressActiveendEvent 的方法\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/progress/progress.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/progress/progress\n>Template\n```vue\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'\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 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 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:::","compatibility":"### progress 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| duration | √ | x | 4.0 |\n| percent | √ | x | 4.0 |\n| show-info | √ | x | 4.0 |\n| border-radius | √ | x | x |\n| font-size | √ | x | x |\n| stroke-width | √ | x | 4.0 |\n| activeColor | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| active | √ | x | 4.0 |\n| active-mode | √ | x | 4.0 |\n| @activeend | √ | x | x |\n\n### progress 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/progress)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/progress.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.progress)\n"},"radio":{"name":"## radio","description":"> 组件类型:UniRadioElement \n\n 单选项。在1组radio-group中只能选中1个","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| disabled | boolean | false | 是否禁用 |\n| value | string | - | \\ 标识。当该radio 选中时,radio-group的 change 事件会携带radio的value |\n| checked | boolean | false | \\ 当前是否选中 |\n| color | string(string.ColorString) | \"#007AFF\" | radio的颜色 |\n| backgroundColor | string(string.ColorString) | \"#ffffff\" | radio默认的背景颜色 |\n| borderColor | string(string.ColorString) | \"#d1d1d1\" | radio默认的边框颜色 |\n| activeBackgroundColor | string(string.ColorString) | \"#007AFF\" | radio选中时的背景颜色,优先级大于color属性 |\n| activeBorderColor | string(string.ColorString) | \"\" | radio选中时的边框颜色 |\n| iconColor | string(string.ColorString) | \"#ffffff\" | radio的图标颜色 |","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>Template\n```vue\n\r\n\r\n\r\n\r\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\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 methods: {\r\n radioChange(e : UniRadioGroupChangeEvent) {\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 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:::","compatibility":"### radio 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| disabled | √ | x | 4.0 |\n| value | √ | x | 4.0 |\n| checked | √ | x | 4.0 |\n| color | √ | x | 4.0 |\n| backgroundColor | √ | x | 4.0 |\n| borderColor | √ | x | 4.0 |\n| activeBackgroundColor | √ | x | 4.0 |\n| activeBorderColor | √ | x | 4.0 |\n| iconColor | √ | x | 4.0 |\n\n### radio 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/radio)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/radio-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.radio)\n"},"radio-group":{"name":"## radio-group","description":"> 组件类型:UniRadioGroupElement \n\n 单选组,内部由多个 radio 组成","attrubute":"### 属性 \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##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | - |\n\n##### UniRadioGroupChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRadioGroupChangeEventDetail](#uniradiogroupchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRadioGroupChangeEventDetail 的属性值 @uniradiogroupchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | string | 是 | - | - |\n\n##### UniRadioGroupChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n","example":"","compatibility":"### radio-group 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| @change | √ | x | 4.0 |\n\n### radio-group 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| √ | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [radio](#radio)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/radio)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/radio-group.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.radio-group)\n"},"form":{"name":"## form","description":"> 组件类型:UniFormElement \n\n 表单","attrubute":"### 属性 \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 事件 |","event":"\n### 事件\n#### UniFormSubmitEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | - |\n\n##### UniFormSubmitEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniFormSubmitEventDetail](#uniformsubmiteventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniFormSubmitEventDetail 的属性值 @uniformsubmiteventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md) | 是 | - | - |\n\n##### UniFormSubmitEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniFormResetEvent\n\n##### 构造函数\n##### UniFormResetEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniFormResetEventDetail](#uniformreseteventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniFormResetEventDetail 的属性值 @uniformreseteventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n\n##### UniFormResetEvent 的方法\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/form/form.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/form/form\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n nickname: '',\n gender: '0',\n age: 18,\n loves: ['0'],\n switch: true,\n formData: {} as UTSJSONObject\n }\n },\n computed: {\n formDataText() : string {\n return JSON.stringify(this.formData)\n }\n },\n methods: {\n onFormSubmit: function (e : UniFormSubmitEvent) {\n this.formData = e.detail.value\n },\n onFormReset: function (_ : UniFormResetEvent) {\n this.formData = {}\n }\n }\n }\n\n```\n\n:::","compatibility":"### form 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| disabled | 3.97 | x | 4.0 |\n| report-submit | x | x | 4.0 |\n| @submit | 3.97 | x | 4.0 |\n| @reset | x | x | 4.0 |\n\n### form 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.97 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/form)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/form.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.form)\n"},"rich-text":{"name":"## rich-text","description":"> 组件类型:UniRichTextElement \n\n 富文本。可渲染文字样式、图片、超链接。支持部分HTML标签","attrubute":"### 属性 \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={ ref \\| src \\| href } |","event":"\n### 事件\n#### UniRichTextItemClickEvent\n\n##### UniRichTextItemClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRichTextItemClickEventDetail](#unirichtextitemclickeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRichTextItemClickEventDetail 的属性值 @unirichtextitemclickeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ref | string \\| null | 否 | - | 自定义数据 |\n| src | string \\| null | 否 | - | \\图片链接 |\n| href | string \\| null | 否 | - | \\
超链接 |\n\n##### UniRichTextItemClickEvent 的方法\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/rich-text/rich-text.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/rich-text/rich-text\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n\n\n```\n\n:::","compatibility":"### rich-text 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| nodes | 3.9 | x | 4.0 |\n| selectable | 3.9 | - | 4.0 |\n| @itemclick | 3.9 | x | - |\n\n### rich-text 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/rich-text)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/rich-text.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.rich-text)\n"},"scroll-view":{"name":"## scroll-view","description":"> 组件类型:UniScrollViewElement \n\n 可滚动视图容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| direction | string | \"vertical\" | 滚动方向,可取值 none、all、horizontal、vertical,默认值vertical [direction](#scroll-view-direction-values) |\n| ~~scroll-x~~ | boolean | false | 允许横向滚动,不支持同时设置scroll-y属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~scroll-y~~ | boolean | true | 允许纵向滚动,不支持同时设置scroll-x属性为true,同时设置true时scroll-y生效。已废弃,请改用direction |\n| ~~rebound~~ | boolean | true | 控制是否回弹效果。已废弃,请改用bounces |\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) | - | 值应为某子元素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 表示不使用默认样式 [refresher-default-style](#scroll-view-refresher-default-style-values) |\n| refresher-background | string(string.ColorString) | \"#FFF\" | 设置下拉刷新区域背景颜色 |\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) | \"\" | 嵌套滚动子元素的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 ture表示与子元素开启滚动协商 默认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\n#### direction @scroll-view-direction-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| none | 禁止滚动 |\n| all | 横向竖向都可滚动 app端不支持 |\n| horizontal | 横向滚动 |\n| vertical | 竖向滚动 |\n\n\n##### direction 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| none | 4.0 | x | 4.0 |\n| all | 4.0 | x | 4.0 |\n| horizontal | 4.0 | x | 4.0 |\n| vertical | 4.0 | x | 4.0 |\n\n\n#### refresher-default-style @scroll-view-refresher-default-style-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| black | 深颜色雪花样式 |\n| white | 浅白色雪花样式 |\n| none | 不使用默认样式 |\n\n\n##### refresher-default-style 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| black | 3.9 | - | - |\n| white | 3.9 | - | - |\n| none | 3.9 | - | - |\n","event":"\n### 事件\n#### UniRefresherEvent\n\n##### UniRefresherEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniRefresherEventDetail](#unirefreshereventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniRefresherEventDetail 的属性值 @unirefreshereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dy | number | 是 | - | - |\n\n##### UniRefresherEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToUpperEvent\n\n##### UniScrollToUpperEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToUpperEventDetail](#uniscrolltouppereventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToUpperEventDetail 的属性值 @uniscrolltouppereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 top 或 left |\n\n##### UniScrollToUpperEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollToLowerEvent\n\n##### UniScrollToLowerEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollToLowerEventDetail](#uniscrolltolowereventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollToLowerEventDetail 的属性值 @uniscrolltolowereventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | string | 是 | - | 滚动方向 bottom 或 right |\n\n##### UniScrollToLowerEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniScrollEvent\n\n##### UniScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniScrollEventDetail](#uniscrolleventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniScrollEventDetail 的属性值 @uniscrolleventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| scrollTop | number | 是 | - | 竖向滚动的距离 |\n| scrollLeft | number | 是 | - | 横向滚动的距离 |\n| scrollHeight | number | 是 | - | 滚动区域的高度 |\n| scrollWidth | number | 是 | - | 滚动区域的宽度 |\n| deltaY | number | 是 | - | 当次滚动事件竖向滚动量 |\n| deltaX | number | 是 | - | 当次滚动事件横向滚动量 |\n\n##### UniScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniStartNestedScrollEvent\n\n##### UniStartNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| node | [UniElement](/dom/unielement.md) | 是 | - | 开始滚动子节点对象 |\n| isTouch | boolean | 是 | - | 是否由触摸行为发生的Event |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n\n##### UniStartNestedScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniNestedPreScrollEvent\n\n##### UniNestedPreScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| deltaX | number | 是 | - | x轴滚动距离 |\n| deltaY | number | 是 | - | y轴滚动距离 |\n| isTouch | boolean | 是 | - | 是否由触摸行为发生的Event |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n\n##### UniNestedPreScrollEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| consumed | (consumedX: number, consumedY: number) => void | 是 | - | 通知到子节点x,y轴滚动距离的消耗 |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniStopNestedScrollEvent\n\n##### UniStopNestedScrollEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| isTouch | boolean | 是 | - | 是否由触摸行为发生的Event |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n\n##### UniStopNestedScrollEvent 的方法\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/scroll-view/scroll-view.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/scroll-view/scroll-view\n>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n scrollTop: 0,\n oldScrollTop: 0,\n showScrollbar: true\n }\n },\n methods: {\n upper: function (e : ScrollToUpperEvent) {\n console.log(e)\n },\n lower: function (e : ScrollToLowerEvent) {\n console.log(e)\n },\n scroll: function (e : ScrollEvent) {\n this.oldScrollTop = e.detail.scrollTop\n },\n goTop: function () {\n // 解决view层不同步的问题\n this.scrollTop = this.oldScrollTop\n this.$nextTick(function () {\n this.scrollTop = 0\n })\n uni.showToast({\n icon: 'none',\n title: '纵向滚动 scrollTop 值已被修改为 0',\n })\n }\n },\n }\n\n```\n\n:::","compatibility":"### scroll-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| direction | 4.0 | - | 4.0 |\n| scroll-x | 3.9 | - | 4.0 |\n| scroll-y | 3.9 | - | 4.0 |\n| rebound | 3.9 | - | - |\n| bounces | 4.0 | - | x |\n| upper-threshold | 3.9 | - | 4.0 |\n| lower-threshold | 3.9 | - | 4.0 |\n| scroll-top | 3.9 | - | 4.0 |\n| scroll-left | 3.9 | - | 4.0 |\n| scroll-into-view | 3.9 | - | 4.0 |\n| scroll-with-animation | 3.9 | - | 4.0 |\n| refresher-enabled | 3.9 | - | x |\n| refresher-threshold | 3.9 | - | x |\n| refresher-max-drag-distance | 3.9 | - | x |\n| refresher-default-style | 3.9 | - | x |\n| refresher-background | 3.9 | - | x |\n| refresher-triggered | 3.9 | - | x |\n| show-scrollbar | 3.9 | - | 4.0 |\n| custom-nested-scroll | 3.9 | - | x |\n| nested-scroll-child | 3.97 | - | x |\n| @refresherpulling | 3.9 | - | x |\n| @refresherrefresh | 3.9 | - | x |\n| @refresherrestore | 3.9 | - | x |\n| @refresherabort | 3.9 | - | x |\n| @scrolltoupper | 3.9 | - | 4.0 |\n| @scrolltolower | 3.9 | - | 4.0 |\n| @scroll | 3.9 | - | 4.0 |\n| @scrollend | 3.9 | - | 4.0 |\n| @startnestedscroll | 3.9 | - | x |\n| @nestedprescroll | 3.9 | - | x |\n| @stopnestedscroll | 3.9 | - | x |\n\n### scroll-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/scroll-view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/scroll-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.scroll-view)\n"},"slider":{"name":"## slider","description":"> 组件类型:UniSliderElement \n\n 滑动选择器","attrubute":"### 属性 \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| activeColor | string(string.ColorString) | \"#007aff\" | slider 滑块左侧已选择部分的线条颜色 |\n| backgroundColor | string(string.ColorString) | \"#e9e9e9\" | radio背景条的颜色 |\n| block-size | number | 28 | radio滑块的大小,取值范围为 12 - 28 |\n| block-color | string(string.ColorString) | \"#ffffff\" | 滑块颜色 |\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} |","event":"\n### 事件\n#### UniSliderChangeEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | number | 是 | - | - |\n\n##### UniSliderChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSliderChangeEventDetail](#unisliderchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSliderChangeEventDetail 的属性值 @unisliderchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | number | 是 | - | - |\n\n##### UniSliderChangeEvent 的方法\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/slider/slider.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/slider/slider\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n sliderValue: 50,\n sliderBlockSize: 20,\n sliderBackgroundColor: \"#000000\",\n sliderActiveColor: \"#FFCC33\",\n sliderBlockColor: \"#8A6DE9\",\n // 组件属性 autotest\n show_value_boolean: false,\n disabled_boolean: false,\n min_input: 0,\n max_input: 100,\n step_input: 1,\n value_input: 0,\n activeColor_input: \"#007aff\",\n backgroundColor_input: \"#e9e9e9\",\n block_size_input: 28,\n block_color_input: \"#ffffff\",\n };\n },\n methods: {\n sliderChange(e : UniSliderChangeEvent) {\n console.log(\"value 发生变化:\" + e.detail.value);\n },\n slider_click() {\n console.log(\"组件被点击时触发\");\n },\n slider_touchstart() {\n console.log(\"手指触摸动作开始\");\n },\n slider_touchmove() {\n console.log(\"手指触摸后移动\");\n },\n slider_touchcancel() {\n console.log(\"手指触摸动作被打断,如来电提醒,弹窗\");\n },\n slider_touchend() {\n console.log(\"手指触摸动作结束\");\n },\n slider_tap() {\n console.log(\"手指触摸后马上离开\");\n },\n slider_longpress() {\n console.log(\n \"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\"\n );\n },\n slider_change() {\n console.log(\"完成一次拖动后触发的事件,event.detail = {value: value}\");\n },\n slider_changing() {\n console.log(\"拖动过程中触发的事件,event.detail = {value: value}\");\n },\n change_show_value_boolean(checked : boolean) {\n this.show_value_boolean = checked;\n },\n change_disabled_boolean(checked : boolean) {\n this.disabled_boolean = checked;\n },\n confirm_min_input(value : number) {\n this.min_input = value;\n },\n confirm_max_input(value : number) {\n this.max_input = value;\n },\n confirm_step_input(value : number) {\n this.step_input = value;\n },\n confirm_value_input(value : number) {\n this.value_input = value;\n },\n confirm_activeColor_input(value : string) {\n this.activeColor_input = value;\n },\n confirm_backgroundColor_input(value : string) {\n this.backgroundColor_input = value;\n },\n confirm_block_size_input(value : number) {\n this.block_size_input = value;\n },\n confirm_block_color_input(value : string) {\n this.block_color_input = value;\n },\n },\n };\n\n```\n\n:::","compatibility":"### slider 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| disabled | 3.9 | x | 4.0 |\n| min | 3.9 | x | 4.0 |\n| max | 3.9 | x | 4.0 |\n| step | 3.9 | x | 4.0 |\n| value | 3.9 | x | 4.0 |\n| activeColor | 3.9 | x | 4.0 |\n| backgroundColor | 3.9 | x | 4.0 |\n| block-size | 3.9 | x | 4.0 |\n| block-color | 3.9 | x | 4.0 |\n| show-value | 3.9 | x | 4.0 |\n| @change | 3.9 | x | 4.0 |\n| @changing | 3.9 | x | 4.0 |\n\n### slider 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/slider)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/slider.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.slider)\n"},"swiper-item":{"name":"## swiper-item","description":"> 组件类型:UniSwiperItemElement \n\n swiper的唯一合法子组件。每个swiper-item代表一个滑块。宽高自动设置为100%","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| item-id | string | - | 该 swiper-item 的标识符 |","event":"","example":"","compatibility":"### swiper-item 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| item-id | 3.9 | x | 4.0 |\n\n### swiper-item 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.net.cn/component/swiper.html#swiper-item)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/swiper.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.swiper-item)\n"},"swiper":{"name":"## swiper","description":"> 组件类型:UniSwiperElement \n\n 滑块视图容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| indicator-dots | boolean | false | 是否显示面板指示点 |\n| indicator-color | string(string.ColorString) | \"rgba(0, 0, 0, .3)\" | 指示点颜色 |\n| indicator-active-color | string(string.ColorString) | \"#000000\" | 当前选中的指示点颜色 |\n| disable-touch | boolean | false | 是否禁止用户 touch 操作 |\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 | false | 控制是否回弹效果 |\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##### UniSwiperChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwiperChangeEventDetail](#uniswiperchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwiperChangeEventDetail 的属性值 @uniswiperchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| current | number | 是 | - | 发生change事件的滑块下标 |\n| source | string | 是 | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n##### UniSwiperChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniSwiperTransitionEvent\n\n##### UniSwiperTransitionEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwiperTransitionEventDetail](#uniswipertransitioneventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwiperTransitionEventDetail 的属性值 @uniswipertransitioneventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| dx | number | 是 | - | 横向偏移量,单位是逻辑像素px |\n| dy | number | 是 | - | 纵向偏移量,单位是逻辑像素px |\n\n##### UniSwiperTransitionEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniSwiperAnimationFinishEvent\n\n##### UniSwiperAnimationFinishEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwiperAnimationFinishEventDetail](#uniswiperanimationfinisheventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwiperAnimationFinishEventDetail 的属性值 @uniswiperanimationfinisheventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| current | number | 是 | - | 发生动画结束事件的滑块下标 |\n| source | string | 是 | - | autoplay 自动播放导致swiper变化;touch 用户划动引起swiper变化 |\n\n##### UniSwiperAnimationFinishEvent 的方法\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/swiper/swiper.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/swiper/swiper\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n\n```\n>Script\n```uts\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 },\r\n methods: {\r\n\r\n swiperChange: function (e : SwiperChangeEvent) {\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 : SwiperTransitionEvent) {\r\n if (this.swiperTransitionSelect) {\r\n console.log(\"swiperTransition\")\r\n console.log(e)\r\n }\r\n },\r\n swiperAnimationfinish: function (e : SwiperAnimationFinishEvent) {\r\n if (this.swiperAnimationfinishSelect) {\r\n console.log(\"swiperAnimationfinish\")\r\n console.log(e)\r\n }\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:::","compatibility":"### swiper 属性兼容性\n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| indicator-dots | 5.0 | 3.9 | x | 4.0 |\n| indicator-color | 5.0 | 3.9 | x | 4.0 |\n| indicator-active-color | 5.0 | 3.9 | x | 4.0 |\n| disable-touch | 5.0 | 3.9 | x | - |\n| autoplay | 5.0 | 3.9 | x | 4.0 |\n| current | 5.0 | 3.9 | x | 4.0 |\n| current-item-id | 5.0 | 3.9 | x | 4.0 |\n| interval | 5.0 | 3.9 | x | 4.0 |\n| duration | x | x | x | 4.0 |\n| circular | 5.0 | 3.9 | x | 4.0 |\n| vertical | 5.0 | 3.9 | x | 4.0 |\n| rebound | 5.0 | 3.9 | x | - |\n| @change | 5.0 | 3.9 | x | 4.0 |\n| @transition | 5.0 | 3.9 | x | 4.0 |\n| @animationfinish | 5.0 | 3.9 | x | 4.0 |\n\n### swiper 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"### 子组件 @children-tags \n - [swiper-item](#swiper-item)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/swiper)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/swiper.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.swiper)\n"},"switch":{"name":"## switch","description":"> 组件类型:UniSwitchElement \n\n 开关选择器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| name | string | - | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| checked | boolean | - | 是否选中 |\n| type | string | - | 样式,有效值:switch, checkbox [type](#switch-type-values) |\n| color | string(string.ColorString) | - | switch 的颜色,同 css 的 color |\n| disabled | boolean | - | 是否禁用 |\n| @change | (event: [UniSwitchChangeEvent](#uniswitchchangeevent)) => void | - | checked 改变时触发 change 事件,event.detail={ value:checked} |\n\n#### type @switch-type-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| switch | - |\n| checkbox | - |\n\n","event":"\n### 事件\n#### UniSwitchChangeEvent\n\n##### 构造函数\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | boolean | 是 | - | - |\n\n##### UniSwitchChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniSwitchChangeEventDetail](#uniswitchchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniSwitchChangeEventDetail 的属性值 @uniswitchchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| ctors | Constructor | 是 | - | - |\n| value | boolean | 是 | - | - |\n\n##### UniSwitchChangeEvent 的方法\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/switch/switch.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/switch/switch\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n title: 'switch 开关',\n checked: true,\n color: '#FFCC33',\n clickCheckedValue: true\n }\n },\n methods: {\n switch1Change: function (e : UniSwitchChangeEvent) {\n this.clickCheckedValue = e.detail.value\n console.log('switch1 发生 change 事件,携带值为', e.detail.value)\n },\n switch2Change: function (e : UniSwitchChangeEvent) {\n console.log('switch2 发生 change 事件,携带值为', e.detail.value)\n }\n }\n }\n\n```\n\n:::","compatibility":"### switch 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| name | 3.9 | x | 4.0 |\n| checked | 3.9 | x | 4.0 |\n| type | x | x | 4.0 |\n| color | 3.9 | x | 4.0 |\n| disabled | 3.9 | x | 4.0 |\n| @change | 3.9 | x | 4.0 |\n\n### switch 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/switch)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/switch.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.switch)\n"},"text":{"name":"## text","description":"> 组件类型:[UniTextElement](#unitextelement) \n\n 文本","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| selectable | boolean | false | 文本是否可选 |\n| space | string | - | 显示连续空格 [space](#text-space-values) |\n| decode | boolean | false | 是否解码 |\n\n#### space @text-space-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| ensp | 中文字符空格一半大小 |\n| emsp | 中文字符空格大小 |\n| nbsp | 根据字体设置的空格大小 |\n\n\n##### space 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| ensp | 3.9 | x | 4.0 |\n| emsp | 3.9 | x | 4.0 |\n| nbsp | 3.9 | x | 4.0 |\n","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>Template\n```vue\n\n\r\n\r\n\r\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:::","compatibility":"### text 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| selectable | 3.9 | x | 4.0 |\n| space | 3.9 | x | 4.0 |\n| decode | 3.9 | x | 4.0 |\n\n### text 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n - [text](#text)","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/text)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/text.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.text)\n","component_type":"### UniTextElement\n\ntext元素对象\n#### UniTextElement 的属性值\n| 名称 | 类型 | 必填 | 描述 |\n| :- | :- | :- | :- |\n| value | string | 是 | 只读属性 text元素的文案内容 |\n#### UniTextElement 的方法\n##### getTextExtra() @gettextextra\n\n\n###### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| any \\| null | 否 | \n\n\n"},"textarea":{"name":"## textarea","description":"> 组件类型:[UniTextareaElement](#unitextareaelement) \n\n 多行输入框","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| name | string | - | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交 |\n| value | string | \"\" | 输入框的初始内容 |\n| placeholder | string | \"\" | 输入框为空时占位符 |\n| placeholder-style | string | \"\" | 指定 placeholder 的样式 |\n| placeholder-class | string(string.ClassString) | \"\" | 指定 placeholder 的样式类,目前仅支持color,font-size和font-weight |\n| maxlength | number | 140 | 最大输入长度,设置为 -1 的时候不限制最大长度 |\n| auto-focus | boolean | false | 自动获取焦点 |\n| focus | boolean | false | 获取焦点 |\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) | \"\" | 指定光标颜色 |\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| 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 起支持 |","event":"\n### 事件\n#### UniInputConfirmEvent\n\n##### UniInputConfirmEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputConfirmEventDetail](#uniinputconfirmeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputConfirmEventDetail 的属性值 @uniinputconfirmeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n\n##### UniInputConfirmEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputEvent\n\n##### UniInputEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputEventDetail](#uniinputeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputEventDetail 的属性值 @uniinputeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 光标的位置 |\n| keyCode | number | 是 | - | 输入字符的Unicode值 |\n\n##### UniInputEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniTextareaLineChangeEvent\n\n##### UniTextareaLineChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniTextareaLineChangeEventDetail](#unitextarealinechangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniTextareaLineChangeEventDetail 的属性值 @unitextarealinechangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| lineCount | number | 是 | - | 行数 |\n| heightRpx | number | 是 | - | textarea的高度 |\n| height | number | 是 | - | textarea的高度 |\n\n##### UniTextareaLineChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniTextareaBlurEvent\n\n##### UniTextareaBlurEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniTextareaBlurEventDetail](#unitextareablureventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniTextareaBlurEventDetail 的属性值 @unitextareablureventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| value | string | 是 | - | 输入框内容 |\n| cursor | number | 是 | - | 选择区域的起始位置 |\n\n##### UniTextareaBlurEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniInputKeyboardHeightChangeEvent\n\n##### UniInputKeyboardHeightChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniInputKeyboardHeightChangeEventDetail](#uniinputkeyboardheightchangeeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniInputKeyboardHeightChangeEventDetail 的属性值 @uniinputkeyboardheightchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| duration | number | 是 | - | 持续时间 |\n\n##### UniInputKeyboardHeightChangeEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniTextareaFocusEvent\n\n##### UniTextareaFocusEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniTextareaFocusEventDetail](#unitextareafocuseventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniTextareaFocusEventDetail 的属性值 @unitextareafocuseventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| height | number | 是 | - | 键盘高度 |\n| value | string | 是 | - | 输入框内容 |\n\n###### UniTextareaFocusEventDetail 兼容性 \n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| height | √ | - | 4.0 |\n\n##### UniTextareaFocusEvent 的方法\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/textarea/textarea.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/textarea/textarea\n>Template\n```vue\n\r\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\nimport { ItemType } from '@/components/enum-data/enum-data'\r\nexport default {\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tadjust_position_boolean: false,\r\n\t\t\tshow_confirm_bar_boolean: false,\r\n\t\t\tfixed_boolean: false,\r\n\t\t\tauto_height_boolean: false,\r\n\t\t\tconfirm_hold_boolean: false,\r\n\t\t\tfocus_boolean: true,\r\n\t\t\tauto_focus_boolean: false,\n default_value:\"1\\n2\\n3\\n4\\n5\\n6\",\n maxlength:-1,\r\n\t\t\tinputmode_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[],\n cursor_color: \"#3393E2\",\r\n\t\t\tinputmode_enum_current: 0\r\n\t\t}\r\n\t},\n\r\n\tmethods: {\r\n\t\ttextarea_click() { console.log(\"组件被点击时触发\") },\r\n\t\ttextarea_touchstart() { console.log(\"手指触摸动作开始\") },\r\n\t\ttextarea_touchmove() { console.log(\"手指触摸后移动\") },\r\n\t\ttextarea_touchcancel() { console.log(\"手指触摸动作被打断,如来电提醒,弹窗\") },\r\n\t\ttextarea_touchend() { console.log(\"手指触摸动作结束\") },\r\n\t\ttextarea_tap() { console.log(\"手指触摸后马上离开\") },\r\n\t\ttextarea_longpress() { console.log(\"如果一个组件被绑定了 longpress 事件,那么当用户长按这个组件时,该事件将会被触发。\") },\r\n\t\ttextarea_confirm() { console.log(\"点击完成时, 触发 confirm 事件,event.detail = {value: value}\") },\r\n\t\ttextarea_input() { console.log(\"当键盘输入时,触发 input 事件,event.detail = {value, cursor}, @input 处理函数的返回值并不会反映到 textarea 上\") },\r\n\t\ttextarea_linechange() { console.log(\"输入框行数变化时调用,event.detail = {height: 0, height: 0, lineCount: 0}\") },\r\n\t\ttextarea_blur() { console.log(\"输入框失去焦点时触发,event.detail = {value, cursor}\") },\r\n\t\ttextarea_keyboardheightchange() { console.log(\"键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration}\") },\r\n\t\ttextarea_focus() { console.log(\"输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\") },\r\n\t\tchange_adjust_position_boolean(checked : boolean) { this.adjust_position_boolean = checked },\r\n\t\tchange_show_confirm_bar_boolean(checked : boolean) { this.show_confirm_bar_boolean = checked },\r\n\t\tchange_fixed_boolean(checked : boolean) { this.fixed_boolean = checked },\r\n\t\tchange_auto_height_boolean(checked : boolean) { this.auto_height_boolean = checked },\r\n\t\tchange_confirm_hold_boolean(checked : boolean) { this.confirm_hold_boolean = checked },\r\n\t\tchange_focus_boolean(checked : boolean) { this.focus_boolean = checked },\r\n\t\tchange_auto_focus_boolean(checked : boolean) { this.auto_focus_boolean = checked },\n change_cursor_color_boolean(checked : boolean) { if(checked){ this.cursor_color = \"transparent\"} else {this.cursor_color = \"#3393E2\"}},\r\n\t\tradio_change_inputmode_enum(checked : number) { this.inputmode_enum_current = checked }\r\n\t}\r\n}\r\n\n```\n\n:::","compatibility":"### textarea 属性兼容性\n| | Android 系统版本 | Android | iOS | web |\n| :- | :- | :- | :- | :- |\n| name | 5.0 | 3.9 | x | 4.0 |\n| value | 5.0 | 3.9 | x | 4.0 |\n| placeholder | 5.0 | 3.9 | x | 4.0 |\n| placeholder-style | 5.0 | 3.9 | x | 4.0 |\n| placeholder-class | 5.0 | 3.9 | x | 4.0 |\n| maxlength | 5.0 | 3.9 | x | 4.0 |\n| auto-focus | 5.0 | 3.9 | x | 4.0 |\n| focus | 5.0 | 3.9 | x | 4.0 |\n| cursor | 5.0 | 3.9 | x | 4.0 |\n| confirm-hold | 5.0 | 3.9 | x | 4.0 |\n| auto-height | 5.0 | 3.9 | x | 4.0 |\n| fixed | x | x | x | 4.0 |\n| cursor-spacing | 5.0 | 3.9 | x | 4.0 |\n| cursor-color | 5.0 | 3.99 | x | - |\n| show-confirm-bar | x | x | x | 4.0 |\n| selection-start | 5.0 | 3.9 | x | 4.0 |\n| selection-end | 5.0 | 3.9 | x | 4.0 |\n| adjust-position | 5.0 | 3.9 | x | 4.0 |\n| hold-keyboard | 5.0 | 4.0 | x | 4.0 |\n| @confirm | 5.0 | 3.9 | x | 4.0 |\n| @input | 5.0 | 3.9 | x | 4.0 |\n| @linechange | 5.0 | 3.9 | x | 4.0 |\n| @blur | 5.0 | 3.9 | x | 4.0 |\n| @keyboardheightchange | 5.0 | 3.9 | x | 4.0 |\n| @focus | 5.0 | 3.9 | x | 4.0 |\n\n### textarea 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/textarea)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/textarea.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.textarea)\n","component_type":"### UniTextareaElement\n\ntextarea元素对象\n#### UniTextareaElement 的属性值\n| 名称 | 类型 | 必填 | 描述 |\n| :- | :- | :- | :- |\n| name | string | 是 | 表单的控件名称,作为键值对的一部分与表单(form组件)一同提交\n |\n| type | string | 是 | input的类型\n |\n| disabled | boolean | 是 | 是否禁用\n |\n| autofocus | boolean | 是 | 自动获取焦点\n |\n| value | string | 是 | 输入框的初始内容\n |"},"video":{"name":"## video","description":"> 组件类型:[UniVideoElement](#univideoelement) \n\n 视频","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| loop | boolean | false | 是否循环播放 |\n| src | string(string.VideoURIString) | - | 视频资源地址 |\n| initial-time | number | - | 指定视频初始播放位置 |\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 | -90 | 设置全屏时视频的方向,不指定则根据宽高比自动判断。有效值为 0(正常竖向), 90(屏幕逆时针90度), -90(屏幕顺时针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| objectFit | string | \"contain\" | 当视频大小与 video 容器大小不一致时,视频的表现形式。 [objectFit](#video-objectFit-values) |\n| poster | string | - | 视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效 |\n| show-mute-btn | boolean | false | 是否显示静音按钮 |\n| title | string | - | 视频的标题,全屏时在顶部展示 |\n| play-btn-position | string | - | 播放按钮的位置 |\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| @play | (event: [UniEvent](/component/common#unievent)) => void | - | 当开始/继续播放时触发 |\n| @pause | (event: [UniEvent](/component/common#unievent)) => void | - | 当暂停播放时触发 |\n| @ended | (event: [UniEvent](/component/common#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#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\n#### objectFit @video-objectFit-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| contain | 包含 |\n| fill | 填充 |\n| cover | 覆盖 |\n\n\n##### objectFit 兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| contain | 3.9 | x | 4.0 |\n| fill | 3.9 | x | 4.0 |\n| cover | 3.9 | x | 4.0 |\n","event":"\n### 事件\n#### UniVideoTimeUpdateEvent\n\ntimeupdate 事件\n播放进度变化时触发\n##### UniVideoTimeUpdateEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoTimeUpdateEventDetail](#univideotimeupdateeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoTimeUpdateEventDetail 的属性值 @univideotimeupdateeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| currentTime | number | 是 | - | 当前进度 |\n| duration | number | 是 | - | 总进度 |\n\n#### UniVideoFullScreenChangeEvent\n\nfullscreenchange 事件\n当视频进入和退出全屏是触发\n##### UniVideoFullScreenChangeEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoFullScreenChangeEventDetail](#univideofullscreenchangeeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoFullScreenChangeEventDetail 的属性值 @univideofullscreenchangeeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fullScreen | boolean | 是 | - | 是否全屏 |\n| direction | string | 是 | - | 横竖屏,取值 vertical 或 horizontal |\n\n#### UniVideoErrorEvent\n\nerror 事件\n视频播放出错时触发\n##### UniVideoErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [VideoError](#videoerror-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | Long | 是 | - | - |\n\n###### VideoError 的属性值 @videoerror-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errCode | 100001 \\| 200001 \\| 300001 | 是 | - | 统一错误码
100001 网络错误
200001 内部错误
300001 SDK错误 |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称 |\n| data | any \\| null | 否 | - | 错误信息中包含的数据 |\n| cause | [Error](https://uniapp.dcloud.net.cn/tutorial/err-spec.html#unierror) \\| null | 否 | - | UTS错误信息对象 |\n| errMsg | string | 是 | - | - |\n\n#### UniVideoProgressEvent\n\nprogress 事件\n加载进度变化时触发\n##### UniVideoProgressEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoProgressEventDetail](#univideoprogresseventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoProgressEventDetail 的属性值 @univideoprogresseventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| buffered | number | 是 | - | 加载进度百分比 |\n\n#### UniVideoFullScreenClickEvent\n\nfullscreenclick 事件\n视频播放全屏播放时点击事件\n##### UniVideoFullScreenClickEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoFullScreenClickEventDetail](#univideofullscreenclickeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoFullScreenClickEventDetail 的属性值 @univideofullscreenclickeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| screenX | number | 是 | - | 点击点相对于屏幕左侧边缘的 X 轴坐标 |\n| screenY | number | 是 | - | 点击点相对于屏幕顶部边缘的 Y 轴坐标 |\n| screenWidth | number | 是 | - | 屏幕总宽度 |\n| screenHeight | number | 是 | - | 屏幕总高度 |\n\n#### UniVideoControlsToggleEvent\n\ncontrolstoggle 事件\n切换播放控件显示隐藏时触发\n##### UniVideoControlsToggleEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| detail | [UniVideoControlsToggleEventDetail](#univideocontrolstoggleeventdetail-values) | 是 | - | - |\n| type | string | 是 | - | - |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | Long | 是 | - | - |\n\n###### UniVideoControlsToggleEventDetail 的属性值 @univideocontrolstoggleeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| show | boolean | 是 | - | 是否显示 |\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>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n onReady() {\n this.videoContext = uni.createVideoContext('video', this);\n },\n data() {\n return {\n videoContext: null as VideoContext | null,\n // 属性\n src: \"https://qiniu-web-assets.dcloud.net.cn/video/sample/2minute-demo.mp4\",\n _src: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app-video-courses.mp4\",\n autoplay: false,\n loop: false,\n muted: false,\n initialTime: 0,\n _initialTime: 6,\n duration: -1,\n _duration: 60,\n controls: true,\n danmuList: [{\n text: '要显示的文本',\n color: '#FF0000',\n time: 3\n }, {\n text: '要显示的文本2',\n color: '#31ff23',\n time: 5\n }, {\n text: '要显示的文本3',\n color: '#f13ef8',\n time: 7\n }, {\n text: '要显示的文本4',\n color: '#4972f8',\n time: 9\n }, {\n text: '要显示的文本5',\n color: '#000000',\n time: 11\n }] as Array,\n danmuBtn: false,\n enableDanmu: true,\n pageGesture: false,\n direction: -90,\n _direction: 0,\n requestFullScreenOptions: {\n direction: -90\n } as RequestFullScreenOptions,\n showProgress: true,\n showFullscreenBtn: true,\n showPlayBtn: true,\n showCenterPlayBtn: true,\n showLoading: true,\n enableProgressGesture: true,\n objectFit: \"contain\",\n _objectFit: \"fill\",\n poster: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-android.png\",\n _poster: \"https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-ios.png\",\n showMuteBtn: false,\n title: \"video-component\",\n _title: \"video-component video-component\",\n enablePlayGesture: false,\n vslideGesture: false,\n vslideGestureInFullscreen: true,\n codec: \"hardware\",\n _codec: \"software\",\n httpCache: true,\n playStrategy: 0,\n _playStrategy: 2,\n header: {\n 'User-Agent': 'header test'\n } as UTSJSONObject,\n _header: {\n 'User-Agent': 'header test2'\n } as UTSJSONObject,\n // API\n pos: 10,\n rate: 1.5,\n danmu: {\n text: '要显示的文本',\n color: '#FF0000'\n } as Danmu,\n // 自动化测试\n isPlaying: false,\n isPause: false,\n isFullScreen: false\n }\n },\n onLoad() {\n // #ifdef WEB\n this.muted = true // web端非静音视频不可自动播放\n // #endif\n },\n methods: {\n // API\n play: function () {\n console.log(\"play\");\n this.videoContext?.play();\n },\n pause: function () {\n console.log(\"pause\");\n (uni.getElementById(\"video\") as UniVideoElement).pause(); //as写法测试。注意id不对时as会崩溃\n // this.videoContext?.pause();\n },\n seek: function (pos : number) {\n console.log(\"seek -> \" + pos);\n this.videoContext?.seek(pos);\n },\n requestFullScreen: function (options : RequestFullScreenOptions | null) {\n console.log(\"requestFullScreen -> \" + options);\n this.videoContext?.requestFullScreen(options);\n },\n exitFullScreen: function () {\n console.log(\"exitFullScreen\");\n this.videoContext?.exitFullScreen();\n },\n stop: function () {\n console.log(\"stop\");\n uni.getElementById(\"video\")?.stop(); //泛型写法测试\n // this.videoContext?.stop();\n },\n sendDanmu: function (danmu : Danmu) {\n console.log(\"sendDanmu -> \" + danmu);\n this.videoContext?.sendDanmu(danmu);\n },\n playbackRate: function (rate : number) {\n console.log(\"playbackRate -> \" + rate);\n this.videoContext?.playbackRate(rate);\n },\n // 属性\n setSrc: function (src : string) {\n this.src = src;\n console.log(\"src -> \" + this.src)\n },\n setAutoplay: function () {\n this.autoplay = !this.autoplay;\n console.log(\"autoplay -> \" + this.autoplay)\n },\n setLoop: function () {\n this.loop = !this.loop;\n console.log(\"loop -> \" + this.loop)\n },\n setMuted: function () {\n this.muted = !this.muted;\n console.log(\"muted -> \" + this.muted)\n },\n setInitialTime: function (initialTime : number) {\n this.initialTime = initialTime;\n console.log(\"initialTime -> \" + this.initialTime)\n },\n setDuration: function (duration : number) {\n this.duration = duration;\n console.log(\"duration -> \" + this.duration)\n },\n setControls: function () {\n this.controls = !this.controls;\n console.log(\"controls -> \" + this.controls)\n },\n setDanmuBtn: function () {\n this.danmuBtn = !this.danmuBtn;\n console.log(\"danmuBtn -> \" + this.danmuBtn)\n },\n setPageGesture: function () {\n this.pageGesture = !this.pageGesture;\n console.log(\"pageGesture -> \" + this.pageGesture)\n },\n setDirection: function (direction : number) {\n this.direction = direction;\n console.log(\"direction -> \" + this.direction)\n },\n setShowProgress: function () {\n this.showProgress = !this.showProgress;\n console.log(\"showProgress -> \" + this.showProgress)\n },\n setShowFullscreenBtn: function () {\n this.showFullscreenBtn = !this.showFullscreenBtn;\n console.log(\"showFullscreenBtn -> \" + this.showFullscreenBtn)\n },\n setShowPlayBtn: function () {\n this.showPlayBtn = !this.showPlayBtn;\n console.log(\"showPlayBtn -> \" + this.showPlayBtn)\n },\n setShowCenterPlayBtn: function () {\n this.showCenterPlayBtn = !this.showCenterPlayBtn;\n console.log(\"showCenterPlayBtn -> \" + this.showCenterPlayBtn)\n },\n setShowLoading: function () {\n this.showLoading = !this.showLoading;\n console.log(\"showLoading -> \" + this.showLoading)\n },\n setEnableProgressGesture: function () {\n this.enableProgressGesture = !this.enableProgressGesture;\n console.log(\"enableProgressGesture -> \" + this.enableProgressGesture)\n },\n setObjectFit: function (objectFit : string) {\n this.objectFit = objectFit;\n console.log(\"objectFit -> \" + this.objectFit)\n },\n setPoster: function (poster : string) {\n this.poster = poster;\n console.log(\"poster -> \" + this.poster)\n },\n setShowMuteBtn: function () {\n this.showMuteBtn = !this.showMuteBtn;\n console.log(\"showMuteBtn -> \" + this.showMuteBtn)\n },\n setTitle: function (title : string) {\n this.title = title;\n console.log(\"title -> \" + this.title)\n },\n setEnablePlayGesture: function () {\n this.enablePlayGesture = !this.enablePlayGesture;\n console.log(\"enablePlayGesture -> \" + this.enablePlayGesture)\n },\n setVslideGesture: function () {\n this.vslideGesture = !this.vslideGesture;\n console.log(\"vslideGesture -> \" + this.vslideGesture)\n },\n setVslideGestureInFullscreen: function () {\n this.vslideGestureInFullscreen = !this.vslideGestureInFullscreen;\n console.log(\"vslideGestureInFullscreen -> \" + this.vslideGestureInFullscreen)\n },\n setCodec: function (codec : string) {\n this.codec = codec;\n console.log(\"codec -> \" + this.codec)\n },\n setHttpCache: function () {\n this.httpCache = !this.httpCache;\n console.log(\"httpCache -> \" + this.httpCache)\n },\n setPlayStrategy: function (playStrategy : number) {\n this.playStrategy = playStrategy;\n console.log(\"playStrategy -> \" + this.playStrategy)\n },\n setHeader: function (header : UTSJSONObject) {\n this.header = header;\n console.log(\"header -> \" + this.header)\n },\n // 事件\n onPlay: function (res : UniEvent) {\n console.log(res.type);\n this.isPlaying = true;\n this.isPause = false;\n },\n onPause: function (res : UniEvent) {\n console.log(res.type);\n this.isPlaying = false;\n this.isPause = true;\n },\n onEnded: function (res : UniEvent) {\n console.log(res.type);\n },\n onTimeUpdate: function (res : UniVideoTimeUpdateEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onFullScreenChange: function (res : UniVideoFullScreenChangeEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n this.isFullScreen = !this.isFullScreen;\n },\n onWaiting: function (res : UniEvent) {\n console.log(res.type);\n },\n onError: function (res : UniVideoErrorEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onProgress: function (res : UniVideoProgressEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onFullScreenClick: function (res : UniVideoFullScreenClickEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n },\n onControlsToggle: function (res : UniVideoControlsToggleEvent) {\n console.log(res.type + \" -> \" + JSON.stringify(res.detail));\n }\n }\n }\n\n```\n\n:::","compatibility":"### video 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| loop | 3.9 | x | 4.0 |\n| src | 3.9 | x | 4.0 |\n| initial-time | 3.9 | x | 4.0 |\n| duration | 3.9 | x | 4.0 |\n| controls | 3.9 | x | 4.0 |\n| danmu-list | 3.9 | x | 4.0 |\n| danmu-btn | 3.9 | x | 4.0 |\n| enable-danmu | 3.9 | x | 4.0 |\n| autoplay | 3.9 | x | 4.0 |\n| muted | 3.9 | x | 4.0 |\n| page-gesture | 3.9 | x | 4.0 |\n| direction | 3.9 | x | 4.0 |\n| show-progress | 3.9 | x | 4.0 |\n| show-fullscreen-btn | 3.9 | x | 4.0 |\n| show-play-btn | 3.9 | x | 4.0 |\n| show-center-play-btn | 3.9 | x | 4.0 |\n| show-loading | 3.9 | x | 4.0 |\n| enable-progress-gesture | 3.9 | x | 4.0 |\n| objectFit | 3.9 | x | 4.0 |\n| poster | 3.9 | x | 4.0 |\n| show-mute-btn | 3.9 | x | 4.0 |\n| title | 3.9 | x | 4.0 |\n| play-btn-position | x | - | 4.0 |\n| enable-play-gesture | 3.9 | x | 4.0 |\n| auto-pause-if-navigate | x | - | 4.0 |\n| auto-pause-if-open-native | x | - | 4.0 |\n| vslide-gesture | 3.9 | x | 4.0 |\n| vslide-gesture-in-fullscreen | 3.9 | x | 4.0 |\n| ad-unit-id | x | - | x |\n| poster-for-crawler | x | - | 4.0 |\n| codec | 3.9 | x | x |\n| http-cache | 3.9 | x | x |\n| play-strategy | 3.9 | x | 4.0 |\n| is-live | x | - | 4.0 |\n| @play | 3.9 | x | 4.0 |\n| @pause | 3.9 | x | 4.0 |\n| @ended | 3.9 | x | 4.0 |\n| @timeupdate | 3.9 | x | 4.0 |\n| @fullscreenchange | 3.9 | x | 4.0 |\n| @waiting | 3.9 | x | 4.0 |\n| @error | 3.9 | x | 4.0 |\n| @progress | 3.9 | x | 4.0 |\n| @fullscreenclick | 3.9 | x | 4.0 |\n| @controlstoggle | 3.9 | x | 4.0 |\n\n### video 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/video)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/video.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.video)\n","component_type":"### UniVideoElement\n\nvideo元素对象\n#### UniVideoElement 的方法\n##### play() @play\n\n播放\n\n\n\n\n##### pause() @pause\n\n暂停\n\n\n\n\n##### seek(position) @seek\n\n跳转到指定位置\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| position | number | 是 | - | 跳转到指定位置(秒) |\n\n\n\n##### stop() @stop\n\n停止视频\n\n\n\n\n##### sendDanmu(danmu) @senddanmu\n\n发送弹幕\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| danmu | [Danmu](#danmu-values) | 是 | - | 弹幕数据 |\n###### Danmu 的属性值 @danmu-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| text | string \\| null | 否 | - | 弹幕文字 |\n| color | string \\| null | 否 | - | 弹幕颜色 |\n| time | number \\| null | 否 | - | 显示时刻 |\n\n\n\n\n##### playbackRate(rate) @playbackrate\n\n设置倍速播放\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| rate | number | 是 | - | 支持倍率 0.5/0.8/1.0/1.25/1.5 |\n\n\n\n##### requestFullScreen(direction?) @requestfullscreen\n\n进入全屏\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | [RequestFullScreenOptions](#requestfullscreenoptions-values) | 否 | - | 0\\|正常竖向, 90\\|屏幕逆时针90度, -90\\|屏幕顺时针90度 |\n###### RequestFullScreenOptions 的属性值 @requestfullscreenoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| direction | number \\| null | 否 | - | direction
- 0: 正常竖向
- 90: 屏幕逆时针90度
- -90: 屏幕顺时针90度 |\n\n\n\n\n##### exitFullScreen() @exitfullscreen\n\n退出全屏\n\n\n\n"},"unicloud-db":{"name":"## unicloud-db","description":"> 组件类型:UniCloudDBElement \n\n 是一个数据库查询组件,它将clientDB的API封装为组件,进一步减少开发者使用所需的代码量。","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| id | string(string.IDString) | - | 唯一标识 |\n| v-slot:default | string | - | {data, loading, hasMore, pagination, error} [v-slot:default](#unicloud-db-v-slot-default-values) |\n| collection | string(string.DBCollectionString) | - | 表名 |\n| field | string(string.DBFieldString) | - | 查询字段,多个字段用 `,` 分割 |\n| where | string(string.JQLString) | - | 查询条件 |\n| orderby | string | - | 排序字段及正序倒叙设置 |\n| groupby | string | - | 对数据进行分组 |\n| group-field | string | - | 对数据进行分组统计 |\n| distinct | boolean | - | 是否对数据查询结果中重复的记录进行去重 [distinct](#unicloud-db-distinct-values) |\n| page-data | string | - | add 多次查询的集合, replace 当前查询的集合 [page-data](#unicloud-db-page-data-values) |\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 [loadtime](#unicloud-db-loadtime-values) |\n| action | string(string.ClientDBActionString) | - | 云端执行数据库查询的前或后,触发某个action函数操作,进行预处理或后处理 |\n| @load | (data : Array\\, ended : boolean, pagination : [UTSJSONObject](/uts/buildin-object-api/utsjsonobject.md)) => void | - | 成功回调。如联网返回结果后,想修改下数据再渲染界面,则在本方法里对data进行修改 |\n| @error | (event: [UniEvent](/component/common#unievent)) => void | - | 失败回调 |\n\n#### v-slot:default @unicloud-db-v-slot-default-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| data | 查询结果,类型为Array\\ |\n| loading | 查询中的状态。可根据此状态,在template中通过v-if显示等待内容 |\n| hasMore | 是否有更多数据。可根据此状态,在template中通过v-if显示没有更多数据了 |\n| error | 查询错误。可根据此状态,在template中通过v-if显示等待内容 |\n| pagination | 分页属性 [v-slot:default](#unicloud-db-v-slot-default-values) |\n\n\n\n##### pagination @unicloud-db-v-slot-default-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| current | 当前页号 |\n| size | 分页大小 |\n| count | 数据库的总数据量, 设置 :getcount=true 时有效 |\n\n\n\n#### distinct @unicloud-db-distinct-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| true | 去重 |\n| false | 不去重 |\n\n\n\n#### page-data @unicloud-db-page-data-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| add | 多次查询的集合 |\n| replace | 当前查询的集合 |\n\n\n\n#### loadtime @unicloud-db-loadtime-values \n\n| 值名称 | 描述 |\n| :- | :- |\n| auto | 页面就绪后或属性变化后加载数据,默认为auto |\n| onready | 页面就绪后不自动加载数据,属性变化后加载。适合在onLoad中接收上个页面的参数作为where条件时 |\n| manual | 手动模式,不自动加载数据。如果涉及到分页,需要先手动修改当前页,在调用加载数据 |\n\n","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 ```vue\n\n\n\n\n\n\n```","compatibility":"### unicloud-db 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| v-slot:default | 3.93 | x | 4.0 |\n| collection | 3.93 | x | 4.0 |\n| field | 3.93 | x | 4.0 |\n| where | 3.93 | x | 4.0 |\n| orderby | 3.93 | x | 4.0 |\n| groupby | 3.93 | x | 4.0 |\n| group-field | 3.93 | x | 4.0 |\n| distinct | 3.93 | x | 4.0 |\n| page-data | 3.93 | x | 4.0 |\n| page-current | 3.93 | x | 4.0 |\n| page-size | 3.93 | x | 4.0 |\n| getone | x | x | 4.0 |\n| getcount | 3.93 | x | 4.0 |\n| gettree | 3.93 | x | 4.0 |\n| startwith | 3.93 | x | 4.0 |\n| limitlevel | 3.93 | x | 4.0 |\n| manual | 3.93 | x | 4.0 |\n| loadtime | 3.93 | x | 4.0 |\n| action | x | x | 4.0 |\n| @load | 3.93 | x | 4.0 |\n| @error | 3.93 | x | 4.0 |\n\n### unicloud-db 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.93 | x | 4.0 |\n","children":"","reference":"\n### 参见\n- [unicloud-db组件教程](https://uniapp.dcloud.io/uniCloud/unicloud-db)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/unicloud-db.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.unicloud-db)\n"},"view":{"name":"## view","description":"> 组件类型:UniViewElement \n\n 基本视图容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| hover-class | string(string.ClassString) | \"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>Template\n```vue\n\n\n\n\n\n```\n>Script\n```uts\n\n import { ItemType } from '@/components/enum-data/enum-data'\n export default {\n data() {\n return {\n hover_class: false,\n stop_propagation: false,\n start_time: 50,\n stay_time: 400,\n start_time_enum: [{ \"value\": 50, \"name\": \"50毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[],\n stay_time_enum: [{ \"value\": 400, \"name\": \"400毫秒\" }, { \"value\": 200, \"name\": \"200毫秒\" }] as ItemType[]\n }\n },\n methods: {\n change_hover_class_boolean(checked : boolean) {\n this.hover_class = checked\n },\n change_stop_propagation_boolean(checked : boolean) {\n this.stop_propagation = checked\n },\n radio_change_start_time_enum(time : number) {\n this.start_time = time\n },\n radio_change_stay_time_enum(time : number) {\n this.stay_time = time\n },\n },\n }\n\n```\n\n:::","compatibility":"### view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| hover-class | 3.9 | - | 4.0 |\n| hover-stop-propagation | 3.9 | - | 4.0 |\n| hover-start-time | 3.9 | - | 4.0 |\n| hover-stay-time | 3.9 | - | 4.0 |\n\n### view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | - | 4.0 |\n","children":"","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.view)\n"},"web-view":{"name":"## web-view","description":"> 组件类型:[UniWebViewElement](#uniwebviewelement) \n\n 承载网页的容器","attrubute":"### 属性 \n| 名称 | 类型 | 默认值 | 描述 |\n| :- | :- | :- | :- |\n| src | string(string.URIString) | - | webview 指向网页的链接 |\n| webview-styles | [WebViewStyles](#webviewstyles) | {\"progress\":{\"color\":\"#00FF00\"}} | webview 网络地址页面加载进度条样式 |\n| @message | (event: [UniWebViewMessageEvent](#uniwebviewmessageevent)) => void | - | 网页向应用 postMessage 时触发。e.detail = { data } |\n| @error | (event: [UniWebViewErrorEvent](#uniwebviewerrorevent)) => void | - | 网页加载错误时触发。e.detail = { errSubject, errCode, errMsg } |\n| @load | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | 网页加载完成后触发。e.detail = { url } |\n| ~~@loaded~~ | (event: [UniWebViewLoadEvent](#uniwebviewloadevent)) => void | - | 网页加载完成后触发。e.detail = { url }。已废弃,请改用load |\n| @loading | (event: [UniWebViewLoadingEvent](#uniwebviewloadingevent)) => void | - | 网页加载中触发。e.detail = { url } |\n| @download | (event: [UniWebViewDownloadEvent](#uniwebviewdownloadevent)) => void | - | 点击网页中可下载链接时触发。e.detail = { url, userAgent, contentDisposition, mimetype, contentLength } | \n### WebViewStyles \nweb-view组件的样式 \n#### WebViewStyles 的属性值 @webviewstyles-values\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| progress | [WebViewProgressStyles](#webviewprogressstyles-values) \\| boolean | 是 | false | 网络地址页面加载进度条样式,设置为 false 时表示不显示加载进度条。 |\n ### WebViewProgressStyles \nweb-view组件的进度条样式 \n#### WebViewProgressStyles 的属性值 @webviewprogressstyles-values\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| color | string.ColorString | 是 | - | 网页加载进度条颜色,默认值为 #00FF00 。 |\n ","event":"\n### 事件\n#### UniWebViewMessageEvent\n\n##### UniWebViewMessageEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值message |\n| detail | [UniWebViewMessageEventDetail](#uniwebviewmessageeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewMessageEventDetail 的属性值 @uniwebviewmessageeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | Map\\ \\| null | 否 | - | 消息包含的数据 |\n\n##### UniWebViewMessageEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewErrorEvent\n\n##### UniWebViewErrorEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值error |\n| detail | [UniWebViewErrorEventDetail](#uniwebviewerroreventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewErrorEventDetail 的属性值 @uniwebviewerroreventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| errSubject | string | 是 | - | 统一错误主题(模块)名称,固定值uni-web-view |\n| errCode | 100001 \\| 100002 \\| 100003 | 是 | - | 统一错误码
100001 ssl error
100002 page error
100003 http error |\n| errMsg | string | 是 | - | 统一错误描述信息 |\n\n##### UniWebViewErrorEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewLoadEvent\n\n##### UniWebViewLoadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值load |\n| detail | [UniWebViewLoadEventDetail](#uniwebviewloadeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewLoadEventDetail 的属性值 @uniwebviewloadeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 加载完成的网页链接 |\n\n##### UniWebViewLoadEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewLoadingEvent\n\n##### UniWebViewLoadingEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值loading |\n| detail | [UniWebViewLoadingEventDetail](#uniwebviewloadingeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewLoadingEventDetail 的属性值 @uniwebviewloadingeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 加载中的网页链接 |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| type | string | 是 | - | 事件类型 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewLoadingEventDetail 的方法 @uniwebviewloadingeventdetail-values \n\n##### stopPropagation() @stoppropagation\n\n阻止当前事件的进一步传播\n\n\n\n\n##### preventDefault() @preventdefault\n\n阻止当前事件的默认行为\n\n\n\n\n##### UniWebViewLoadingEvent 的方法\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| stopPropagation | () => void | 是 | - | 阻止当前事件的进一步传播 |\n| preventDefault | () => void | 是 | - | 阻止当前事件的默认行为 |\n\n#### UniWebViewDownloadEvent\n\n##### UniWebViewDownloadEvent 的属性值\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 事件类型,固定值download |\n| detail | [UniWebViewDownloadEventDetail](#uniwebviewdownloadeventdetail-values) | 是 | - | - |\n| bubbles | boolean | 是 | - | 是否冒泡 |\n| cancelable | boolean | 是 | - | 是否可以取消 |\n| target | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| currentTarget | [UniElement](/dom/unielement.md) \\| null | 否 | - | UVUE DOM 元素对象,描述了 UVUE DOM 元素所普通具有的属性和方法。 |\n| timeStamp | number | 是 | - | 事件发生时的时间戳 |\n\n###### UniWebViewDownloadEventDetail 的属性值 @uniwebviewdownloadeventdetail-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| url | string | 是 | - | 下载链接 |\n| userAgent | string | 是 | - | 用户代理 |\n| contentDisposition | string | 是 | - | 指示回复的内容该以何种形式展示,是以内联的形式(即网页或者页面的一部分),还是以附件的形式下载并保存到本地 |\n| mimetype | string | 是 | - | 媒体类型 |\n| contentLength | number | 是 | - | 文件大小 |\n\n##### UniWebViewDownloadEvent 的方法\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/web-view/web-view.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/component/web-view/web-view\n>Template\n```vue\n\n\n\n\n\n\n```\n>Script\n```uts\n\n export default {\n data() {\n return {\n src: 'https://www.dcloud.io',\n webview_styles: {\n progress: {\n color: '#FF3333'\n }\n },\n webviewContext: null as WebviewContext | null,\n loadError: false\n }\n },\n onReady() {\n // #ifdef APP\n // TODO web 实现createWebviewContext\n this.webviewContext = uni.createWebviewContext('web-view', this)\n // #endif\n },\n methods: {\n back() {\n this.webviewContext?.back();\n },\n forward() {\n this.webviewContext?.forward();\n },\n reload() {\n this.webviewContext?.reload();\n },\n stop() {\n this.webviewContext?.stop();\n },\n nativeToWeb() {\n this.webviewContext?.evalJS(\"alert('hello uni-app x')\");\n },\n message(event : UniWebViewMessageEvent) {\n console.log(JSON.stringify(event));\n },\n error(event : UniWebViewErrorEvent) {\n this.loadError = true\n console.log(JSON.stringify(event));\n },\n loading(event : UniWebViewLoadingEvent) {\n console.log(JSON.stringify(event));\n },\n load(event : UniWebViewLoadEvent) {\n console.log(JSON.stringify(event));\n },\n download(event : UniWebViewDownloadEvent) {\n console.log(JSON.stringify(event));\n uni.showModal({\n content: \"下载链接: \" + event.detail.url + \"\\n文件大小: \" + event.detail.contentLength / 1024 + \"KB\",\n showCancel: false\n });\n },\n confirm(event : UniInputConfirmEvent) {\n console.log(JSON.stringify(event));\n let url = event.detail.value;\n if (!url.startsWith('https://') && !url.startsWith('http://')) {\n url = 'https://' + url;\n }\n this.src = url;\n }\n }\n }\n\n```\n\n:::","compatibility":"### web-view 属性兼容性\n| | Android | iOS | web |\n| :- | :- | :- | :- |\n| src | 3.9 | x | 4.0 |\n| webview-styles | 3.9 | - | x |\n| @message | 3.9 | x | x |\n| @error | 3.9 | x | x |\n| @load | 4.0 | x | x |\n| @loading | 3.9 | x | x |\n| @download | 3.9 | x | x |\n\n### web-view 兼容性\n| Android | iOS | web |\n| :- | :- | :- |\n| 3.9 | x | 4.0 |\n","children":"### 子组件 @children-tags \n 不可以嵌套组件","reference":"\n### 参见\n- [uni-app相关参考](https://uniapp.dcloud.io/component/web-view)\n- [uni-app x相关参考](https://doc.dcloud.net.cn/uni-app-x/component/web-view.html)\n- [相关 Bug](https://issues.dcloud.net.cn/?mid=component.web-view)\n","component_type":"### UniWebViewElement\n\nweb-view元素对象\n#### UniWebViewElement 的方法\n##### back() @back\n\n后退\n\n\n\n\n##### forward() @forward\n\n前进\n\n\n\n\n##### reload() @reload\n\n重新加载\n\n\n\n\n##### stop() @stop\n\n停止加载\n\n\n\n\n##### evalJS(js) @evaljs\n\n原生和WebView通信(执行JS脚本)\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| js | string | 是 | - | - |\n\n\n"}} \ No newline at end of file diff --git a/docs/.vuepress/utils/utsUnicloudApiJson.json b/docs/.vuepress/utils/utsUnicloudApiJson.json index 27917aef..777f9766 100644 --- a/docs/.vuepress/utils/utsUnicloudApiJson.json +++ b/docs/.vuepress/utils/utsUnicloudApiJson.json @@ -1 +1 @@ -{"uniCloud_props":{"name":"# uniCloud","description":"","param":"## 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| config | [UniCloudInitOptions](#unicloudinitoptions-values) | 是 | - | - |\n| mixinDatacom | any | 是 | - | - |\n### UniCloudInitOptions 的属性值 @unicloudinitoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| provider | string | 是 | - | 服务商,目前支持 aliyun、tencent、alipay |\n| spaceName | string | 否 | - | 服务空间名 |\n| spaceId | string | 是 | - | 服务空间id |\n| clientSecret | string | 否 | - | 阿里云clientSecret |\n| endpoint | string | 否 | - | 阿里云endpoint |\n| spaceAppId | string | 否 | - | 支付宝小程序云spaceAppId |\n| accessKey | string | 否 | - | 支付宝小程序云accessKey |\n| secretKey | string | 否 | - | 支付宝小程序云secretKey |\n","returnValue":"","compatibility":"","tutorial":""},"callFunction":{"name":"## callFunction(options) @callfunction","description":"请求云函数","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudCallFunctionOptions](#unicloudcallfunctionoptions-values) | 是 | - | - |\n#### UniCloudCallFunctionOptions 的属性值 @unicloudcallfunctionoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string (string.CloudFunctionString) | 是 | - | 云函数名 |\n| data | any | 否 | - | 云函数参数 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudCallFunctionResult](#unicloudcallfunctionresult-values)> | \n\n#### UniCloudCallFunctionResult 的属性值 @unicloudcallfunctionresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| result | any | 是 | - | 云函数返回结果 |\n| requestId | string | 否 | - | 云函数请求id |\n","compatibility":"### callFunction 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-call-function.callFunction)\n"},"unicloud-call-function":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-call-function/unicloud-call-function.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/unicloud-call-function/unicloud-call-function\n>Template\n```vue\n\r\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: '请求云函数',\r\n callFunctionResult: {},\r\n callFunctionError: {},\r\n isUniTest: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n if (this.isUniTest) {\r\n uni.hideToast()\r\n }\r\n },\r\n methods: {\r\n notify(content : string, title : string) {\r\n if (!this.isUniTest) {\r\n uni.showModal({\r\n title,\r\n content,\r\n showCancel: false\r\n })\r\n } else {\r\n uni.showToast({\r\n title: content\r\n })\r\n console.log(title, content)\r\n }\r\n },\r\n async callFunction() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n await uniCloud.callFunction({\r\n name: 'echo-cf',\r\n data: {\r\n num: 1,\r\n str: 'ABC'\r\n }\r\n }).then(res => {\r\n const result = res.result\r\n this.callFunctionResult = result\r\n console.log(JSON.stringify(result))\r\n uni.hideLoading()\r\n this.notify(result['showMessage'] as string, '提示')\r\n }).catch((err : any | null) => {\r\n const error = err as UniCloudError\r\n this.callFunctionError = {\r\n errCode: error.errCode,\r\n errMsg: error.errMsg\r\n }\r\n uni.hideLoading()\r\n this.notify(error.errMsg, '错误')\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"importObject":{"name":"## importObject(objectName, options?) @importobject","description":"引用云对象","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| objectName | string (string.CloudObjectString) | 是 | - | - |\n| options | [UniCloudImportObjectOptions](#unicloudimportobjectoptions-values) | 否 | - | - |\n#### UniCloudImportObjectOptions 的属性值 @unicloudimportobjectoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| customUI | boolean | 否 | - | 是否移除自动展示的ui |\n| loadingOptions | [UniCloudImportObjectLoadingOptions](#unicloudimportobjectloadingoptions-values) | 否 | - | loading界面配置 |\n| errorOptions | [UniCloudImportObjectErrorOptions](#unicloudimportobjecterroroptions-values) | 否 | - | 错误提示配置 |\n\n##### UniCloudImportObjectLoadingOptions 的属性值 @unicloudimportobjectloadingoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string | 否 | - | 加载框标题 |\n| mask | boolean | 否 | - | 加载框是否显示mask |\n\n##### UniCloudImportObjectErrorOptions 的属性值 @unicloudimportobjecterroroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 否 | - | 错误提示类型,可以是modal或者toast |\n| retry | boolean | 否 | - | 是否显示重试按钮 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| any | \n","compatibility":"### importObject 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-import-object.importObject)\n"},"unicloud-import-object":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-import-object/unicloud-import-object.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/unicloud-import-object/unicloud-import-object\n>Template\n```vue\n\r\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: '请求云对象',\r\n todoTitle: '学习编程',\r\n todoContent: '熟悉uts语法',\r\n returnTodoTitle: '',\r\n returnTodoContent: '',\r\n failErrCode: '',\r\n successErrCode: -1,\r\n isUniTest: false\r\n }\r\n },\r\n onUnload() {\r\n if (this.isUniTest) {\r\n uni.hideToast()\r\n }\r\n },\r\n methods: {\r\n notify(content : string, title : string) {\r\n if (!this.isUniTest) {\r\n uni.showModal({\r\n title,\r\n content,\r\n showCancel: false\r\n })\r\n } else {\r\n uni.showToast({\r\n title: content\r\n })\r\n console.log(title, content)\r\n }\r\n },\r\n async addTodo() : Promise {\r\n const todo = uniCloud.importObject('todo', {\r\n customUI: this.isUniTest\r\n })\r\n const title = this.todoTitle\r\n const content = this.todoContent\r\n await todo.add(title, content).then((res : UTSJSONObject) => {\r\n this.returnTodoTitle = res['title'] as string\r\n this.returnTodoContent = res['content'] as string\r\n this.notify(res['showMessage'] as string, '提示')\r\n }).catch((err : any | null) => {\r\n const error = err as UniCloudError\r\n console.error(error)\r\n })\r\n },\r\n async randomFail() : Promise {\r\n const todoObj = uniCloud.importObject('todo', {\r\n errorOptions: {\r\n retry: true\r\n }\r\n })\r\n await todoObj.randomFail().then((res : UTSJSONObject) => {\r\n this.notify(res['showMessage'] as string, '提示')\r\n }).catch((err : any | null) => {\r\n const error = err as UniCloudError\r\n console.error(error)\r\n })\r\n },\r\n async fail() : Promise {\r\n const todo = uniCloud.importObject('todo', {\r\n customUI: this.isUniTest\r\n })\r\n await todo.fail().then((res : UTSJSONObject) => {\r\n this.notify('todo.fail应调用失败,此处错误的触发了成功回调', '错误')\r\n console.log('todo.fail: ', res);\r\n }).catch((err : any | null) => {\r\n const error = err as UniCloudError\r\n this.failErrCode = error.errCode as string\r\n console.error(error)\r\n if (this.isUniTest) {\r\n uni.showToast({\r\n title: error.errMsg\r\n })\r\n }\r\n })\r\n },\r\n async success() : Promise {\r\n const todo = uniCloud.importObject('todo', {\r\n customUI: this.isUniTest\r\n })\r\n await todo.success().then((res : UTSJSONObject) => {\r\n this.successErrCode = res['errCode'] as number\r\n this.notify(res['showMessage'] as string, '提示')\r\n }).catch((err : any | null) => {\r\n const error = err as UniCloudError\r\n console.error(error)\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"uploadFile":{"name":"## uploadFile(options) @uploadfile","description":"上传文件到云存储","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudUploadFileOptions](#uniclouduploadfileoptions-values) | 是 | - | - |\n#### UniCloudUploadFileOptions 的属性值 @uniclouduploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string | 是 | - | 文件路径 |\n| cloudPath | string | 是 | - | 云端路径 |\n| cloudPathAsRealPath | boolean | 否 | - | 是否以云端路径是否为真实路径保存上传的文件 |\n\n#### UniCloudUploadFileOptions 的方法 @uniclouduploadfileoptions-values \n\n#### onUploadProgress(options) @onuploadprogress\n\r\n上传进度回调\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudUploadProgress](#uniclouduploadprogress-values) | 是 | - | 上传进度回调参数 |\n###### UniCloudUploadProgress 的属性值 @uniclouduploadprogress-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| loaded | number | 是 | - | 已上传大小 |\n| total | number | 是 | - | 总大小 |\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudUploadFileResult](#uniclouduploadfileresult-values)> | \n\n#### UniCloudUploadFileResult 的属性值 @uniclouduploadfileresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string | 是 | - | 文件路径 |\n| fileID | string | 是 | - | 文件id |\n","compatibility":"### uploadFile 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-file-api.upload-file)\n"},"getTempFileURL":{"name":"## getTempFileURL(options) @gettempfileurl","description":"获取文件临时URL","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudGetTempFileURLOptions](#unicloudgettempfileurloptions-values) | 是 | - | - |\n#### UniCloudGetTempFileURLOptions 的属性值 @unicloudgettempfileurloptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fileList | Array\\ | 是 | - | 文件列表 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudGetTempFileURLResult](#unicloudgettempfileurlresult-values)> | \n\n#### UniCloudGetTempFileURLResult 的属性值 @unicloudgettempfileurlresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fileList | Array\\<[UniCloudGetTempFileURLResultItem](#unicloudgettempfileurlresultitem-values)\\> | 是 | - | 文件列表 |\n\n##### UniCloudGetTempFileURLResultItem 的属性值 @unicloudgettempfileurlresultitem-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fileID | string | 是 | - | 文件id |\n| tempFileURL | string | 是 | - | 文件临时url |\n","compatibility":"### getTempFileURL 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-file-api.choose-and-upload-file)\n"},"chooseAndUploadFile":{"name":"## chooseAndUploadFile(options) @chooseanduploadfile","description":"选择并上传文件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudChooseAndUploadFileOptions](#unicloudchooseanduploadfileoptions-values) | 是 | - | - |\n#### UniCloudChooseAndUploadFileOptions 的属性值 @unicloudchooseanduploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| sourceType | Array\\ | 否 | - | - |\n| count | number | 否 | - | - |\n| sizeType | Array\\ | 否 | - | - |\n| extension | Array\\ | 否 | - | - |\n| compressed | boolean | 否 | - | - |\n| maxDuration | number | 否 | - | - |\n| camera | string | 否 | - | - |\n| crop | ChooseImageCropOptions | 否 | - | - |\n| type | string | 是 | - | - |\n\n#### UniCloudChooseAndUploadFileOptions 的方法 @unicloudchooseanduploadfileoptions-values \n\n#### onChooseFile(arg) @onchoosefile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | [UniCloudChooseFileResult](#unicloudchoosefileresult-values) | 是 | - | - |\n###### UniCloudChooseFileResult 的属性值 @unicloudchoosefileresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFiles | Array\\<[UniCloudChooseFileItem](#unicloudchoosefileitem-values)\\> | 是 | - | - |\n| tempFilePaths | Array\\ | 是 | - | - |\n\n###### UniCloudChooseFileItem 的属性值 @unicloudchoosefileitem-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | - |\n| path | string | 是 | - | - |\n| cloudPath | string | 是 | - | - |\n| cloudPathAsRealPath | boolean | 否 | - | - |\n| url | string | 否 | - | - |\n| errMsg | string | 否 | - | - |\n\n\n\n\n#### onUploadProgress(arg) @onuploadprogress\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | [UniCloudChooseAndUploadFileProgressEvent](#unicloudchooseanduploadfileprogressevent-values) | 是 | - | - |\n###### UniCloudChooseAndUploadFileProgressEvent 的属性值 @unicloudchooseanduploadfileprogressevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | - |\n| loaded | number | 是 | - | - |\n| total | number | 是 | - | - |\n| tempFilePath | string | 是 | - | - |\n| tempFile | [UniCloudChooseFileItem](#unicloudchoosefileitem-values) | 是 | - | - |\n\n\n\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudChooseAndUploadFileResult](#unicloudchooseanduploadfileresult-values)> | \n\n#### UniCloudChooseAndUploadFileResult 的属性值 @unicloudchooseanduploadfileresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFiles | Array\\<[UniCloudChooseFileItem](#unicloudchoosefileitem-values)\\> | 是 | - | - |\n| tempFilePaths | Array\\ | 是 | - | - |\n\n##### UniCloudChooseFileItem 的属性值 @unicloudchoosefileitem-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | - |\n| path | string | 是 | - | - |\n| cloudPath | string | 是 | - | - |\n| cloudPathAsRealPath | boolean | 否 | - | - |\n| url | string | 否 | - | - |\n| errMsg | string | 否 | - | - |\n","compatibility":"### chooseAndUploadFile 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-file-api.getTempFileURL)\n"},"unicloud-file-api":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-file-api/unicloud-file-api.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/unicloud-file-api/unicloud-file-api\n>Template\n```vue\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: '云存储'\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n },\r\n methods: {\r\n uploadFile: function () {\r\n uni.chooseImage({\r\n count: 1,\r\n success(res) : void {\r\n uni.showLoading({\r\n title: '上传中...'\r\n })\r\n const tempFilePath = res.tempFilePaths[0]\r\n uniCloud.uploadFile({\r\n filePath: tempFilePath,\r\n cloudPath: 'test.jpg'\r\n })\r\n .then(function (res) {\r\n uni.hideLoading()\r\n console.log(res)\r\n uni.showModal({\r\n content: '上传成功',\r\n showCancel: false\r\n });\r\n })\r\n .catch(function (err : any | null) {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n uni.showModal({\r\n content: '上传失败,' + error.errMsg,\r\n showCancel: false\r\n });\r\n })\r\n // .finally((_: number) : void => {\r\n // uni.hideLoading()\r\n // })\r\n },\r\n fail(err) : void {\r\n console.error('chooseImage fail: ', err)\r\n }\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"databaseForJQL":{"name":"## databaseForJQL() @databaseforjql","description":"获取数据库操作实例","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [Database](#database-values) | \n\n#### Database 的属性值 @database-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| command | any | 是 | - | - |\n| Geo | any | 是 | - | - |\n\n#### Database 的方法 @database-values \n\n#### collection(args?) @collection\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| args | Array\\ | 否 | - | - |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [Collection](#collection-values) | \n\n###### Collection 的方法 @collection-values \n\n##### where(condition) @where\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| condition | any | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n###### UniCloudDBFilter 的方法 @uniclouddbfilter-values \n\n##### get(arg?) @get\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | any | 否 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBGetResult](#uniclouddbgetresult-values)> | \n\n###### UniCloudDBGetResult 的属性值 @uniclouddbgetresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | Array\\ | 是 | - | tResult = { /** |\n| count | number | 否 | - | SONObject>; /** |\n| requestId | string | 否 | - | ber \\| null; / |\n\n\n\n##### count() @count\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBCountResult](#uniclouddbcountresult-values)> | \n\n###### UniCloudDBCountResult 的属性值 @uniclouddbcountresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| total | number | 是 | - | tResult = { /** |\n| requestId | string | 否 | - | al: number; / |\n\n\n\n##### update(data) @update\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBUpdateResult](#uniclouddbupdateresult-values)> | \n\n###### UniCloudDBUpdateResult 的属性值 @uniclouddbupdateresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| updated | number | 是 | - | eResult = { /** |\n| requestId | string | 否 | - | ed: number; / |\n\n\n\n##### remove() @remove\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBRemoveResult](#uniclouddbremoveresult-values)> | \n\n###### UniCloudDBRemoveResult 的属性值 @uniclouddbremoveresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| deleted | number | 是 | - | eResult = { /** |\n| requestId | string | 否 | - | ed: number; / |\n\n\n\n##### getTemp() @gettemp\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n\n##### where(condition) @where\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| condition | any | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### doc(docId) @doc\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| docId | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### field(filed) @field\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filed | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n###### UniCloudDBQuery 的方法 @uniclouddbquery-values \n\n##### get(arg?) @get\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | any | 否 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBGetResult](#uniclouddbgetresult-values)> | \n\n\n\n##### count() @count\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBCountResult](#uniclouddbcountresult-values)> | \n\n\n\n##### getTemp() @gettemp\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n\n##### field(filed) @field\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filed | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### skip(num) @skip\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### limit(num) @limit\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### orderBy(order) @orderby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| order | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupBy(field) @groupby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupField(field) @groupfield\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### distinct(field) @distinct\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### geoNear(options) @geonear\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n\n\n##### skip(num) @skip\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### limit(num) @limit\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### orderBy(order) @orderby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| order | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupBy(field) @groupby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupField(field) @groupfield\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### distinct(field) @distinct\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### geoNear(options) @geonear\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n\n\n##### doc(docId) @doc\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| docId | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### aggregate() @aggregate\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### foreignKey(foreignKey) @foreignkey\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| foreignKey | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### add(data) @add\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBAddResult](#uniclouddbaddresult-values)> | \n\n###### UniCloudDBAddResult 的属性值 @uniclouddbaddresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | string | 是 | - | dResult = { /** |\n| requestId | string | 否 | - | string; / |\n\n\n\n##### get(arg?) @get\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | any | 否 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBGetResult](#uniclouddbgetresult-values)> | \n\n\n\n##### count() @count\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise<[UniCloudDBCountResult](#uniclouddbcountresult-values)> | \n\n\n\n##### getTemp() @gettemp\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n\n##### field(filed) @field\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filed | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### skip(num) @skip\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### limit(num) @limit\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### orderBy(order) @orderby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| order | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n\n","compatibility":"### databaseForJQL 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.91,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-database.databaseForJQL)\n"},"unicloud-database":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-database/unicloud-database.uvue) \n ::: preview https://hellouniappx.dcloud.net.cn/web/#/pages/API/unicloud-database/unicloud-database\n>Template\n```vue\n\r\n\r\n\r\n\r\n\r\n\n```\n>Script\n```uts\n\r\n export default {\r\n data() {\r\n return {\r\n title: 'ClientDB',\r\n addId: '',\r\n batchAddIds: [] as Array,\r\n batchAddinserted: 0,\r\n updateUpdated: 0,\r\n getData: [] as Array,\r\n getWithCommandData: [] as Array,\r\n removeDeleted: 0,\r\n lookupData: [] as Array,\r\n isUniTest: false\r\n }\r\n },\r\n onLoad() {\r\n },\r\n onUnload() {\r\n if (this.isUniTest) {\r\n uni.hideToast()\r\n }\r\n },\r\n computed: {\r\n dataTag() : string {\r\n return this.isUniTest ? 'default-tag' + Date.now() : 'default-tag'\r\n }\r\n },\r\n methods: {\r\n notify(content : string, title : string) {\r\n if (!this.isUniTest) {\r\n uni.showModal({\r\n title,\r\n content,\r\n showCancel: false\r\n })\r\n } else {\r\n uni.showToast({\r\n title: content\r\n })\r\n console.log(title, content)\r\n }\r\n },\r\n async dbAdd() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n await db.collection('type')\r\n .add({\r\n num: 1,\r\n tag: this.dataTag,\r\n date: new Date()\r\n })\r\n .then(res => {\r\n uni.hideLoading()\r\n console.log(res)\r\n this.addId = res.id\r\n this.notify(`新增成功,id: ${res.id}`, '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n },\r\n async dbBatchAdd() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n await db.collection('type')\r\n .add([{\r\n num: 2,\r\n tag: this.dataTag,\r\n }, {\r\n num: 3,\r\n tag: this.dataTag,\r\n }])\r\n .then((res) => {\r\n uni.hideLoading()\r\n console.log(res)\r\n console.log('JSON.stringify(res.inserted)', JSON.stringify(res.inserted))\r\n this.batchAddIds = res.ids\r\n this.batchAddinserted = res.inserted\r\n this.notify(`新增成功条数${res.inserted}, id列表: ${res.ids.join(',')}`, '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n },\r\n async dbGet() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n await db.collection('type')\r\n .where(\r\n `tag == \"${this.dataTag}\"`\r\n )\r\n .field('num, tag')\r\n .orderBy('num desc')\r\n .skip(1)\r\n .limit(2)\r\n .get()\r\n .then(res => {\r\n uni.hideLoading()\r\n console.log(res)\r\n this.getData = res.data\r\n this.notify(`获取成功,取到了${res.data.length}条数据`, '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n },\r\n async dbGetWithCommand() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n await db.collection('type')\r\n .where({\r\n num: db.command.gt(1),\r\n tag: this.dataTag\r\n })\r\n .field('num, tag')\r\n .orderBy('num desc')\r\n .skip(1)\r\n .limit(2)\r\n .get()\r\n .then(res => {\r\n uni.hideLoading()\r\n console.log(res)\r\n this.getWithCommandData = res.data\r\n this.notify(`获取成功,取到了${res.data.length}条数据`, '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n },\r\n async dbUpdate() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n await db.collection('type')\r\n .where(\r\n `tag == \"${this.dataTag}\"`\r\n )\r\n .update({\r\n num: 4\r\n })\r\n .then(res => {\r\n uni.hideLoading()\r\n console.log(res)\r\n this.updateUpdated = res.updated\r\n this.notify(`更新成功,更新了${res.updated}条数据`, '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n },\r\n async dbRemove() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n await db.collection('type')\r\n .where(\r\n `tag == \"${this.dataTag}\"`\r\n )\r\n .remove()\r\n .then(res => {\r\n uni.hideLoading()\r\n console.log(res)\r\n this.removeDeleted = res.deleted\r\n this.notify(`删除成功,删掉了${res.deleted}条数据`, '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n },\r\n async dbLookupInit() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n await db.collection('local')\r\n .where(`tag == \"${this.dataTag}\"`)\r\n .remove()\r\n .then(() : Promise => {\r\n return db.collection('foreign')\r\n .where(`tag == \"${this.dataTag}\"`)\r\n .remove()\r\n })\r\n .then(() : Promise => {\r\n return db.collection('local')\r\n .add([{\r\n id: \"local_1\",\r\n name: \"local_1_name\",\r\n tag: this.dataTag,\r\n foreign_id: \"foreign_1\"\r\n }, {\r\n id: \"local_2\",\r\n name: \"local_2_name\",\r\n tag: this.dataTag,\r\n foreign_id: \"foreign_2\"\r\n }])\r\n })\r\n .then(() : Promise => {\r\n return db.collection('foreign')\r\n .add([{\r\n id: \"foreign_1\",\r\n name: \"foreign_1_name\",\r\n tag: this.dataTag\r\n }, {\r\n id: \"foreign_2\",\r\n name: \"foreign_2_name\",\r\n tag: this.dataTag\r\n }])\r\n })\r\n .then((_) : void => {\r\n uni.hideLoading()\r\n this.notify('数据初始化成功', '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n console.error(err)\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n },\r\n async dbLookup() : Promise {\r\n uni.showLoading({\r\n title: '加载中...'\r\n })\r\n const db = uniCloud.databaseForJQL()\r\n const local = db.collection('local')\r\n .where(`tag == \"${this.dataTag}\"`)\r\n .getTemp()\r\n const foreign = db.collection('foreign')\r\n .where(`tag == \"${this.dataTag}\"`)\r\n .getTemp()\r\n await db.collection(local, foreign)\r\n .get()\r\n .then(res => {\r\n uni.hideLoading()\r\n console.log(res)\r\n this.lookupData = res.data\r\n this.notify(`联表查询成功,取到了${res.data.length}条数据`, '提示')\r\n })\r\n .catch((err : any | null) => {\r\n uni.hideLoading()\r\n const error = err as UniCloudError\r\n this.notify(error.errMsg, '错误')\r\n })\r\n }\r\n }\r\n }\r\n\n```\n\n:::"},"onResponse":{"name":"## onResponse(callback) @onresponse","description":"监听响应事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### onResponse 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.get-current-user-info)\n"},"offResponse":{"name":"## offResponse(callback) @offresponse","description":"移除响应事件监听","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### offResponse 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.on-response)\n"},"onRefreshToken":{"name":"## onRefreshToken(callback) @onrefreshtoken","description":"监听token刷新事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### onRefreshToken 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.off-response)\n"},"offRefreshToken":{"name":"## offRefreshToken(callback) @offrefreshtoken","description":"移除token刷新事件监听","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### offRefreshToken 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.on-refresh-token)\n"},"getCurrentUserInfo":{"name":"## getCurrentUserInfo() @getcurrentuserinfo","description":"获取token内缓存的用户信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudUserInfo](#uniclouduserinfo-values) | \n\n#### UniCloudUserInfo 的属性值 @uniclouduserinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| uid | string | 否 | - | serInfo = { / |\n| role | Array\\ | 是 | - | ing \\| null; /** |\n| permission | Array\\ | 是 | - | ay\\; /** |\n| tokenExpired | number | 是 | - | ay\\; /** |\n","compatibility":"### getCurrentUserInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.off-refresh-token)\n"}} \ No newline at end of file +{"uniCloud_props":{"name":"# uniCloud","description":"","param":"## 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| config | [UniCloudInitOptions](#unicloudinitoptions-values) | 是 | - | - |\n| mixinDatacom | any | 是 | - | - |\n### UniCloudInitOptions 的属性值 @unicloudinitoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| provider | string | 是 | - | 服务商,目前支持 aliyun、tencent、alipay |\n| spaceName | string | 否 | - | 服务空间名 |\n| spaceId | string | 是 | - | 服务空间id |\n| clientSecret | string | 否 | - | 阿里云clientSecret |\n| endpoint | string | 否 | - | 阿里云endpoint |\n| spaceAppId | string | 否 | - | 支付宝小程序云spaceAppId |\n| accessKey | string | 否 | - | 支付宝小程序云accessKey |\n| secretKey | string | 否 | - | 支付宝小程序云secretKey |\n","returnValue":"","compatibility":"","tutorial":""},"callFunction":{"name":"## callFunction(options) @callfunction","description":"请求云函数","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudCall() => voidOptions](#unicloudcallfunctionoptions-values) | 是 | - | - |\n#### UniCloudCallFunctionOptions 的属性值 @unicloudcallfunctionoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string (string.Cloud)() => voidString | 是 | - | 云函数名 |\n| data | any | 否 | - | 云函数参数 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudCall() => voidResult](#unicloudcallfunctionresult-values)> | \n\n#### UniCloudCallFunctionResult 的属性值 @unicloudcallfunctionresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| result | any | 是 | - | 云函数返回结果 |\n| requestId | string | 否 | - | 云函数请求id |\n","compatibility":"### callFunction 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-call-function.callFunction)\n"},"unicloud-call-function":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-call-function/unicloud-call-function.uvue) \n ```vue\n\n\n\n\n\n\n```"},"importObject":{"name":"## importObject(objectName, options?) @importobject","description":"引用云对象","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| objectName | string (string.CloudObjectString) | 是 | - | - |\n| options | [UniCloudImportObjectOptions](#unicloudimportobjectoptions-values) | 否 | - | - |\n#### UniCloudImportObjectOptions 的属性值 @unicloudimportobjectoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| customUI | boolean \\| null | 否 | - | 是否移除自动展示的ui |\n| loadingOptions | [UniCloudImportObjectLoadingOptions](#unicloudimportobjectloadingoptions-values) \\| null | 否 | - | loading界面配置 |\n| errorOptions | [UniCloudImportObjectErrorOptions](#unicloudimportobjecterroroptions-values) \\| null | 否 | - | 错误提示配置 |\n\n##### UniCloudImportObjectLoadingOptions 的属性值 @unicloudimportobjectloadingoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| title | string \\| null | 否 | - | 加载框标题 |\n| mask | boolean \\| null | 否 | - | 加载框是否显示mask |\n\n##### UniCloudImportObjectErrorOptions 的属性值 @unicloudimportobjecterroroptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string \\| null | 否 | - | 错误提示类型,可以是modal或者toast |\n| retry | boolean \\| null | 否 | - | 是否显示重试按钮 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| any | \n","compatibility":"### importObject 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-import-object.importObject)\n"},"unicloud-import-object":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-import-object/unicloud-import-object.uvue) \n ```vue\n\n\n\n\n\n\n```"},"uploadFile":{"name":"## uploadFile(options) @uploadfile","description":"上传文件到云存储","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudUploadFileOptions](#uniclouduploadfileoptions-values) | 是 | - | - |\n#### UniCloudUploadFileOptions 的属性值 @uniclouduploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string | 是 | - | 文件路径 |\n| cloudPath | string | 是 | - | 云端路径 |\n| cloudPathAsRealPath | boolean | 否 | - | 是否以云端路径是否为真实路径保存上传的文件 |\n\n#### UniCloudUploadFileOptions 的方法 @uniclouduploadfileoptions-values \n\n#### onUploadProgress(options) @onuploadprogress\n\n上传进度回调\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudUploadProgress](#uniclouduploadprogress-values) | 是 | - | 上传进度回调参数 |\n###### UniCloudUploadProgress 的属性值 @uniclouduploadprogress-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| loaded | number | 是 | - | 已上传大小 |\n| total | number | 是 | - | 总大小 |\n\n##### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudUploadFileResult](#uniclouduploadfileresult-values)> | \n\n#### UniCloudUploadFileResult 的属性值 @uniclouduploadfileresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filePath | string | 是 | - | 文件路径 |\n| fileID | string | 是 | - | 文件id |\n","compatibility":"### uploadFile 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-file-api.upload-file)\n"},"getTempFileURL":{"name":"## getTempFileURL(options) @gettempfileurl","description":"获取文件临时URL","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudGetTempFileURLOptions](#unicloudgettempfileurloptions-values) | 是 | - | - |\n#### UniCloudGetTempFileURLOptions 的属性值 @unicloudgettempfileurloptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fileList | Array\\ | 是 | - | 文件列表 |\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudGetTempFileURLResult](#unicloudgettempfileurlresult-values)> | \n\n#### UniCloudGetTempFileURLResult 的属性值 @unicloudgettempfileurlresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fileList | Array\\<[UniCloudGetTempFileURLResultItem](#unicloudgettempfileurlresultitem-values)\\> | 是 | - | 文件列表 |\n\n##### UniCloudGetTempFileURLResultItem 的属性值 @unicloudgettempfileurlresultitem-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| fileID | string | 是 | - | 文件id |\n| tempFileURL | string | 是 | - | 文件临时url |\n","compatibility":"### getTempFileURL 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-file-api.choose-and-upload-file)\n"},"chooseAndUploadFile":{"name":"## chooseAndUploadFile(options) @chooseanduploadfile","description":"选择并上传文件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | [UniCloudChooseAndUploadFileOptions](#unicloudchooseanduploadfileoptions-values) | 是 | - | - |\n#### UniCloudChooseAndUploadFileOptions 的属性值 @unicloudchooseanduploadfileoptions-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| sourceType | Array\\ \\| null | 否 | - | |\n| count | number \\| null | 否 | - | |\n| sizeType | Array\\ \\| null | 否 | - | |\n| extension | Array\\ \\| null | 否 | - | |\n| compressed | boolean \\| null | 否 | - | |\n| maxDuration | number \\| null | 否 | - | |\n| camera | string \\| null | 否 | - | |\n| crop | ChooseImageCropOptions \\| null | 否 | - | |\n| type | string | 是 | - | - |\n\n#### UniCloudChooseAndUploadFileOptions 的方法 @unicloudchooseanduploadfileoptions-values \n\n#### onChooseFile(arg) @onchoosefile\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | [UniCloudChooseFileResult](#unicloudchoosefileresult-values) | 是 | - | - |\n###### UniCloudChooseFileResult 的属性值 @unicloudchoosefileresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFiles | Array\\<[UniCloudChooseFileItem](#unicloudchoosefileitem-values)\\> | 是 | - | - |\n| tempFilePaths | Array\\ | 是 | - | - |\n\n###### UniCloudChooseFileItem 的属性值 @unicloudchoosefileitem-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | - |\n| path | string | 是 | - | - |\n| cloudPath | string | 是 | - | - |\n| cloudPathAsRealPath | boolean \\| null | 否 | - | |\n| url | string \\| null | 否 | - | |\n| errMsg | string \\| null | 否 | - | |\n\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| void \\| null | 否 | \n\n\n\n#### onUploadProgress(arg) @onuploadprogress\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | [UniCloudChooseAndUploadFileProgressEvent](#unicloudchooseanduploadfileprogressevent-values) | 是 | - | - |\n###### UniCloudChooseAndUploadFileProgressEvent 的属性值 @unicloudchooseanduploadfileprogressevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| index | number | 是 | - | - |\n| loaded | number | 是 | - | - |\n| total | number | 是 | - | - |\n| tempFilePath | string | 是 | - | - |\n| tempFile | [UniCloudChooseFileItem](#unicloudchoosefileitem-values) | 是 | - | - |\n\n##### 返回值 \n\n| 类型 | 必备 |\n| :- | :- |\n| void \\| null | 否 | \n\n\n","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudChooseAndUploadFileResult](#unicloudchooseanduploadfileresult-values)> | \n\n#### UniCloudChooseAndUploadFileResult 的属性值 @unicloudchooseanduploadfileresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| tempFiles | Array\\<[UniCloudChooseFileItem](#unicloudchoosefileitem-values)\\> | 是 | - | - |\n| tempFilePaths | Array\\ | 是 | - | - |\n\n##### UniCloudChooseFileItem 的属性值 @unicloudchoosefileitem-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| name | string | 是 | - | - |\n| path | string | 是 | - | - |\n| cloudPath | string | 是 | - | - |\n| cloudPathAsRealPath | boolean \\| null | 否 | - | |\n| url | string \\| null | 否 | - | |\n| errMsg | string \\| null | 否 | - | |\n","compatibility":"### chooseAndUploadFile 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-file-api.getTempFileURL)\n"},"unicloud-file-api":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-file-api/unicloud-file-api.uvue) \n ```vue\n\n\n\n\n\n```"},"databaseForJQL":{"name":"## databaseForJQL() @databaseforjql","description":"获取数据库操作实例","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [Database](#database-values) | \n\n#### Database 的属性值 @database-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| command | any | 是 | - | - |\n| Geo | any | 是 | - | - |\n\n#### Database 的方法 @database-values \n\n#### collection(args?) @collection\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| args | Array\\ | 否 | - | - |\n##### 返回值 \n\n| 类型 |\n| :- |\n| [Collection](#collection-values) | \n\n###### Collection 的方法 @collection-values \n\n##### where(condition) @where\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| condition | any | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n###### UniCloudDBFilter 的方法 @uniclouddbfilter-values \n\n##### get(arg?) @get\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | any \\| null | 否 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBGetResult](#uniclouddbgetresult-values)> | \n\n###### UniCloudDBGetResult 的属性值 @uniclouddbgetresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | Array\\ | 是 | - | etResult = { /** |\n| count | number \\| null | 否 | - | JSONObject>;
/** |\n| requestId | string | 否 | - | ber \\| null; / |\n\n\n\n##### count() @count\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBCountResult](#uniclouddbcountresult-values)> | \n\n###### UniCloudDBCountResult 的属性值 @uniclouddbcountresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| total | number | 是 | - | ntResult = { /** |\n| requestId | string | 否 | - | al: number; / |\n\n\n\n##### update(data) @update\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBUpdateResult](#uniclouddbupdateresult-values)> | \n\n###### UniCloudDBUpdateResult 的属性值 @uniclouddbupdateresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| updated | number | 是 | - | teResult = { /** |\n| requestId | string | 否 | - | ted: number; / |\n\n\n\n##### remove() @remove\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBRemoveResult](#uniclouddbremoveresult-values)> | \n\n###### UniCloudDBRemoveResult 的属性值 @uniclouddbremoveresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| deleted | number | 是 | - | veResult = { /** |\n| requestId | string | 否 | - | ted: number; / |\n\n\n\n##### getTemp() @gettemp\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n\n##### where(condition) @where\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| condition | any | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### doc(docId) @doc\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| docId | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### field(filed) @field\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filed | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n###### UniCloudDBQuery 的方法 @uniclouddbquery-values \n\n##### get(arg?) @get\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | any \\| null | 否 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBGetResult](#uniclouddbgetresult-values)> | \n\n\n\n##### count() @count\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBCountResult](#uniclouddbcountresult-values)> | \n\n\n\n##### getTemp() @gettemp\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n\n##### field(filed) @field\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filed | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### skip(num) @skip\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### limit(num) @limit\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### orderBy(order) @orderby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| order | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupBy(field) @groupby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupField(field) @groupfield\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### distinct(field) @distinct\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### geoNear(options) @geonear\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n\n\n##### skip(num) @skip\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### limit(num) @limit\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### orderBy(order) @orderby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| order | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupBy(field) @groupby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### groupField(field) @groupfield\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### distinct(field) @distinct\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| field | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### geoNear(options) @geonear\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| options | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n\n\n##### doc(docId) @doc\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| docId | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### aggregate() @aggregate\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### foreignKey(foreignKey) @foreignkey\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| foreignKey | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBFilter](#uniclouddbfilter-values) | \n\n\n\n##### add(data) @add\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| data | any | 是 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBAddResult](#uniclouddbaddresult-values)> | \n\n###### UniCloudDBAddResult 的属性值 @uniclouddbaddresult-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| id | string | 是 | - | ddResult = { /** |\n| requestId | string | 否 | - | string; / |\n\n\n\n##### get(arg?) @get\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| arg | any \\| null | 否 | - | |\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBGetResult](#uniclouddbgetresult-values)> | \n\n\n\n##### count() @count\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| Promise\\<[UniCloudDBCountResult](#uniclouddbcountresult-values)> | \n\n\n\n##### getTemp() @gettemp\n\n\n###### 返回值 \n\n| 类型 |\n| :- |\n| any | \n\n\n\n##### field(filed) @field\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| filed | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### skip(num) @skip\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### limit(num) @limit\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| num | number | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n##### orderBy(order) @orderby\n\n##### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| order | string | 是 | - | - |\n###### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudDBQuery](#uniclouddbquery-values) | \n\n\n\n\n","compatibility":"### databaseForJQL 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.91,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-database.databaseForJQL)\n"},"unicloud-database":{"example":"## 示例 \n> [hello uni-app x](https://gitcode.net/dcloud/hello-uni-app-x/-/blob/alpha/pages/API/unicloud-database/unicloud-database.uvue) \n ```vue\n\n\n\n\n\n\n```"},"onResponse":{"name":"## onResponse(callback) @onresponse","description":"监听响应事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any \\| null | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### onResponse 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.get-current-user-info)\n"},"offResponse":{"name":"## offResponse(callback) @offresponse","description":"移除响应事件监听","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any \\| null | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### offResponse 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.on-response)\n"},"onRefreshToken":{"name":"## onRefreshToken(callback) @onrefreshtoken","description":"监听token刷新事件","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any \\| null | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### onRefreshToken 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.off-response)\n"},"offRefreshToken":{"name":"## offRefreshToken(callback) @offrefreshtoken","description":"移除token刷新事件监听","param":"### 参数 \n\n| 名称 | 类型 | 必填 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| callback | (arg: [UniCloudResponseEvent](#unicloudresponseevent-values)) => any \\| null | 是 | - | - |\n#### UniCloudResponseEvent 的属性值 @unicloudresponseevent-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| type | string | 是 | - | 响应事件类型 |\n| name | string | 是 | - | 响应事件由哪个云函数触发 |\n| content | any | 是 | - | 响应结果、错误内容 |\n","returnValue":"","compatibility":"### offRefreshToken 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.on-refresh-token)\n"},"getCurrentUserInfo":{"name":"## getCurrentUserInfo() @getcurrentuserinfo","description":"获取token内缓存的用户信息","param":"","returnValue":"### 返回值 \n\n| 类型 |\n| :- |\n| [UniCloudUserInfo](#uniclouduserinfo-values) | \n\n#### UniCloudUserInfo 的属性值 @uniclouduserinfo-values \n\n| 名称 | 类型 | 必备 | 默认值 | 描述 |\n| :- | :- | :- | :- | :- |\n| uid | string \\| null | 否 | - | UserInfo = {
/ |\n| role | Array\\ | 是 | - | ing \\| null; / |\n| permission | Array\\ | 是 | - | ay\\; / |\n| tokenExpired | number | 是 | - | ay\\; /** |\n","compatibility":"### getCurrentUserInfo 兼容性 \n| Android | iOS | web |\n| :- | :- | :- |\n| 阿里云 3.9,腾讯云 3.91 | x | - |\n","tutorial":"\n### 参见\n[相关 Bug](https://issues.dcloud.net.cn/?mid=api.unicloud.unicloud-utils.off-refresh-token)\n"}} \ No newline at end of file -- GitLab