Skip to content

Instantly share code, notes, and snippets.

@sachith95
Last active March 25, 2021 19:36
Show Gist options
  • Save sachith95/406a9f877f475c7f9963a60e3fdf9297 to your computer and use it in GitHub Desktop.
Save sachith95/406a9f877f475c7f9963a60e3fdf9297 to your computer and use it in GitHub Desktop.
Echart plugin integration to Vue
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)
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