From a957bffb4f55fae9d1856ec4743734cd58085711 Mon Sep 17 00:00:00 2001 From: afc163 Date: Wed, 25 Oct 2017 12:04:38 +0800 Subject: [PATCH] Add favicon and update g2 default theme --- public/index.html | 2 +- src/g2.js | 18 ++++++++++++++++++ src/index.js | 4 +--- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/g2.js diff --git a/public/index.html b/public/index.html index 2978fdf6..358e7d95 100755 --- a/public/index.html +++ b/public/index.html @@ -4,7 +4,7 @@ Ant Design Pro - + diff --git a/src/g2.js b/src/g2.js new file mode 100644 index 00000000..faadc6c3 --- /dev/null +++ b/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); diff --git a/src/index.js b/src/index.js index ae0c9dbf..88dbc389 100644 --- a/src/index.js +++ b/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, -- GitLab