vue Click for routing Jump

Click the button to jump to achieve routing

<div @click="gotoMenu">按钮</div>

 

Jump realization

Methods: { 
    gotoMenu () { 
      // . Jump to the last viewed page $ router.go the this (-1) 
      the this . $ router.go (-1 ) 

      // . Jump specified address this $ router.replace ( '/ MENU') 
      the this . router.replace $ ( '/ MENU' ) 

      // . jump to the this specified route router.replace name $ ({name: 'MENU'}) 
      the this . $ router.replace ( name {: 'MENU' }) 

      // jump by Push 
      the this $ router.push ( '/ MENU'. ) 
    } 
  }, 
}

 

Guess you like

Origin www.cnblogs.com/chz1905/p/10954227.html