vue-router 在路由進入且dom加載之後執行

 

//路由進入之前,相當於攔截器
router.beforeEach((to, from, next) => {
    Vue.nextTick(function(){//dom已加載完成
        let timingInputs = $("input[name=timing]");
          //加載時間選擇器
        lay('input[name="timing"]').each(function(){
            laydate.render({elem: this,type: 'datetime',btns: ['confirm']});
        })
    })
    next();
});

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章