config文件夹下 新建global.js
const BASE_URL = 'http://xxxxxxx'
export default {
BASE_URL
}
main.js添加到全局
import global_ from '../config/global'
Vue.prototype.GLOBAL = global_;
组件里使用:
created() {
console.log(this.GLOBAL.BASE_URL)
},
config文件夹下 新建global.js
const BASE_URL = 'http://xxxxxxx'
export default {
BASE_URL
}
main.js添加到全局
import global_ from '../config/global'
Vue.prototype.GLOBAL = global_;
组件里使用:
created() {
console.log(this.GLOBAL.BASE_URL)
},