首页 > 解决方案 > 如何在 vue 页面中读取我的最终 yaml 配置文件?

问题描述

我正在使用 nuxt 和config.yml扩展.config.yml文件。我想在我想要的任何页面中阅读最终生成的配置。怎么做?

如果我添加const config = require('config-yml');.vue 文件或任何插件 .js 我有很多错误编译。

标签: vue.jsyamlconfignuxt.js

解决方案


好的,找到了。

env: {
   config: config
}

在 nuxt.config.js

但没有找到如何从 .config.yml 获取


推荐阅读