diff --git a/packages/vision-polyfill/public/schema.json b/packages/vision-polyfill/public/schema.json index 424628106..a8584cf14 100644 --- a/packages/vision-polyfill/public/schema.json +++ b/packages/vision-polyfill/public/schema.json @@ -81,7 +81,7 @@ } }, "children": [{ - "componentName": "Button.Group", + "componentName": "Div", "props": {}, "children": [{ "componentName": "Button", @@ -93,6 +93,23 @@ "htmlType": "submit" }, "children": "提交" + }, { + "componentName": "Button", + "props": { + "type": "normal", + "style": { + "margin": "0 5px 0 5px" + }, + "htmlType": "reset", + "children": { + "type": "JSSlot", + "value": { + "componentName": "Div", + "children": "重置" + } + } + }, + "loop": [1,2,3] }, { "componentName": "Button", "props": { @@ -102,9 +119,23 @@ }, "htmlType": "reset" }, - "children": "重置" + "children": "重置", + "condition": true, + "conditionGroup": "1" + }, { + "componentName": "Button", + "props": { + "type": "normal", + "style": { + "margin": "0 5px 0 5px" + }, + "htmlType": "reset" + }, + "children": "重置", + "condition": false, + "conditionGroup": "1" }] }] }] }] -} \ No newline at end of file +} diff --git a/packages/vision-polyfill/src/editor.ts b/packages/vision-polyfill/src/editor.ts index 1b4e97d15..19ee71068 100644 --- a/packages/vision-polyfill/src/editor.ts +++ b/packages/vision-polyfill/src/editor.ts @@ -7,6 +7,10 @@ import SettingsPane from '@ali/lowcode-plugin-settings-pane'; import DesignerPlugin from '@ali/lowcode-plugin-designer'; import { Skeleton } from './skeleton/skeleton'; +// demo +import Preview from '@ali/lowcode-plugin-sample-preview'; +import { createElement } from 'react'; + registerSetters(); export const editor = new Editor(); @@ -39,6 +43,76 @@ skeleton.leftArea.add({ content: Pane, panelProps: { area: 'leftFixedArea', - title: 'awefawe', + // title: 'awefawe', }, }); + + +// demo + +skeleton.leftArea.add({ + name: 'icon1', + type: 'Dock', + props: { + align: 'bottom', + icon: 'smile', + description: 'smile1', + } +}); +skeleton.leftArea.add({ + name: 'icon2', + type: 'Dock', + props: { + align: 'bottom', + icon: 'smile', + description: 'smile1', + } +}); + +skeleton.topArea.add({ + type: "Dock", + name: 'preview', + props: { + align: "right", + }, + content: Preview, +}); +skeleton.topArea.add({ + type: "Dock", + name: 'preview4', + props: { + align: "right", + }, + content: createElement('img', { + src: "https://img.alicdn.com/tfs/TB1WW.VC.z1gK0jSZLeXXb9kVXa-486-64.png", + style: { + height: 32 + } + }), +}); + +skeleton.topArea.add({ + type: "Dock", + name: 'preview1', + props: { + align: "left", + }, + content: createElement('img', { + src: "https://img.alicdn.com/tfs/TB11koUC8v0gK0jSZKbXXbK2FXa-426-76.png", + style: { + height: 38 + } + }), +}); +skeleton.topArea.add({ + type: "Dock", + name: 'preview2', + props: { + align: "center", + title: { + label: "345", + icon: "smile", + tip: "123123123" + } + }, +})