
VUE
白桃気泡水
这个作者很懒,什么都没留下…
展开
-
VUE项目添加json配置文件
在vue项目中,有一些配置不想在代码里写死,可以写到json文件中json文件:\static\config.json{ "detectionInterval": 15000, "intervalTimeout": 300000}src\main.jsVue.prototype.$http = axiosVue.prototype.getConfig = function() { this.$http.get('/static/config.json').then(res原创 2021-11-18 13:58:55 · 1162 阅读 · 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 · 930 阅读 · 0 评论