让table每行均可以实现跳转,给table绑定点击事件this
<el-table :data="tableDataCb" style="width: 100%" @row-click="openDialog"> <el-table-column prop="W_NAME" label="名称" align="center" ></el-table-column> </el-table>
在methods里面添加方法,此时的跳转页面须要是加载在router里面的spa
openDialog() { this.$router.push({path: '/EnvAnalysis/DataWindow'}) }
goback() { this.$router.go(-1) }
注意:$route为当前router跳转对象里面能够获取name、path、query、params等;$router为VueRouter实例,想要导航到不一样URL,则使用$router.push方法code