chrome在console中查看vue变量在浏览器console中调用vue内部方法
作者:互联网
new Vue({ el: '#app', i18n, store, router, data () { return { address:'' } }, components: {App}, template: '<App/>', mounted () { window.vue = this }, methods:{ updateAdress(address){ console.log(address) } } })
在main.js中设置mounted(){window.vue = this}
即可在console.log中调用
vue.updateAdress(123) //123
标签:vue,console,log,chrome,window,address,mounted 来源: https://www.cnblogs.com/clark1990/p/16461496.html