vue 增加全局变量所有vue页面都可以使用
main.js
// 在new vue之前添加变量webSite
// 将Vue实例添加到Vue的原型链上
Vue.prototype.$webSite = 'http://127.0.0.1:8000';
login.vue
使用:
consol.log(this.$webSite)
main.js
// 在new vue之前添加变量webSite
// 将Vue实例添加到Vue的原型链上
Vue.prototype.$webSite = 'http://127.0.0.1:8000';
login.vue
使用:
consol.log(this.$webSite)