【发布时间】:2019-04-18 23:05:27
【问题描述】:
我正在尝试使用这个 Vue 库添加图表。我将依赖项添加到配置文件中。图书馆要求我们使用Vue.use()。但我得到Vue is undefined。有什么想法吗?
https://vuejsexamples.com/lightweight-vue-component-for-drawing-pure-css-donut-charts/
【问题讨论】:
标签: vuepress
我正在尝试使用这个 Vue 库添加图表。我将依赖项添加到配置文件中。图书馆要求我们使用Vue.use()。但我得到Vue is undefined。有什么想法吗?
https://vuejsexamples.com/lightweight-vue-component-for-drawing-pure-css-donut-charts/
【问题讨论】:
标签: vuepress
请使用应用级增强功能
https://vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements
以下文字是从 Vuepress 文档中复制而来的:
应用级增强功能
由于 VuePress 应用程序是一个标准的 Vue 应用程序,您可以通过创建一个文件 .vuepress/enhanceApp.js 来应用应用程序级别的增强,如果它存在,它将被导入到应用程序中。该文件应导出默认的钩子函数,该函数将接收包含一些应用程序级别值的对象。你可以使用这个钩子来安装额外的 Vue 插件,注册全局组件,或者添加额外的路由器钩子:
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
}
【讨论】: