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 }}) 
相关文章
相关标签/搜索