Skip to content

Commit 1dbcd90

Browse files
committed
package name and demo fix for msg
1 parent 1c35841 commit 1dbcd90

File tree

8 files changed

+31
-47
lines changed

8 files changed

+31
-47
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ We have several examples on the documentation. Here is the first one to get you
3838
```javascript
3939
// app.js
4040

41-
import React, { Component } from 'react';
41+
import React from 'react';
4242
import ReactDOM from 'react-dom';
4343
import { Button } from 'react-weui';
4444
//import styles

docs/docs.json

+9-1
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,14 @@
541541
"preview" : "Infinite",
542542
"code" : "infiniteloader/index",
543543
"component" : "infiniteloader/infiniteloader"
544+
},
545+
{
546+
"name": "Page",
547+
"version": "1.1.0",
548+
"icon": "http://weui.github.io/weui/images/icon_nav_panel.png",
549+
"preview" : "Page",
550+
"code" : "page/index",
551+
"component" : "page/page"
544552
}
545553
]
546554
},
@@ -566,4 +574,4 @@
566574
}
567575
]
568576
}
569-
]
577+
]

docs/guide/getstarted.en-US.md

+4-20
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,14 @@ npm install [email protected] react-weui --save
1919

2020
We have several examples on the documentation. Here is the first one to get you started:
2121
```javascript
22-
// app.js
23-
24-
import React, { Component } from 'react';
22+
import React from 'react';
2523
import ReactDOM from 'react-dom';
26-
27-
//import using commonJS Module *Require Plugins
28-
//import { Button } from 'react-weui'
29-
30-
//import Using ES6 syntax
31-
import WeUI from 'react-weui';
32-
24+
import { Button } from 'react-weui';
3325
//import styles
3426
import 'weui';
35-
import 'react-weui/lib/react-weui.min.css';
36-
37-
const {Button} = WeUI;
27+
import 'react-weui/build/packages/react-weui.css';
3828

39-
class App extends Component {
40-
render() {
41-
return (
42-
<Button>hello wechat</Button>
43-
);
44-
}
45-
}
29+
const App = () => <Button>hello wechat</Button>;
4630

4731
ReactDOM.render((
4832
<App/>

docs/guide/getstarted.zh-CN.md

+5-21
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,14 @@ npm install [email protected] react-weui --save
1919

2020
我们的组件文档里头有很多例子, 这里提供给一个快速上手的例子:
2121
```javascript
22-
// app.js
23-
24-
import React, { Component } from 'react';
22+
import React from 'react';
2523
import ReactDOM from 'react-dom';
26-
27-
//使用 commonJS 模块方式 *可能需要webpack插件
28-
//import { Button } from 'react-weui'
29-
30-
//使用 ES6 方式引入
31-
import WeUI from 'react-weui';
32-
33-
//引入样式库
24+
import { Button } from 'react-weui';
25+
//import styles
3426
import 'weui';
35-
import 'react-weui/lib/react-weui.min.css';
36-
37-
const {Button} = WeUI;
27+
import 'react-weui/build/packages/react-weui.css';
3828

39-
class App extends Component {
40-
render() {
41-
return (
42-
<Button>hello wechat</Button>
43-
);
44-
}
45-
}
29+
const App = () => <Button>hello wechat</Button>;
4630

4731
ReactDOM.render((
4832
<App/>

example/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const routes = [
3333
{ path: '/toast', component: Toast },
3434
{ path: '/dialog', component: Dialog },
3535
{ path: '/progress', component: Progress },
36-
{ path: '/msg', component: MsgDemo },
36+
{ path: '/msg', component: MsgDemo, exact: true },
3737
{ path: '/msg/success', component: MsgSuccess },
3838
{ path: '/msg/fail', component: MsgFail },
3939
{ path: '/article', component: Article },

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.1.1",
44
"description": "weui for react",
55
"main": "./build/packages/index.js",
6-
"browser": "./build/dist/bundle.min.js",
6+
"browser": "./build/dist/react-weui.min.js",
77
"scripts": {
88
"start": "webpack-dev-server",
99
"start:doc": "webpack-dev-server --config webpack.config.doc.js --progress --colors --port 8080",
@@ -13,7 +13,7 @@
1313
"test": "mocha --compilers js:babel-core/register --recursive -r ignore-styles -r jsdom-global/register",
1414
"test:watch": "npm run test -- --watch",
1515
"coverage": "npm run lint & nyc --require babel-core/register mocha -r ignore-styles -r jsdom-global/register && nyc report --reporter=lcov",
16-
"publish": "gh-pages -d ./build/demo"
16+
"postpublish": "gh-pages -d ./build/demo"
1717
},
1818
"repository": {
1919
"type": "git",

scripts/build.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ function createWebpackBuild(config){
160160
if (err || stats.hasErrors()) {
161161
rej('webpack build error');
162162
}
163+
log(stats.toString({
164+
chunks: false, // Makes the build much quieter
165+
colors: true // Shows colors in the console
166+
}));
163167
res();
164168
});
165169
};
@@ -173,7 +177,7 @@ function createBundle(bundleType){
173177
CLI.section('Writing Bundle to file');
174178
return bundle.write({
175179
moduleName: 'WeUI',
176-
dest: atrs.path + (atrs.env === 'production' ? 'bundle.min.js' : 'bundle.js'),
180+
dest: atrs.path + (atrs.env === 'production' ? 'react-weui.min.js' : 'react-weui.js'),
177181
format: atrs.format,
178182
sourceMap: atrs.sourceMap
179183
});

webpack.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ const rules = [
5757
browsers: [
5858
'last 3 version',
5959
'ie >= 10',
60+
'iOS >= 7',
61+
'Android >= 4.1'
6062
],
6163
})
6264
]
@@ -82,6 +84,8 @@ const rules = [
8284
browsers: [
8385
'last 3 version',
8486
'ie >= 10',
87+
'iOS >= 7',
88+
'Android >= 4.1'
8589
],
8690
})
8791
]

0 commit comments

Comments
 (0)