Skip to content

Commit f375b73

Browse files
author
shiqiangliang
committed
优化import
1 parent 8bd34cf commit f375b73

21 files changed

+40
-45
lines changed

README.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,31 @@ KityMinder Case React(Antd)
77
找了很久,都没有找到基于react的百度脑图,无奈之下只能自力更生,自己写了一个。react初学者,写得不咋的,勉强能用,也阉割掉了部分功能(其实是懒得写了)。
88

99
## 预览
10-
[![](https://github.com/liangalien/kityminder-case-react/blob/master/src/images/s1.png)](https://github.com/liangalien/kityminder-case-react/blob/master/src/images/s1.png)
10+
[![](https://github.com/liangalien/kityminder-case-react/blob/3fa74142c64c9cd1cf47e82ce855686f4f75a856/src/images/s1.png)](https://github.com/liangalien/kityminder-case-react/blob/3fa74142c64c9cd1cf47e82ce855686f4f75a856/src/images/s1.png)
1111

12-
[![](https://github.com/liangalien/kityminder-case-react/blob/master/src/images/s2.png)](https://github.com/liangalien/kityminder-case-react/blob/master/src/images/s2.png)
12+
[![](https://github.com/liangalien/kityminder-case-react/blob/3fa74142c64c9cd1cf47e82ce855686f4f75a856/src/images/s2.png)](https://github.com/liangalien/kityminder-case-react/blob/3fa74142c64c9cd1cf47e82ce855686f4f75a856/src/images/s2.png)
1313

14-
[![](https://github.com/liangalien/kityminder-case-react/blob/master/src/images/s3.png)](https://github.com/liangalien/kityminder-case-react/blob/master/src/images/s3.png)
14+
[![](https://github.com/liangalien/kityminder-case-react/blob/3fa74142c64c9cd1cf47e82ce855686f4f75a856/src/images/s3.png)](https://github.com/liangalien/kityminder-case-react/blob/3fa74142c64c9cd1cf47e82ce855686f4f75a856/src/images/s3.png)
1515

16-
## 开发说明
17-
18-
```bash
19-
npm i
20-
npm run dev
21-
npm run build
22-
```
2316

2417
## 使用说明
2518
```bash
2619
npm i kityminder-case-react
2720
```
21+
2822
```javascript
29-
import MinderCase from 'kityminder-case-react/src/components/main';
23+
import MinderCase from 'kityminder-case-react';
3024

3125
export default function () {
3226
return (
33-
<MinderCase></MinderCase>
27+
<MinderCase/>
3428
);
3529
}
3630
```
3731

38-
```javascript
39-
//报错@antd找不到,需要在webpack.conf添加
40-
module.exports = {
41-
resolve: {
42-
alias: {
43-
'@antd': 'antd'
44-
}
45-
}
46-
}
32+
## 开发说明
33+
```bash
34+
npm i
35+
npm run dev
36+
npm run build
4737
```

dist/kityminder.case.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "kityminder-case-react",
3-
"version": "3.1.0",
4-
"description": "",
5-
"main": "src/index.js",
3+
"version": "3.1.1",
4+
"description": "基于react的百度脑图",
5+
"main": "src/components/main.js",
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"dev": "webpack serve --config webpack.config.js --mode development",
99
"build": "webpack build --config webpack.prod.config.js --mode production"
1010
},
11-
"license": "ISC",
11+
"license": "GNU",
1212
"dependencies": {
1313
"@babel/core": "^7.7.4",
1414
"@babel/preset-env": "^7.5.4",

src/App.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import React, { Component } from 'react';
22
import MinderCase from './components/main';
33
import './index.less';
44

5+
56
class App extends Component {
67
render() {
78
return (
8-
<MinderCase></MinderCase>
9+
<MinderCase/>
910
)
1011
}
1112
}

src/components/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {Component} from 'react';
2-
import {Tabs, Layout, Spin } from '@antd';
2+
import {Tabs, Layout, Spin } from 'antd';
33
import UndoRedo from './tabs/undoRedo';
44
import AppendNode from './tabs/appendNode';
55
import Arrange from './tabs/arrange';
@@ -15,6 +15,7 @@ import Fonts from './tabs/font';
1515
import Expand from './tabs/expand';
1616
import SearchNode from './tabs/search';
1717
import Navigator from './tabs/navigator';
18+
import Extras from './tabs/extras';
1819

1920
import 'hotbox-ui';
2021
import 'kity';
@@ -112,6 +113,9 @@ class Main extends Component {
112113
<Disabled minder={this.state.minder}/>
113114
<Priority minder={this.state.minder}/>
114115
<Type minder={this.state.minder}/>
116+
{
117+
this.props.extras && this.props.extras.edit && <Extras minder={this.state.minder} extras={this.props.extras.edit}/>
118+
}
115119
</Layout>
116120
</TabPane>
117121

src/components/tabs/appendNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Row, Button} from '@antd';
2+
import { Row, Button} from 'antd';
33
import { EnterOutlined, RollbackOutlined, RetweetOutlined } from '@ant-design/icons';
44

55
class AppendNode extends Component {

src/components/tabs/arrange.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Row, Button} from '@antd';
2+
import { Row, Button} from 'antd';
33
import { UpOutlined, DownOutlined } from '@ant-design/icons';
44

55
class Arrange extends Component {

src/components/tabs/disabled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Row, Button} from '@antd';
2+
import { Row, Button} from 'antd';
33
import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons';
44

55
class Disabled extends Component {

src/components/tabs/expand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Row, Button, Menu, Dropdown } from '@antd';
2+
import { Row, Button, Menu, Dropdown } from 'antd';
33
import { NodeExpandOutlined, BorderInnerOutlined, DownOutlined } from '@ant-design/icons';
44

55
class Expand extends Component {

src/components/tabs/font.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component } from 'react';
2-
import { Row, Col, Button, Menu, Dropdown, Space, Select, Popover } from '@antd';
2+
import { Row, Col, Button, Menu, Dropdown, Space, Select, Popover } from 'antd';
33

44
import { BoldOutlined, ItalicOutlined, UnderlineOutlined, FontColorsOutlined, BgColorsOutlined } from '@ant-design/icons';
55

@@ -94,7 +94,7 @@ class Font extends Component {
9494
<Col span={12}>
9595
<Select
9696
disabled={this.props.minder && this.props.minder.queryCommandState('text') == -1}
97-
style={{width: 70}}
97+
style={{width: 80}}
9898
bordered={false}
9999
placeholder="字号"
100100
options={this.sizeList}

0 commit comments

Comments
 (0)