按鈕
<button @click="register">登錄</button>
實現跳轉 在methods里面寫入一下代碼
register () { //跳轉到上一次瀏覽的頁面 this.$router.go(-1) //指定跳轉的地址 this.$router.replace('/將要跳轉的路由名稱') //指定跳轉的路由的名字下 this.$router.replace({name:'指定路由名稱'}) //通過push進行跳轉 this.$router.push('/將要跳轉的路由名稱') }
