使用nuxt的時候在js進(jìn)行路由跳轉(zhuǎn)的方法
methods: {
to(url){
$nuxt.$router.push({ //$nuxt便是該vue中的vue對象
path: url,
params: {
tableName: tableName
}
})
}
}
使用 this.$router.push在我的項(xiàng)目中行不通,原因this指向并非一個vue
解決方法使用$nuxt.$router.push代替