跳转样式:

image.png

写法:

  1. <el-button
  2. type="text"
  3. @click="
  4. $router.push(
  5. `tags?id=${scope.row.id}&name=${encodeURIComponent(
  6. scope.row.subjectName
  7. )}`
  8. )
  9. "
  10. >学科标签</el-button
  11. >

在跳转的页面中接收并使用

  1. <el-button v-if="subject.id && subject.name">返回学科 //或者通过this.$route.query.id直接获取
  2. </el-button>
  3. computed: {
  4. subject () {
  5. return this.$route.query || {}
  6. },
  7. }