From 65f84a6b7ce9690d8f8b7007f3cae1ea77c6c807 Mon Sep 17 00:00:00 2001 From: "ext.liuweijian3" Date: Thu, 27 Nov 2025 13:33:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(ascf):=20=E5=A2=9E=E5=8A=A0ascf=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=BA=A6=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/canIUse/ascf.json | 1457 +++++++++++++++++++++++++++++++++++ src/pages/canIUse/index.js | 6 +- 2 files changed, 1462 insertions(+), 1 deletion(-) create mode 100644 src/pages/canIUse/ascf.json diff --git a/src/pages/canIUse/ascf.json b/src/pages/canIUse/ascf.json new file mode 100644 index 000000000000..8373f3be5e99 --- /dev/null +++ b/src/pages/canIUse/ascf.json @@ -0,0 +1,1457 @@ +{ + "key": "ASCF元服务", + "value": [ + { + "key": "movable-area", + "value": { + "title": "movable-area", + "type": "object", + "properties": { + "scale-area": { + "description": "当里面的movable-view设置为支持双指缩放时,设置此值可将缩放手势生效区域修改为整个movable-area。", + "defaultValue": "false", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + { + "key": "movable-view", + "value": { + "title": "movable-view", + "type": "object", + "properties": { + "direction": { + "description": "movable-view的移动方向,属性值有all、vertical、horizontal、none。", + "type": "string" + }, + "inertia": { + "description": "movable-view是否带有惯性。", + "defaultValue": "false", + "type": "boolean" + }, + "out-of-bounds": { + "description": "超过可移动区域后,movable-view是否还可以移动。", + "defaultValue": "false", + "type": "boolean" + }, + "x": { + "description": "定义x轴方向的偏移,如果x的值不在可移动范围内,会自动移动到可移动范围;改变x的值会触发动画。", + "type": "number" + }, + "y": { + "description": "定义y轴方向的偏移,如果y的值不在可移动范围内,会自动移动到可移动范围;改变y的值会触发动画。", + "type": "number" + }, + "damping": { + "description": "阻尼系数,用于控制x或y改变时的动画和过界回弹的动画,值越大移动越快。", + "defaultValue": "20", + "type": "number" + }, + "friction": { + "description": "摩擦系数,用于控制惯性滑动的动画,值越大摩擦力越大,滑动越快停止;必须大于0,否则会被设置成默认值。", + "defaultValue": "2", + "type": "number" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "scale": { + "description": "是否支持双指缩放,默认缩放手势生效区域是在movable-view内。", + "defaultValue": "false", + "type": "boolean" + }, + "scale-min": { + "description": "定义缩放倍数最小值。起始版本:1.0.3", + "defaultValue": "0.1", + "type": "number" + }, + "scale-max": { + "description": "定义缩放倍数最大值。起始版本:1.0.3", + "defaultValue": "10", + "type": "number" + }, + "scale-value": { + "description": "定义缩放倍数,取值范围为 0.5 ~ 10。", + "defaultValue": "1", + "type": "number" + }, + "animation": { + "description": "是否使用动画。", + "defaultValue": "true", + "type": "boolean" + }, + "onChange": { + "description": "拖动过程中触发的事件,event.detail = {x, y, source}。", + "tsType": "() => void" + }, + "onScale": { + "description": "缩放过程中触发的事件,event.detail = {x, y, scale}。", + "tsType": "() => void" + }, + "onHTouchMove": { + "description": "初次手指触摸后移动为横向的移动时触发,如果catch此事件,则意味着touchmove事件也被catch(暂不支持)。", + "tsType": "() => void" + }, + "onVTouchMove": { + "description": "初次手指触摸后移动为纵向的移动时触发,如果catch此事件,则意味着touchmove事件也被catch(暂不支持)。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "scroll-view", + "value": { + "title": "scroll-view", + "type": "object", + "properties": { + "scroll-x": { + "description": "允许横向滚动。", + "defaultValue": "false", + "type": "boolean" + }, + "scroll-y": { + "description": "允许纵向滚动。", + "defaultValue": "false", + "type": "boolean" + }, + "upper-threshold": { + "description": "距顶部/左边多远时,触发 scrolltoupper 事件。", + "defaultValue": "50", + "type": "number/string" + }, + "lower-threshold": { + "description": "距底部/右边多远时,触发 scrolltolower 事件。", + "defaultValue": "50", + "type": "number/string" + }, + "scroll-top": { + "description": "设置竖向滚动条位置。", + "type": "number/string" + }, + "scroll-left": { + "description": "设置横向滚动条位置。", + "type": "number/string" + }, + "scroll-into-view": { + "description": "值应为某子元素id(id不能以数字开头)。设置哪个方向可滚动,则在哪个方向滚动到该元素。", + "type": "string" + }, + "scroll-with-animation": { + "description": "在设置滚动条位置时使用动画过渡。", + "defaultValue": "false", + "type": "boolean" + }, + "show-scrollbar": { + "description": "滚动条显隐控制。", + "defaultValue": "true", + "type": "boolean" + }, + "refresher-enabled": { + "description": "开启自定义下拉刷新。", + "defaultValue": "false", + "type": "boolean" + }, + "refresher-threshold": { + "description": "设置自定义下拉刷新阈值。", + "defaultValue": "45", + "type": "number" + }, + "refresher-default-style": { + "description": "设置自定义下拉刷新默认样式,支持设置 black | white | none, none 表示不使用默认样式。", + "defaultValue": "\"black\"", + "type": "string" + }, + "refresher-background": { + "description": "设置自定义下拉刷新区域背景颜色,默认为透明。", + "type": "string" + }, + "refresher-triggered": { + "description": "设置当前下拉刷新状态,true 表示下拉刷新已经被触发,false 表示下拉刷新未被触发。", + "defaultValue": "false", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + { + "key": "swiper", + "value": { + "title": "swiper", + "type": "object", + "properties": { + "indicator-dots": { + "description": "是否显示面板指示点。", + "defaultValue": "false", + "type": "boolean" + }, + "indicator-color": { + "description": "指示点颜色。", + "defaultValue": "rgba(0, 0, 0, .3)", + "type": "string" + }, + "indicator-active-color": { + "description": "当前选中的指示点颜色。", + "defaultValue": "#0A59F7", + "type": "string" + }, + "current": { + "description": "当前所在滑块的index。起始版本:1.0.3", + "defaultValue": "0", + "type": "number" + }, + "autoplay": { + "description": "是否自动切换。", + "defaultValue": "false", + "type": "boolean" + }, + "interval": { + "description": "自动切换时间间隔。", + "defaultValue": "5000", + "type": "number" + }, + "duration": { + "description": "滑动动画时长。", + "defaultValue": "500", + "type": "number" + }, + "circular": { + "description": "是否采用衔接滑动。", + "defaultValue": "false", + "type": "boolean" + }, + "vertical": { + "description": "滑动方向是否为纵向。", + "defaultValue": "false", + "type": "boolean" + }, + "display-multiple-items": { + "description": "同时显示的滑块数量。", + "defaultValue": "1", + "type": "number" + }, + "previous-margin": { + "description": "前边距,可用于露出前一项的一小部分,支持 px 和 rpx 值。", + "defaultValue": "\"0px\"", + "type": "string" + }, + "next-margin": { + "description": "后边距,可用于露出后一项的一小部分,支持 px 和 rpx 值。", + "defaultValue": "\"0px\"", + "type": "string" + }, + "disable-touch": { + "description": "是否禁止用户 touch 操作。", + "defaultValue": "false", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + { + "key": "swiper-item", + "value": { + "title": "swiper-item", + "type": "object", + "properties": { + "item-id": { + "description": "swiper-item 的标识符。", + "type": "string" + } + }, + "additionalProperties": false + } + }, + { + "key": "view", + "value": { + "title": "view", + "type": "object", + "properties": { + "hover-class": { + "description": "指定按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果。", + "type": "string" + }, + "hover-start-time": { + "description": "按住后多久出现点击态,单位毫秒。", + "defaultValue": "50", + "type": "number" + }, + "hover-stay-time": { + "description": "手指松开后点击态保留时间,单位毫秒。", + "defaultValue": "400", + "type": "number" + }, + "hover-stop-propagation": { + "description": "指定是否阻止本节点的祖先节点出现点击态。", + "defaultValue": "false", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + { + "key": "icon", + "value": { + "title": "icon", + "type": "object", + "properties": { + "type": { + "description": "icon 类型,有效值:success,success_no_circle,success_circle,safe_success,safe_warn,info,info_circle,warn,waiting,waiting_circle,circle,cancel,download,search,clear。", + "type": "string" + }, + "size": { + "description": "icon的大小。", + "defaultValue": "23", + "type": "number/string" + }, + "color": { + "description": "icon 颜色,同 CSS 色值。", + "type": "string" + } + }, + "additionalProperties": false, + "required": ["type"] + } + }, + { + "key": "progress", + "value": { + "title": "progress", + "type": "object", + "properties": { + "percent": { + "description": "百分比0~100。", + "defaultValue": "0", + "type": "number" + }, + "show-info": { + "description": "在进度条右侧显示百分比。", + "defaultValue": "false", + "type": "boolean" + }, + "border-radius": { + "description": "圆角大小。", + "defaultValue": "0", + "type": "number/string" + }, + "font-size": { + "description": "右侧百分比字体大小。", + "defaultValue": "16", + "type": "number/string" + }, + "stroke-width": { + "description": "进度条线的宽度。", + "defaultValue": "4", + "type": "number/string" + }, + "color": { + "description": "进度条进行中颜色,同activeColor。", + "defaultValue": "#0A59F7", + "type": "string" + }, + "activeColor": { + "description": "已选择的进度条的颜色。", + "defaultValue": "#0A59F7", + "type": "string" + }, + "backgroundColor": { + "description": "未选择的进度条的颜色。", + "defaultValue": "rgba(0,0,0,0.098)", + "type": "string" + }, + "active": { + "description": "进度条从左往右的动画。", + "defaultValue": "false", + "type": "boolean" + }, + "active-mode": { + "description": "起始版本:1.0.3", + "defaultValue": "backwards", + "type": "string", + "enum": ["forwards"] + }, + "duration": { + "description": "进度增加1%所需毫秒数。", + "defaultValue": "30", + "type": "number" + }, + "onActiveEnd": { + "description": "动画完成事件。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "rich-text", + "value": { + "title": "rich-text", + "type": "object", + "properties": { + "nodes": { + "description": "节点列表/HTML String。", + "defaultValue": "[]", + "type": "array/string" + }, + "space": { + "description": "显示连续空格,取值为ensp、emsp、nbsp:ensp:中文字符空格一半大小。emsp:中文字符空格大小。nbsp:根据字体设置的空格大小。", + "type": "string" + }, + "user-select": { + "description": "文本是否可选。", + "defaultValue": "false", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + { + "key": "text", + "value": { + "title": "text", + "type": "object", + "properties": { + "user-select": { + "description": "是否可选。", + "defaultValue": "false", + "type": "boolean" + }, + "space": { + "description": "以何种方式显示连续空格。有效值如下:设置非以上有效值时,组件直接显示开发者输入的空格。", + "defaultValue": "emsp", + "type": "string", + "enum": ["nbsp", "ensp", "emsp"] + }, + "decode": { + "description": "是否解码。例如<会显示为<。可以解析',>,<,&, ,  ,   。", + "defaultValue": "false", + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + { + "key": "button", + "value": { + "title": "button", + "type": "object", + "properties": { + "size": { + "description": "按钮的大小。有效值如下:", + "defaultValue": "default", + "type": "string", + "enum": ["default", "mini"] + }, + "type": { + "description": "按钮的样式类型。有效值如下:", + "defaultValue": "default", + "type": "string", + "enum": ["primary", "default", "warn"] + }, + "plain": { + "description": "是否镂空。", + "defaultValue": "false", + "type": "boolean" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "loading": { + "description": "文字前是否带 loading 图标。", + "defaultValue": "false", + "type": "boolean" + }, + "form-type": { + "description": "用于 form 组件,点击分别会触发组件的 submit/reset 事件", + "type": "string", + "enum": ["submit", "reset"] + }, + "open-type": { + "description": "元服务开放的能力,不支持初始化后修改。有效值如下:launchApp:打开应用,可以通过app-bundle-name,app-module-name,app-ability-name,app-parameters属性打开指定应用。当前只支持打开系统应用,或者在元服务跳转三方应用的场景下只能打开同系列开发者的应用,否则会遭到系统生态管控拦截,提示应用无法打开。share:触发用户分享,用户点击按钮后触发 Page.onShareAppMessage 事件,只支持分享首页。依赖关系:HarmonyOS SDK版本≥6.0.0(20) 且ROM版本 ≥ 6.0.0。", + "type": "string", + "enum": ["getPhoneNumber", "openSetting"] + }, + "hover-class": { + "description": "指定按钮按下去的样式类。当 hover-class=\"none\" 时,没有点击态效果。", + "defaultValue": "button-hover", + "type": "string" + }, + "hover-stop-propagation": { + "description": "是否阻止本节点的祖先节点出现点击态。", + "defaultValue": "false", + "type": "boolean" + }, + "hover-start-time": { + "description": "按住后多久出现点击态,单位毫秒。", + "defaultValue": "20", + "type": "number" + }, + "hover-stay-time": { + "description": "手指松开后点击态保留时间,单位毫秒。", + "defaultValue": "70", + "type": "number" + }, + "app-bundle-name": { + "description": "open-type=launchApp时有效,表示待启动Ability所在的应用Bundle名称。起始版本:1.0.6", + "type": "string" + }, + "app-module-name": { + "description": "open-type=launchApp时有效,表示待启动Ability所属的模块名称。起始版本:1.0.6", + "type": "string" + }, + "app-ability-name": { + "description": "open-type=launchApp时有效,表示待启动Ability名称。起始版本:1.0.6", + "type": "string" + }, + "app-parameters": { + "description": "open-type=launchApp时有效,表示启动Ability时的自定义参数。起始版本:1.0.6", + "type": "Object" + }, + "onGetPhoneNumber": { + "description": "获取用户手机号的回调,open-type=\"getPhoneNumber\"时有效。", + "tsType": "() => void" + }, + "onOpenSetting": { + "description": "打开授权设置页面后的回调,open-type=\"openSetting\"时有效,回调数据与has.openSetting返回的一致。", + "tsType": "() => void" + }, + "onLaunchApp": { + "description": "打开应用成功时的回调,open-type=launchApp时有效。起始版本:1.0.6", + "tsType": "() => void" + }, + "onError": { + "description": "当使用开放能力发生错误时的回调,open-type=launchApp时有效。起始版本:1.0.6", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "checkbox", + "value": { + "title": "checkbox", + "type": "object", + "properties": { + "value": { + "description": "组件值,选中时触发checkbox-group的 change 事件,并携带checkbox的 value。", + "type": "string" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "checked": { + "description": "当前是否选中,可用来设置默认选中。", + "defaultValue": "false", + "type": "boolean" + }, + "color": { + "description": "checkbox 的颜色,同 CSS 色值。", + "defaultValue": "#0A59F7", + "type": "string" + } + }, + "additionalProperties": false + } + }, + { + "key": "checkbox-group", + "value": { + "title": "checkbox-group", + "type": "object", + "properties": { + "onChange": { + "description": "checkbox-group中选中项发生改变时触发。detail = {value:[选中的checkbox的value的数组]}。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "form", + "value": { + "title": "form", + "type": "object", + "properties": { + "onSubmit": { + "description": "携带form中的数据触发submit事件,event.detail = {value : {'name': 'value'} , formId: ''}", + "tsType": "() => void" + }, + "onReset": { + "description": "表单重置时会触发 reset 事件", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "input", + "value": { + "title": "input", + "type": "object", + "properties": { + "value": { + "description": "输入框的初始内容。", + "type": "string" + }, + "focus": { + "description": "获取焦点。", + "defaultValue": "false", + "type": "boolean" + }, + "type": { + "description": "input 的类型,有效值如下:", + "defaultValue": "text", + "type": "string", + "enum": ["text", "number"] + }, + "confirm-type": { + "description": "设置键盘右下角按钮的文字,confirm-type的类型,有效值如下:(仅在type='text')时生效。", + "defaultValue": "done", + "type": "string", + "enum": ["send", "search", "next", "go", "done"] + }, + "password": { + "description": "是否是密码类型。", + "defaultValue": "false", + "type": "boolean" + }, + "placeholder": { + "description": "输入框为空时占位符。", + "type": "string" + }, + "placeholder-style": { + "description": "指定placeholder的样式。起始版本:1.0.9", + "type": "string" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "maxlength": { + "description": "最大输入长度,设置为 -1 的时候不限制最大长度。", + "defaultValue": "140", + "type": "number" + }, + "onInput": { + "description": "键盘输入时触发,event.detail = {value}。", + "tsType": "() => void" + }, + "onFocus": { + "description": "输入框聚焦时触发。", + "tsType": "() => void" + }, + "onBlur": { + "description": "输入框失去焦点时触发。", + "tsType": "() => void" + }, + "onConfirm": { + "description": "点击完成按钮时触发。", + "tsType": "() => void" + }, + "placeholder-class": { + "description": "指定placeholder的样式类。起始版本:1.0.9", + "defaultValue": "input-placeholder", + "type": "string" + } + }, + "additionalProperties": false + } + }, + { + "key": "label", + "value": { + "title": "label", + "type": "object", + "properties": { + "for": { + "description": "绑定控件的id。传递非法值时依据实际效果而定。", + "type": "string" + } + }, + "additionalProperties": false + } + }, + { + "key": "picker", + "value": { + "title": "picker", + "type": "object", + "properties": { + "mode": { + "description": "选择器类型。", + "defaultValue": "selector", + "type": "string", + "enum": ["selector", "multiSelector", "time", "date", "region"] + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "onCancel": { + "description": "取消选择时触发。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "picker-view", + "value": { + "title": "picker-view", + "type": "object", + "properties": { + "value": { + "description": "数组中的数字依次表示 picker-view 内的 picker-view-column 选择的第几项(下标从 0 开始),数字大于 picker-view-column 可选项长度时,选择最后一项。", + "type": "Array" + }, + "indicator-style": { + "description": "设置选择器中间选中框的样式。", + "type": "string" + }, + "onChange": { + "description": "滚动选择时触发change事件,event.detail = {value};value为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项(下标从 0 开始)。", + "tsType": "() => void" + }, + "onPickStart": { + "description": "当滚动选择开始时候触发事件。", + "tsType": "() => void" + }, + "onPickEnd": { + "description": "当滚动选择结束时候触发事件。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "picker-view-column", + "value": { + "title": "picker-view-column", + "type": "object", + "properties": {}, + "additionalProperties": false + } + }, + { + "key": "radio", + "value": { + "title": "radio", + "type": "object", + "properties": { + "value": { + "description": "radio 标识。当该radio选中时,radio-group 的 change 事件会携带 radio 的 value。", + "type": "string" + }, + "checked": { + "description": "当前是否选中。", + "defaultValue": "false", + "type": "boolean" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "color": { + "description": "radio的颜色,同css的color。", + "defaultValue": "#0A59F7", + "type": "string" + } + }, + "additionalProperties": false + } + }, + { + "key": "radio-group", + "value": { + "title": "radio-group", + "type": "object", + "properties": { + "onChange": { + "description": "radio-group中选中项发生改变时触发 change 事件,detail = {value:[选中的radio的value的数组]}。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "slider", + "value": { + "title": "slider", + "type": "object", + "properties": { + "min": { + "description": "最小值。", + "defaultValue": "0", + "type": "number" + }, + "max": { + "description": "最大值。", + "defaultValue": "100", + "type": "number" + }, + "step": { + "description": "步长,取值必须大于 0,并且可被(max - min)整除。", + "defaultValue": "1", + "type": "number" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "value": { + "description": "当前取值。", + "defaultValue": "0", + "type": "number" + }, + "activeColor": { + "description": "已选择的颜色。", + "defaultValue": "#0A59F7", + "type": "color" + }, + "backgroundColor": { + "description": "背景条的颜色。", + "defaultValue": "rgba(0, 0, 0, 0.098)", + "type": "color" + }, + "block-size": { + "description": "滑块的大小,取值范围为 12 - 28。", + "defaultValue": "16", + "type": "number" + }, + "block-color": { + "description": "滑块的颜色。", + "defaultValue": "#ffffff", + "type": "color" + }, + "show-value": { + "description": "是否显示当前 value。", + "defaultValue": "false", + "type": "boolean" + }, + "onChange": { + "description": "完成一次拖动后触发的事件,event.detail = {value}。", + "tsType": "() => void" + }, + "onChanging": { + "description": "拖动过程中触发的事件,event.detail = {value}。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "switch", + "value": { + "title": "switch", + "type": "object", + "properties": { + "checked": { + "description": "是否选中。", + "defaultValue": "false", + "type": "boolean" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "type": { + "description": "样式,有效值:switch, checkbox。", + "defaultValue": "switch", + "type": "string" + }, + "color": { + "description": "switch 的颜色,同 css 的 color。", + "defaultValue": "#0A59F7", + "type": "string" + }, + "onChange": { + "description": "点击导致 checked 改变时会触发 change 事件,event.detail={ value}。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "textarea", + "value": { + "title": "textarea", + "type": "object", + "properties": { + "value": { + "description": "输入框的初始内容。", + "type": "string" + }, + "confirm-type": { + "description": "点击textarea拉起输入法后,输入法键盘右下角文字类型,有效值如下:", + "defaultValue": "return", + "type": "string", + "enum": ["send", "search", "next", "go", "done", "return"] + }, + "placeholder": { + "description": "输入框为空时占位符。", + "type": "string" + }, + "focus": { + "description": "获取焦点。起始版本:1.0.5", + "defaultValue": "false", + "type": "boolean" + }, + "placeholder-style": { + "description": "指定 placeholder 的样式,目前仅支持color,font-size和font-weight。", + "type": "string" + }, + "disabled": { + "description": "是否禁用。", + "defaultValue": "false", + "type": "boolean" + }, + "maxlength": { + "description": "最大输入长度,设置为 -1 的时候不限制最大长度。", + "defaultValue": "140", + "type": "number" + }, + "auto-height": { + "description": "是否自动增高,设置auto-height时,style.height不生效。", + "defaultValue": "false", + "type": "boolean" + }, + "onInput": { + "description": "键盘输入时触发,event.detail = {value}。", + "tsType": "() => void" + }, + "onFocus": { + "description": "输入框聚焦时触发。", + "tsType": "() => void" + }, + "onBlur": { + "description": "输入框失去焦点时触发。", + "tsType": "() => void" + }, + "onConfirm": { + "description": "点击完成按钮时触发。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "navigator", + "value": { + "title": "navigator", + "type": "object", + "properties": { + "target": { + "description": "在哪个目标上发生跳转,默认当前元服务。", + "defaultValue": "self", + "type": "string", + "enum": ["self"] + }, + "url": { + "description": "当前元服务内的跳转链接。", + "type": "string" + }, + "open-type": { + "description": "跳转方式,详细内容参见下方“open-type合法值说明”。", + "defaultValue": "navigate", + "type": "string" + }, + "delta": { + "description": "当 open-type 为 'navigateBack' 时有效,表示回退的层数。", + "defaultValue": "1", + "type": "number" + }, + "hover-class": { + "description": "指定点击时的样式类。", + "defaultValue": "navigator-hover", + "type": "string" + }, + "hover-stop-propagation": { + "description": "指定是否阻止本节点的祖先节点出现点击态。", + "defaultValue": "false", + "type": "boolean" + }, + "hover-start-time": { + "description": "按住后多久出现点击态,单位毫秒。", + "defaultValue": "50", + "type": "number" + }, + "hover-stay-time": { + "description": "手指松开后点击态保留时间,单位毫秒。", + "defaultValue": "600", + "type": "number" + } + }, + "additionalProperties": false + } + }, + { + "key": "image", + "value": { + "title": "image", + "type": "object", + "properties": { + "src": { + "description": "图片资源地址。支持线上资源和本地资源,支持png,jpg,jpeg,gif,svg,bmp,webp。", + "type": "string" + }, + "mode": { + "description": "图片裁剪、缩放的模式。详细内容参见“mode合法值说明”。", + "defaultValue": "scaleToFill", + "type": "string" + }, + "onError": { + "description": "当错误发生时触发,event.detail = {errMsg}。", + "tsType": "() => void" + }, + "onLoad": { + "description": "当图片载入完毕时触发,event.detail = {height, width}。", + "tsType": "() => void" + }, + "lazy-load": { + "description": "图片懒加载,在进入视区时才开始加载。起始版本:1.0.9", + "defaultValue": "false", + "type": "boolean" + } + }, + "additionalProperties": false, + "required": ["src"] + } + }, + { + "key": "video", + "value": { + "title": "video", + "type": "object", + "properties": { + "src": { + "description": "视频的数据源。", + "type": "string" + }, + "duration": { + "description": "指定视频时长,单位s。起始版本:1.0.16", + "type": "number" + }, + "controls": { + "description": "是否显示默认播放控件。包括播放/暂停按钮、播放进度、时间、静音按钮、全屏按钮,1.0.16版本增加支持投屏按钮。", + "defaultValue": "true", + "type": "boolean" + }, + "autoplay": { + "description": "是否自动播放。在1.0.15及之前的版本中,需要同步开启静音播放,不支持在非静音状态下自动播放。从1.0.16版本开始,不再有上述限制。", + "defaultValue": "false", + "type": "boolean" + }, + "loop": { + "description": "是否循环播放。", + "defaultValue": "false", + "type": "boolean" + }, + "muted": { + "description": "是否静音播放。", + "defaultValue": "false", + "type": "boolean" + }, + "initial-time": { + "description": "指定视频初始播放位置,单位s。起始版本:1.0.16", + "defaultValue": "0", + "type": "number" + }, + "object-fit": { + "description": "当视频大小与 video 容器大小不一致时,视频的表现形式。起始版本:1.0.3", + "defaultValue": "contain", + "type": "string", + "enum": ["contain", "cover", "fill"] + }, + "poster": { + "description": "视频未播放时的预览图片路径,默认显示视频第一帧,支持网络图片。poster值加载错误时:", + "type": "string" + }, + "direction": { + "description": "设置全屏时视频的方向,不指定则根据宽高比自动判断。起始版本:1.0.16", + "type": "number", + "enum": ["0", "90", "-90"] + }, + "show-casting-button": { + "description": "显示投屏按钮。开始播放后才显示,只支持网络视频投屏。需要权限:开启投屏播放,需要如下配置:起始版本:1.0.16", + "defaultValue": "false", + "type": "boolean" + }, + "show-fullscreen-btn": { + "description": "是否显示全屏按钮。起始版本:1.0.16", + "defaultValue": "true", + "type": "boolean" + }, + "show-play-btn": { + "description": "是否显示视频底部控制栏的播放按钮。起始版本:1.0.16", + "defaultValue": "true", + "type": "boolean" + }, + "play-btn-position": { + "description": "播放按钮的位置。起始版本:1.0.16", + "defaultValue": "bottom", + "type": "string", + "enum": ["bottom", "center"] + }, + "title": { + "description": "视频的标题,全屏时在顶部展示。起始版本:1.0.16", + "type": "string" + }, + "show-screen-lock-button": { + "description": "是否显示锁屏按钮,仅在全屏时显示。起始版本:1.0.16", + "defaultValue": "false", + "type": "boolean" + }, + "enable-auto-rotation": { + "description": "是否开启手机横屏时自动全屏,当系统设置开启自动旋转时生效。起始版本:1.0.16", + "defaultValue": "false", + "type": "boolean" + }, + "enable-progress-gesture": { + "description": "是否开启控制进度的手势。起始版本:1.0.16", + "defaultValue": "true", + "type": "boolean" + }, + "vslide-gesture-in-fullscreen": { + "description": "在全屏模式下,是否开启亮度与音量调节手势。起始版本:1.0.16", + "defaultValue": "true", + "type": "boolean" + }, + "vslide-gesture": { + "description": "在非全屏模式下,是否开启亮度与音量调节手势。起始版本:1.0.16", + "defaultValue": "false", + "type": "boolean" + }, + "show-mute-btn": { + "description": "是否显示静音按钮。起始版本:1.0.16", + "defaultValue": "false", + "type": "boolean" + }, + "enable-play-gesture": { + "description": "是否开启播放手势,即双击切换播放/暂停。起始版本:1.0.16", + "defaultValue": "false", + "type": "boolean" + }, + "onPlay": { + "description": "当开始/继续播放时触发play事件。", + "tsType": "() => void" + }, + "onPause": { + "description": "当暂停播放时触发 pause 事件。", + "tsType": "() => void" + }, + "onEnded": { + "description": "当播放到末尾时触发 ended 事件。", + "tsType": "() => void" + }, + "onTimeUpdate": { + "description": "播放进度变化时触发,event.detail = {currentTime, duration} ,currentTime单位秒,duration单位秒。触发频率 200ms 一次。起始版本:1.0.16", + "tsType": "() => void" + }, + "onFullScreenChange": { + "description": "视频进入和退出全屏时触发,event.detail = {fullScreen, direction},direction 有效值为 vertical 或 horizontal。起始版本:1.0.16", + "tsType": "() => void" + }, + "onWaiting": { + "description": "视频出现缓冲时触发。起始版本:1.0.16", + "tsType": "() => void" + }, + "onError": { + "description": "视频播放出错时触发。起始版本:1.0.16", + "tsType": "() => void" + }, + "onProgress": { + "description": "加载进度变化时触发,只支持一段加载。event.detail = {buffered},buffered为百分比。起始版本:1.0.16", + "tsType": "() => void" + }, + "onLoadedMetaData": { + "description": "视频元数据加载完成时触发。event.detail = {width, height, duration},duration单位秒。起始版本:1.0.16", + "tsType": "() => void" + }, + "onControlsToggle": { + "description": "切换 controls 显示隐藏时触发。event.detail = {show}。起始版本:1.0.16", + "tsType": "() => void" + }, + "onSeekComplete": { + "description": "seek 完成时触发。event.detail = {position},position单位秒。起始版本:1.0.16", + "tsType": "() => void" + }, + "onCastingUserSelect": { + "description": "用户选择投屏设备时触发 detail = { state: \"success\"/\"fail\" }。起始版本:1.0.16", + "tsType": "() => void" + }, + "onCastingStateChange": { + "description": "投屏成功/失败时触发 detail = { type, state: \"success\"/\"fail\" },type值固定为connect。起始版本:1.0.16", + "tsType": "() => void" + }, + "onCastingInterrupt": { + "description": "投屏被中断时触发。起始版本:1.0.16", + "tsType": "() => void" + } + }, + "additionalProperties": false, + "required": ["src"] + } + }, + { + "key": "camera", + "value": { + "title": "camera", + "type": "object", + "properties": { + "device-position": { + "description": "摄像头朝向。", + "defaultValue": "back", + "type": "string", + "enum": ["back", "front"] + }, + "flash": { + "description": "闪光灯。", + "defaultValue": "auto", + "type": "string", + "enum": ["auto", "on", "off", "torch"] + }, + "onStop": { + "description": "摄像头在非正常终止时触发,如退出后台等情况。", + "tsType": "() => void" + }, + "onError": { + "description": "用户不允许使用摄像头时触发。", + "tsType": "() => void" + }, + "onInitDone": { + "description": "相机初始化完成时触发,e.detail = {maxZoom}。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "audio", + "value": { + "title": "audio", + "type": "object", + "properties": { + "id": { + "description": "audio 组件的唯一标识符。", + "type": "string" + }, + "src": { + "description": "要播放音频的资源地址。目前支持在线地址、项目路径、沙箱路径。", + "type": "string" + }, + "loop": { + "description": "是否循环播放。", + "defaultValue": "false", + "type": "boolean" + }, + "controls": { + "description": "是否显示默认控件。", + "defaultValue": "false", + "type": "boolean" + }, + "poster": { + "description": "默认控件上的音频封面的图片资源地址。目前支持在线地址、项目路径、沙箱路径。", + "type": "string" + }, + "name": { + "description": "默认控件上的音频名字。", + "type": "string" + }, + "author": { + "description": "默认控件上的作者名字。", + "type": "string" + }, + "onError": { + "description": "当发生错误时触发 error 事件,detail = {errMsg:MediaError.code}。", + "tsType": "() => void" + }, + "onPlay": { + "description": "当开始/继续播放时触发play事件。", + "tsType": "() => void" + }, + "onPause": { + "description": "当暂停播放时触发 pause 事件。", + "tsType": "() => void" + }, + "onTimeUpdate": { + "description": "当播放进度改变时触发 timeupdate 事件,detail = {currentTime, duration}。", + "tsType": "() => void" + }, + "onEnded": { + "description": "当播放到末尾时触发 ended 事件。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "canvas", + "value": { + "title": "canvas", + "type": "object", + "properties": { + "type": { + "description": "canvas类型,支持 2d", + "type": "string" + }, + "canvas-id": { + "description": "canvas 组件的唯一标识符。", + "type": "string" + }, + "disable-scroll": { + "description": "禁止屏幕滚动以及下拉刷新。", + "defaultValue": "false", + "type": "boolean" + }, + "onTouchStart": { + "description": "手指触摸动作开始。", + "tsType": "() => void" + }, + "onTouchMove": { + "description": "手指触摸后移动。", + "tsType": "() => void" + }, + "onTouchEnd": { + "description": "手指触摸动作结束。", + "tsType": "() => void" + }, + "onTouchCancel": { + "description": "手指触摸动作被打断,如锁屏、切换应用、来电提醒。", + "tsType": "() => void" + }, + "onLongTap": { + "description": "手指长按 500ms 之后触发,触发了长按事件后进行移动不会触发屏幕的滚动。", + "tsType": "() => void" + }, + "onError": { + "description": "当发生错误时触发 error 事件,detail.errMsg。", + "tsType": "() => void" + } + }, + "additionalProperties": false + } + }, + { + "key": "web-view", + "value": { + "title": "web-view", + "type": "object", + "properties": { + "src": { + "description": "webview 指向网页的链接。", + "type": "string" + }, + "onLoad": { + "description": "网页加载成功时候触发此事件。e.detail = { src }。", + "type": "eventhandler" + }, + "onError": { + "description": "网页加载失败的时候触发此事件。e.detail = { src }。", + "type": "eventhandler" + }, + "onMessage": { + "description": "网页通过 postMessage 方法向元服务发送消息,会在特定时机(如:网页后退、组件销毁)触发并收到。e.detail = { data },data 是多次 postMessage 的参数组成的数组。", + "type": "eventhandler" + } + }, + "additionalProperties": false, + "required": ["src"] + } + }, + { + "key": "map", + "value": { + "title": "map", + "type": "object", + "properties": { + "latitude": { + "description": "中国大陆及港澳地区,请使用 gcj02,其他地区请使用 wgs84。", + "defaultValue": "39.9153935", + "type": "number" + }, + "longitude": { + "description": "中心经度。默认为天安门的经度。中国大陆及港澳地区,请使用 gcj02,其他地区请使用 wgs84。", + "defaultValue": "116.4041457", + "type": "number" + }, + "scale": { + "description": "缩放级别,取值范围为2-20。", + "defaultValue": "16", + "type": "number" + }, + "markers": { + "description": "标记点,详见Marker说明。", + "type": "Array" + }, + "circles": { + "description": "圆。", + "type": "Array" + }, + "polyline": { + "description": "路线。", + "type": "Array" + }, + "show-location": { + "description": "显示当前定位点。", + "defaultValue": "FALSE", + "type": "boolean" + }, + "onTap": { + "description": "点击地图时触发。", + "tsType": "() => void" + }, + "onMarkerTap": { + "description": "点击标记点时触发,e.detail = {markerId}。", + "tsType": "() => void" + }, + "onUpdated": { + "description": "当地图渲染更新完成时触发。", + "tsType": "() => void" + }, + "onRegionChange": { + "description": "当视野发生变化时触发。起始版本:1.0.8", + "tsType": "() => void" + }, + "onCalloutTap": { + "description": "点击标记点对应的气泡时触发,e.detail = {markerId}。起始版本:1.0.10", + "tsType": "() => void" + } + }, + "additionalProperties": false, + "required": ["latitude", "longitude"] + } + } + ] +} diff --git a/src/pages/canIUse/index.js b/src/pages/canIUse/index.js index 62f0ff42479b..2414c5173fe9 100644 --- a/src/pages/canIUse/index.js +++ b/src/pages/canIUse/index.js @@ -1,9 +1,13 @@ import './index.css' import Layout from '@theme/Layout' -import types from 'miniapp-types/dist/jsonSchema.json' +import _types from 'miniapp-types/dist/jsonSchema.json' import React, { Fragment, useState } from 'react' +import ascfJson from './ascf.json' + +const types = _types.concat(ascfJson) + const useList = {} types.forEach((e) => { const list = e.value || []