use registerSetter from lowcode-editor-core

This commit is contained in:
金禅 2020-05-18 21:20:55 +08:00
parent 56ae5ad5f5
commit 7a77c55167
6 changed files with 24 additions and 10 deletions

View File

@ -40,7 +40,13 @@
}
},
{
"componentName": "Div",
"componentName": "Card",
"npm": {
"package": "@alifd/next",
"version": "1.19.18",
"destructuring": true,
"exportName": "Card"
},
"title": "容器",
"configure": {
"component": {
@ -197,6 +203,10 @@
"exportName": "Input"
},
"props": [{
"name": "value",
"propType": "string",
"description": ""
},{
"name": "label",
"propType": "node",
"description": "label"
@ -1503,7 +1513,7 @@
"children": [{
"componentName": "Button",
"title": "按钮",
"icon": "",
"icon": "add",
"package": "@alife/next",
"library": "Next",
"snippets": [{
@ -1532,7 +1542,8 @@
"schema": {
"componentName": "Button",
"props": {
"type": "normal"
"type": "normal",
"value": "normal"
},
"children": "normal"
}
@ -1588,7 +1599,7 @@
"title": "其他",
"icon": "",
"children": [{
"componentName": "Div",
"componentName": "Card",
"library": "Next",
"title": "容器",
"icon": "",
@ -1596,7 +1607,7 @@
"title": "默认",
"screenshot": "",
"schema": {
"componentName": "Div",
"componentName": "Card",
"props": {}
}
}]

View File

@ -1,5 +1,5 @@
import { render } from 'react-dom';
import GeneralWorkbench from '@ali/lowcode-editor-preset-general';
import GeneralWorkbench, { editor } from '../../../editor-preset-general/src';
import config from './config';
import components from './components';
import './global.scss';

View File

@ -48,7 +48,7 @@ export class Transducer {
if (typeof setter === 'string') {
setter = getSetter(setter)?.component;
if (!setter) {
debugger;
// debugger;
}
}

View File

@ -57,7 +57,10 @@ export default function GeneralWorkbench(props: any) {
...props,
});
}
window.__ctx = {
editor,
appHelper: editor,
};
export function init(container?: Element) {
if (!container) {
container = document.createElement('div');

View File

@ -1,4 +1,4 @@
import { registerSetter } from '@ali/lowcode-globals';
import { registerSetter } from '@ali/lowcode-editor-core';
import { DatePicker, Input, Radio, Select, Switch, NumberPicker } from '@alifd/next';
import ExpressionSetter from './expression-setter';
import ColorSetter from './color-setter';

View File

@ -58,7 +58,7 @@ export default class SourceEditor extends Component<{
componentWillMount() {
const { editor } = this.props;
editor.on('leftPanel.show', (key: String) => {
debugger;
// debugger;
if (key === 'sourceEditor' && !this.monocoEditor) {
this.setState({
isShow: true,