json文件路徑如下
我們在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下了
當我們修改文件后,只需要刷新頁面即可訪問修改后的內容。