xiuyuandashen

json文件路径如下

image

我们在main.js 中挂载到vue的根属性

Vue.prototype.$axios.get(\'/static/key.json\').then((res) => {
  var passwordkey = res.data.passwordkey;
  console.log(passwordkey)
  Vue.prototype.$passwordkey = passwordkey
}).catch(err => {
  console.log("passwordkey " + err);
})

当打包后key.json 就会在static下了

image

当我们修改文件后,只需要刷新页面即可访问修改后的内容。

分类:

技术点:

相关文章:

  • 2022-01-01
  • 2022-12-23
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
  • 2021-08-04
  • 2021-06-30
猜你喜欢
  • 2021-11-10
  • 2021-09-20
  • 2021-11-19
  • 2022-12-23
  • 2022-01-01
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案