diff --git a/README.md b/README.md index 475edf4cb7312de007874293cd98418895fd7f91..5dd133e2f0110b1c9ee5c3e20301a229c5c87870 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,27 @@ # pro-blocks +[中文 README](./README.zh-CN.md) + umi blocks of Ant Design Pro. -> A part of [Ant Design Pro V4](https://github.com/ant-design/ant-design-pro/issues/3143), still in progress. +A part of [Ant Design Pro V4](https://github.com/ant-design/ant-design-pro/issues/3143), still in progress. + +## dev ## Usage ```shell -$ umi block add [the github url of block] +umi block add [the github url of block] ``` You can visit umi [doc](https://umijs.org/guide/block.html) for find out more info about umi block. ## Contribute -```shell -$ cd [some block] -$ yarn # or npm install -$ yarn run dev # or npm run dev -``` - -Or +Enter the block you want to dev ```shell -$ yarn # or npm install -$ APP_ROOT=[some block] yarn run dev # or APP_ROOT=[someblock] npm run dev +cross-env PAGES_PATH='block_name' umi ``` + +> In complex typescript definitions, vscode may crash or tslint reports an error. You can restart the typescript service by "ctrl+shift+p > reload window" diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 0000000000000000000000000000000000000000..f02f60bce380e86738d36df4c71099d16365e294 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,26 @@ +#pro-blocks + +[English README](./README.md) + +Umi 块的 Ant Design Pro。 + +> [Ant Design Pro V4](https://github.com/ant-design/ant-design-pro/issues/3143)的官方区块 + +## 用法 + +```shell +umi block add [block github url] +``` + +你可以访问 umi [doc](https://umijs.org/guide/block.html)了解更多关于 umi block 的信息。 + +## 贡献 + +输入要开发的 block 名称 + +```shell +npm install +Cross-env PAGES_PATH ='block_name' umi dev +``` + +> 在复杂的 TypeScript 定义中,vscode 可能会崩溃或 tslint 报告错误。您可以通过 “ctrl + shift + p> reload window” 重新启动 TypeScript 服务 diff --git a/StepForm/src/components/Step1/index.tsx b/StepForm/src/components/Step1/index.tsx index 066a51bbbd99c2a4565fe2e4bac75480dbac2242..f96d8458f849d361852e306984a78248f0de0569 100644 --- a/StepForm/src/components/Step1/index.tsx +++ b/StepForm/src/components/Step1/index.tsx @@ -122,4 +122,4 @@ class Step1 extends React.PureComponent { export default connect(({ BLOCK_NAME_CAMEL_CASE }: { BLOCK_NAME_CAMEL_CASE: IStateType }) => ({ data: BLOCK_NAME_CAMEL_CASE.step, -}))(Form.create()(Step1)); +}))(Form.create()(Step1)); diff --git a/StepForm/src/components/Step2/index.tsx b/StepForm/src/components/Step2/index.tsx index 78ab2a4bd839931bebdcaaef6db130b8653e79e2..9ffb9cfb26881545db2b89ce012ce10b68a041cb 100644 --- a/StepForm/src/components/Step2/index.tsx +++ b/StepForm/src/components/Step2/index.tsx @@ -118,4 +118,4 @@ export default connect( submitting: loading.effects['BLOCK_NAME_CAMEL_CASE/submitStepForm'], data: BLOCK_NAME_CAMEL_CASE.step, }), -)(Form.create()(Step2)); +)(Form.create()(Step2)); diff --git a/package.json b/package.json index 29bd845dca779b376b7469d89de294ed7d5590cf..e75158396873a8fdb0d93665fb63f3cb9f64d0c9 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "lint-staged": "lint-staged", "lint-staged:ts": "tslint", "lint:fix": "npm run tslint:fix && npm run lint:style", - "lint:prettier": "check-prettier lint", + "lint:prettier": "check-prettier write", "lint:style": "stylelint --syntax less --fix **/**.less ", "lint:ts": "tslint -p . -c tslint.yml", "prettier": "node ./_scripts/prettier.js", @@ -32,7 +32,7 @@ "devDependencies": { "@types/classnames": "^2.2.7", "babel-eslint": "^10.0.1", - "check-prettier": "^1.0.1", + "check-prettier": "^1.0.3", "glob": "^7.1.3", "husky": "^2.2.0", "lint-staged": "^8.1.0",