Browse Source

feat: umi upgrade

master
smallstonesk 4 years ago
parent
commit
d2dbd5bdc2
  1. 1
      example/.env
  2. 11
      example/package.json
  3. 29
      example/src/pages/index.tsx

1
example/.env

@ -0,0 +1 @@
WATCH_IGNORED=node_modules/(?!(@imove/core)) umi dev

11
example/package.json

@ -20,7 +20,8 @@
] ]
}, },
"dependencies": { "dependencies": {
"@antv/x6": "^0.4.7", "@ant-design/icons": "^4.2.2",
"@antv/x6": "^0.4.8",
"@antv/x6-react-shape": "^0.2.2", "@antv/x6-react-shape": "^0.2.2",
"@emotion/core": "^10.0.28", "@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27", "@emotion/styled": "^10.0.27",
@ -28,11 +29,13 @@
"@imove/json-schema-editor": "^0.3.2", "@imove/json-schema-editor": "^0.3.2",
"@umijs/preset-react": "1.x", "@umijs/preset-react": "1.x",
"@umijs/test": "^3.2.2", "@umijs/test": "^3.2.2",
"antd": "^4.2.4", "antd": "^4.4.3",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-runtime": "^6.26.0",
"lint-staged": "^10.0.7", "lint-staged": "^10.0.7",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"react": "^16.12.0", "react": "^16.13.1",
"react-dom": "^16.12.0", "react-dom": "^16.13.1",
"umi": "^3.2.2", "umi": "^3.2.2",
"yorkie": "^2.0.0" "yorkie": "^2.0.0"
} }

29
example/src/pages/index.tsx

@ -1,33 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import IMove from '@imove/core'; import IMove from '@imove/core';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { DataItem } from '@imove/core/dist/types/data/cells';
const cells: DataItem[] = [
{
label: '查询是否登录',
type: 'decision',
style: {
width: 48,
height: 30,
scale: 2,
},
data: {
code:
'import Base from "@ali/rax-base";\n\nconst queryLogin = (params) => {\n return new Promise((resolve, reject) => {\n Base.getUser((data) => {\n if (data && data.userNumberId) {\n resolve(true);\n } else {\n reject(false);\n }\n });\n });\n};\n\nexport default queryLogin;\n',
dependencies: [
{
'@ali/rax-base': '^2.1.9',
},
],
},
schema: {
type: 'object',
required: [],
properties: {},
},
},
];
const onSave = (data: { nodes: any; edges: any }): void => { const onSave = (data: { nodes: any; edges: any }): void => {
console.log(data); console.log(data);
@ -40,7 +13,7 @@ const Wrapper = styled.div`
function Arrange(): JSX.Element { function Arrange(): JSX.Element {
return ( return (
<Wrapper> <Wrapper>
<IMove cells={cells} onSave={onSave} /> <IMove onSave={onSave}/>
</Wrapper> </Wrapper>
); );
} }

Loading…
Cancel
Save