How to add Vue-donut-chart library to Vuepress?

389 Views Asked by At

I'm trying to add a chart using this Vue library. I added the dependencies into the Config file. The library asks us to use Vue.use(). But I get Vue is undefined. Any ideas?

https://vuejsexamples.com/lightweight-vue-component-for-drawing-pure-css-donut-charts/

1

There are 1 best solutions below

1
On

Please use the App Level Enhancments

https://vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements

Belowe text is copied from Vuepress documentation:

App Level Enhancements
Since the VuePress app is a standard Vue app, you can apply app-level enhancements by creating a file .vuepress/enhanceApp.js, which will be imported into the app if it is present. The file should export default a hook function which will receive an object containing some app level values. You can use this hook to install additional Vue plugins, register global components, or add additional router hooks:

export default ({
  Vue, // the version of Vue being used in the VuePress app
  options, // the options for the root Vue instance
  router, // the router instance for the app
  siteData // site metadata
}) => {
  // ...apply enhancements to the app
}