From d0e9c3af7002d04f022a959a261af047bf89b297 Mon Sep 17 00:00:00 2001 From: xujiahao01 Date: Tue, 22 Feb 2022 19:17:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E6=8B=89=E7=B1=BBde?= =?UTF-8?q?mo&=E7=A7=BB=E5=8A=A8=E6=95=B0=E5=AD=97=E8=BE=93=E5=85=A5demo?= =?UTF-8?q?=E5=88=B0=E8=BE=93=E5=85=A5=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EventAction/InputEvent.jsx | 74 +++++++++++++++++++ .../components/EventAction/SelectEvent.jsx | 65 +++++++++------- examples/components/Example.jsx | 8 +- 3 files changed, 114 insertions(+), 33 deletions(-) diff --git a/examples/components/EventAction/InputEvent.jsx b/examples/components/EventAction/InputEvent.jsx index 0b5ed3194..23a796aa3 100644 --- a/examples/components/EventAction/InputEvent.jsx +++ b/examples/components/EventAction/InputEvent.jsx @@ -181,6 +181,80 @@ export default { { type: 'divider' }, + { + type: 'tpl', + tpl: 'InputNumber数字输入框', + inline: false, + wrapperComponent: 'h2' + }, + { + type: 'form', + debug: true, + body: [ + { + type: 'group', + body: [ + { + name: 'trigger1', + id: 'trigger1', + type: 'action', + label: 'clear触发器', + level: 'primary', + onEvent: { + click: { + actions: [ + { + actionType: 'clear', + componentId: 'clear-input-number-receiver', + description: '点击清空指定输入框的内容' + }, + ] + } + } + }, + { + name: 'clear-input-number-receiver', + id: 'clear-input-number-receiver', + type: 'input-number', + label: 'clear动作测试', + value: 1, + onEvent: { + blur: { + actions: [ + { + actionType: 'toast', + msgType: 'info', + msg: '派发blur事件' + } + ] + }, + focus: { + actions: [ + { + actionType: 'toast', + msgType: 'info', + msg: '派发focus事件' + } + ] + }, + change: { + actions: [ + { + actionType: 'toast', + msgType: 'info', + msg: '派发change事件' + } + ] + } + } + } + ] + } + ] + }, + { + type: 'divider' + }, { type: 'tpl', tpl: 'Editor 编辑器', diff --git a/examples/components/EventAction/SelectEvent.jsx b/examples/components/EventAction/SelectEvent.jsx index f1b543dde..7611e81e7 100644 --- a/examples/components/EventAction/SelectEvent.jsx +++ b/examples/components/EventAction/SelectEvent.jsx @@ -1,22 +1,9 @@ const change = { actions: [ { - actionType: 'dialog', - args: { - val: '${event.data.value}' - }, - dialog: { - title: '派发change事件', - data: { - val: '${val}' - }, - body: [ - { - type: 'tpl', - tpl: '值更新:${val}' - } - ] - } + actionType: 'toast', + msgType: 'info', + msg: '派发change事件' } ] }; @@ -343,7 +330,7 @@ export default { }, { type: 'tpl', - tpl: 'checkbox单选框', + tpl: '单选框/复选框', inline: false, wrapperComponent: 'h2' }, @@ -384,6 +371,41 @@ export default { }, }, ] + }, + { + type: 'group', + body: [ + { + name: 'trigger9', + id: 'trigger9', + type: 'action', + mode: 'row', + label: 'clear触发器', + level: 'primary', + onEvent: { + click: { + actions: [ + { + actionType: 'clear', + componentId: 'clear-checkboxes', + description: '点击清空指定浮选框选中值' + } + ] + } + } + }, + { + name: 'clear-checkboxes', + id: 'clear-checkboxes', + type: 'checkboxes', + mode: 'row', + label: 'clear动作测试', + options, + onEvent: { + change + } + }, + ] } ] }, @@ -418,15 +440,6 @@ export default { } } }, - { - name: 'clear-options', - id: 'clear-options', - type: 'checkboxes', - options, - onEvent: { - change - } - }, { name: 'clear-options', id: 'clear-options', diff --git a/examples/components/Example.jsx b/examples/components/Example.jsx index 00f129c65..030ec4c79 100644 --- a/examples/components/Example.jsx +++ b/examples/components/Example.jsx @@ -74,7 +74,6 @@ import LogicEventActionSchema from './EventAction/Logic'; import StopEventActionSchema from './EventAction/Stop'; import DataFlowEventActionSchema from './EventAction/DataFlow'; import InputEventSchema from './EventAction/InputEvent'; -import InputNumberEventSchema from './EventAction/InputNumberEvent'; import DateEventSchema from './EventAction/DateEvent'; import SwitchEventSchema from './EventAction/SwitchEvent'; import TabsEventSchema from './EventAction/TabsEvent'; @@ -545,11 +544,6 @@ export const examples = [ path: '/examples/event/input', component: makeSchemaRenderer(InputEventSchema) }, - { - label: '数字输入组件', - path: '/examples/event/input-number', - component: makeSchemaRenderer(InputNumberEventSchema) - }, { label: '上传类组件', path: '/examples/event/upload', @@ -571,7 +565,7 @@ export const examples = [ component: makeSchemaRenderer(SwitchEventSchema) }, { - label: '标签页组件', + label: '选项卡组件', path: 'examples/event/tabs', component: makeSchemaRenderer(TabsEventSchema) }