Vue.prototype.$ 和 Vue.use,
Vue.prototype.$ 意为绑定一个全局变量
Vue.use(XXX) 意为引入XXX, 例如Vue.use(VueRouter),
1. 但是用 axios
时,就不需要用 Vue.use(axios)?因为
axios
没有 install
。
2. Vue.prototype.$ 和 Vue.use() 有啥关系吗?没有
- 上一篇 »vue $mount挂载实例方法
- 下一篇 »vue如何让自定义函数挂到全局?
Vue.prototype.$ 意为绑定一个全局变量
Vue.use(XXX) 意为引入XXX, 例如Vue.use(VueRouter),
1. 但是用 axios
时,就不需要用 Vue.use(axios)?因为
axios
没有 install
。
2. Vue.prototype.$ 和 Vue.use() 有啥关系吗?没有