在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ vue中想要路由從詳情頁跳轉(zhuǎn)this.$router.push('/home')

vue中想要路由從詳情頁跳轉(zhuǎn)this.$router.push('/home')的時(shí)候,彈出一個(gè)彈框

屬于不用組件的數(shù)據(jù)傳遞,需要用到watch嗎,請(qǐng)問這種應(yīng)該如何寫

回答
編輯回答
心沉

跳轉(zhuǎn)前 還是跳轉(zhuǎn)后? 這個(gè)得確定

跳轉(zhuǎn)前 那就在具體路由下面來

watch:{
    '$route'(to, from) {
       if(to == './home'){
        alert(11111)
       }
     }
}

跳轉(zhuǎn)后 那就在/home路由下面

watch:{
    '$route'(to, from) {
       alert(11111)
      }
}    
2018年2月13日 10:44