this.$router.push() 的用法

一、做用:this.$router.push() 能夠經過修改url實現路由跳轉。html

二、push 後面能夠是對象,也能夠是字符串:this

// 字符串 this.$router.push('/home/first') // 對象 this.$router.push({ path: '/home/first' }) // 命名的路由 this.$router.push({ name: 'home', params: { userId: wise }}) 
相關文章
相關標籤/搜索