From 6ae5dbae7b373d25e75c9febe83307e57414fcc3 Mon Sep 17 00:00:00 2001 From: sailei <826196460@qq.com> Date: Fri, 15 Dec 2023 15:42:20 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/components/progress.md | 71 +++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/docs/zh-CN/components/progress.md b/docs/zh-CN/components/progress.md index c3563534c..ebe753908 100755 --- a/docs/zh-CN/components/progress.md +++ b/docs/zh-CN/components/progress.md @@ -321,7 +321,70 @@ List 的内容、Card 卡片的内容配置同上 当前组件对外暴露以下特性动作,其他组件可以通过指定`actionType: 动作名称`、`componentId: 该组件id`来触发这些动作,动作配置可以通过`args: {动作配置项名称: xxx}`来配置具体的参数,详细请查看[事件动作](../../docs/concepts/event-action#触发其他组件的动作)。 -| 动作名称 | 动作配置 | 说明 | -| -------- | ------------------------------------ | ------------------------------------------------------ | -| reset | - | 将值重置为`resetValue`,若没有配置`resetValue`,则清空 | -| setValue | `value: string` \| `number` 更新的值 | 更新数据 | +| 动作名称 | 动作配置 | 说明 | +| -------- | ------------------------------------ | ------------ | +| reset | - | 将值重置为 0 | +| setValue | `value: string` \| `number` 更新的值 | 更新数据 | + +### reset + +```schema: scope="body" +{ + "type": "page", + "body": [ + { + "type": "progress", + "name": "progress", + "id": "progress", + "value": 67 + }, + { + "type": "button", + "label": "重置值", + "onEvent": { + "click": { + "actions": [ + { + "actionType": "reset", + "componentId": "progress" + } + ] + } + } + } + ] +} +``` + +### setValue + +```schema: scope="body" +{ + "type": "page", + "body": [ + { + "type": "progress", + "name": "progress", + "id": "progress", + "value": 67 + }, + { + "type": "button", + "label": "设置值", + "onEvent": { + "click": { + "actions": [ + { + "actionType": "setValue", + "componentId": "progress", + "args": { + "value": 20 + } + } + ] + } + } + } + ] +} +```