소스 검색

Add favicon and update g2 default theme

afc163 8 년 전
부모
커밋
a957bffb4f
3개의 변경된 파일20개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      public/index.html
  2. 18 0
      src/g2.js
  3. 1 3
      src/index.js

+ 1 - 1
public/index.html

@@ -4,7 +4,7 @@
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <title>Ant Design Pro</title>
-
+  <link rel="icon" href="https://gw.alipayobjects.com/zos/rmsportal/IOtlElCiWVIOZqgDslYd.png" type="image/x-icon">
   <link rel="stylesheet" href="index.css" />
 </head>
 <body>

+ 18 - 0
src/g2.js

@@ -0,0 +1,18 @@
+// 全局 G2 设置
+import G2 from 'g2';
+
+G2.track(false);
+
+const config = {
+  ...G2.Theme,
+  defaultColor: '#1089ff',
+  tooltip: {
+    background: {
+      radius: 4,
+      fill: '#000',
+      fillOpacity: 0.75,
+    },
+  },
+};
+
+G2.Global.setTheme(config);

+ 1 - 3
src/index.js

@@ -1,12 +1,10 @@
 import dva from 'dva';
-import G2 from 'g2';
 import 'moment/locale/zh-cn';
 import models from './models';
+import './g2';
 // import { browserHistory } from 'dva/router';
 import './index.less';
 
-G2.track(false);
-
 // 1. Initialize
 const app = dva({
   // history: browserHistory,