Skip to content

Commit ad88ece

Browse files
committed
肚皮 antd按需引入
1 parent d187e5e commit ad88ece

File tree

6 files changed

+314
-992
lines changed

6 files changed

+314
-992
lines changed

.babelrc

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
{
2-
"presets": ["es2015", "stage-0", "react"],
3-
"plugins": ["espower", "transform-runtime", "transform-decorators-legacy", ["antd", [{ "libraryName": "antd" }]], ["webpack-alias", {"config": "${process.cwd()}/webpack-test.config.js"}]],
4-
"env": {
5-
6-
}
2+
"presets": ["es2015", "stage-0", "react"],
3+
"plugins": [
4+
"espower",
5+
"transform-runtime",
6+
"transform-decorators-legacy",
7+
["import", [
8+
{
9+
"libraryName": "antd",
10+
"style": true
11+
}
12+
]
13+
],
14+
["webpack-alias", {"config": "${process.cwd()}/webpack-test.config.js"}]],
15+
"env": {
16+
17+
}
718
}

app/containers/App/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import LeftNav from './leftNav'
1010
import RightAside from './rightAside'
1111
import TabList from './tabList'
1212
import Extra from './extra'
13-
import 'antd/dist/antd.less'
13+
1414
import '../../style/base.less'
1515

1616
@connect(

app/utils/ajax.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function buildParams(obj) {
1818
}
1919

2020
// 下面是注释用formdata的方式传输数据
21-
/*export function fetchJSON(url, params) {
21+
/* export function fetchJSON(url, params) {
2222
params = {
2323
...params,
2424
headers: {
@@ -31,13 +31,13 @@ function buildParams(obj) {
3131
}*/
3232

3333
export function fetchJSON(url, params, target) {
34-
let data = {
34+
const data = {
3535
'method': 'POST',
3636
'Content-Type': 'application/json',
37-
'body': JSON.stringify(params)
37+
'body': JSON.stringify(params),
3838
}
3939

40-
if(target){
40+
if (target) {
4141
url = `${target}${url}${API_SUFFIX}`
4242
} else {
4343
url = `${API_PREFIX}${url}${API_SUFFIX}`
@@ -49,7 +49,7 @@ export function fetchJSON(url, params, target) {
4949
// eslint-disable-next-line arrow-parens
5050
export const fetchJSONByPost = (url, target) => query => {
5151
// 下面是注释用formdata的方式传输数据
52-
/*const params = {
52+
/* const params = {
5353
method: 'POST',
5454
body: buildParams(query),
5555
}
@@ -58,7 +58,6 @@ export const fetchJSONByPost = (url, target) => query => {
5858
}
5959

6060

61-
6261
export const fetchJSONStringByPost = url => query => {
6362
const params = {
6463
method: 'POST',

0 commit comments

Comments
 (0)