module.exports = {
data: function(){
return {
memberQrcodeState: false
}
},
components: {memberQrcode},
created: function(){
},
beforeRouteEnter: function(to, from, next) {
// 在渲染该组件的对应路由被 confirm 前调用
// 不!能!获取组件实例 `this`
// 因为当钩子执行前,组件实例还没被创建
//$e.target.src= require("../imgs/test/232.jpg")
next();
return true;
},
methods: {
},
beforeRouteLeave: function(to, from, next) {
// 导航离开该组件的对应路由时调用
// 可以访问组件实例 `this`
next();
}
};
On this basis, add a function to be executed after the page is loaded! I'm a novice, I came into contact with vuejs the next day, I hope someone can give me some advice
巴扎黑2017-06-21 10:14:36
mounted(){
this.init()
},
methods:{
init(){
console.log('hello,world')
}
}
For reference only~