![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
VUE
白桃気泡水
这个作者很懒,什么都没留下…
展开
-
VUE项目添加json配置文件
在vue项目中,有一些配置不想在代码里写死,可以写到json文件中 json文件:\static\config.json { "detectionInterval": 15000, "intervalTimeout": 300000 } src\main.js Vue.prototype.$http = axios Vue.prototype.getConfig = function() { this.$http.get('/static/config.json').then(res原创 2021-11-18 13:58:55 · 1044 阅读 · 0 评论 -
Vue项目 js文件获取json 配置文件的配置信息
json文件:/static/config.json { "detectionInterval": 15000 } /build/webpack.base.conf.js 中添加: '#': resolve('static') resolve: { extensions: ['.js', '.vue', '.json'], alias: { '@': resolve('src'), '#': resolve('static') } }..原创 2021-11-18 11:31:55 · 817 阅读 · 0 评论