Last active
March 25, 2021 19:36
-
-
Save sachith95/406a9f877f475c7f9963a60e3fdf9297 to your computer and use it in GitHub Desktop.
Echart plugin integration to Vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Echarts from 'vue-echarts' | |
import 'echarts/lib/chart/bar' | |
import 'echarts/lib/chart/line' | |
import 'echarts/lib/chart/pie' | |
import 'echarts/lib/chart/map' | |
import 'echarts/lib/component/polar' | |
import 'echarts/lib/component/title' | |
import 'echarts/lib/component/tooltip' | |
import 'echarts/lib/component/legend' | |
import 'echarts/theme/dark' | |
// import the component that wish to use in app here | |
Vue.component('chart', Echarts) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from "vue"; | |
import "@/plugins/echarts"; // improt echart.js from inside the same directory plugin folder | |
import App from "./App.vue"; | |
import store from "./store"; | |
Vue.config.productionTip = false; | |
let app; | |
auth.onAuthStateChanged(() => { | |
if (!app) { | |
app = new Vue({ | |
store, | |
render: (h) => h(App), | |
}).$mount("#app"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment