javascript - Execute function after vuejs page is loaded
我想大声告诉你
我想大声告诉你 2017-06-21 10:12:36
0
3
890

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

我想大声告诉你
我想大声告诉你

reply all(3)
巴扎黑
mounted(){
    this.init()
},
methods:{
    init(){
        console.log('hello,world')
    }
}

For reference only~

扔个三星炸死你

Vue2.0

mounted(){
    console.log("页面加载完成")
}
習慣沉默

mounted

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!