I've installed this with npm :
Doing npm install hchs-vue-charts
Which is a package to make charts in my views.
I just want to know how to import this lib from node_modules
in a single ponent in Vuejs with the Vue-cli app () because in their examples they do it with an instance of Vue.
Thank you
I've installed this with npm : https://github./hchstera/vue-charts
Doing npm install hchs-vue-charts
Which is a package to make charts in my views.
I just want to know how to import this lib from node_modules
in a single ponent in Vuejs with the Vue-cli app (https://github./vuejs/vue-cli) because in their examples they do it with an instance of Vue.
Thank you
Share Improve this question asked Nov 23, 2017 at 9:44 MounirOnGithubMounirOnGithub 6993 gold badges10 silver badges23 bronze badges2 Answers
Reset to default 5you must install module in main.js
import Vue from 'vue'
import VueCharts from 'hchs-vue-charts'
Vue.use(VueCharts)
then use ponent everywhere in you app, like this:
<template>
<div id="app">
<chartjs-line></chartjs-line>
</div>
</template>
other ponents in lib:
<chartjs-bar/>
<chartjs-horizontal-bar/>
<chartjs-radar/>
<chartjs-polar-area/>
<chartjs-pie/>
<chartjs-doughnut/>
In main.js
import vue-charts and init the plugin like this:
import VueCharts from 'hchs-vue-charts'
Vue.use(VueCharts)
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743698335a4492136.html
评论列表(0条)