Przeglądaj źródła

No default with export multi objects (#337)

* https://github.com/babel/babel/issues/2212
Fix wrong way of export multi objects.

* Dva model cannot using import for app.model
WhatAKitty 8 lat temu
rodzic
commit
c4f69fc407
2 zmienionych plików z 2 dodań i 3 usunięć
  1. 1 1
      src/components/Charts/index.js
  2. 1 2
      src/index.js

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

@@ -14,7 +14,7 @@ import TimelineChart from './TimelineChart';
 
 const yuan = val => `¥ ${numeral(val).format('0,0')}`;
 
-export default {
+export {
   yuan,
   Bar,
   Pie,

+ 1 - 2
src/index.js

@@ -5,7 +5,6 @@ import './g2';
 import './rollbar';
 // import browserHistory from 'history/createBrowserHistory';
 import './index.less';
-import router from './router';
 
 // 1. Initialize
 const app = dva({
@@ -19,7 +18,7 @@ const app = dva({
 app.model(require('./models/global'));
 
 // 4. Router
-app.router(router);
+app.router(import('./router'));
 
 // 5. Start
 app.start('#root');