Sfoglia il codice sorgente

split dva from components

nikogu 8 anni fa
parent
commit
9867f6e6e5

+ 12 - 2
.roadhogrc

@@ -7,7 +7,12 @@
         "transform-runtime",
         "transform-decorators-legacy",
         "transform-class-properties",
-        ["import", { "libraryName": "antd", "style": true }]
+        ["import", { "libraryName": "antd", "style": true }],
+        ["module-resolver", {
+          "alias": {
+            "react-router": "dva/router"
+          }
+        }]
       ]
     },
     "production": {
@@ -15,7 +20,12 @@
         "transform-runtime",
         "transform-decorators-legacy",
         "transform-class-properties",
-        ["import", { "libraryName": "antd", "style": true }]
+        ["import", { "libraryName": "antd", "style": true }],
+        ["module-resolver", {
+          "alias": {
+            "react-router": "dva/router"
+          }
+        }]
       ]
     }
   },

+ 1 - 0
package.json

@@ -34,6 +34,7 @@
     "babel-jest": "^21.0.0",
     "babel-plugin-dva-hmr": "^0.3.2",
     "babel-plugin-import": "^1.2.1",
+    "babel-plugin-module-resolver": "^2.7.1",
     "babel-plugin-transform-class-properties": "^6.24.1",
     "babel-plugin-transform-decorators-legacy": "^1.3.4",
     "babel-plugin-transform-runtime": "^6.9.0",

+ 1 - 1
src/components/EditableLinkGroup/index.js

@@ -1,6 +1,6 @@
 import React, { PureComponent } from 'react';
 import PropTypes from 'prop-types';
-import { Link } from 'dva/router';
+import { Link } from 'react-router';
 import { Button, Icon } from 'antd';
 import styles from './index.less';
 

+ 1 - 1
src/components/Exception/index.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import classNames from 'classnames';
 import { Button } from 'antd';
-import { Link } from 'dva/router';
+import { Link } from 'react-router';
 import config from './typeConfig';
 import styles from './index.less';
 

+ 1 - 1
src/components/PageHeader/index.js

@@ -1,7 +1,7 @@
 import React, { PureComponent } from 'react';
 import PropTypes from 'prop-types';
 import { Breadcrumb, Tabs } from 'antd';
-import { Link } from 'dva/router';
+import { Link } from 'react-router';
 import classNames from 'classnames';
 import styles from './index.less';