vue路由跳转方式

<el-button
            type="primary"
            size="small"
            @click="$router.push({name: 'xxxx.zq.xz.zqxx.new',params:{ year: year, month: month }})"
          >新增</el-button>

<el-button
            type="primary"
            size="small"
            @click="$router.push({name: 'xxxx.zq.xz.zqxx.new'})"
          >新增</el-button>
  this.$router.push({
                name: "xxxx.zq.xz.zqxx.index",
                params: { year: this.selectYear, month: this.selectMonth },
              });


//使用参数,如果路由定义时没有绑定参数,页面刷新就会丢失
this.$route.params.year;


//路由定义是绑定参数名,path上面的id就是绑定参数,在该页面刷新时不会丢失
 {
                  path: '/xxxx/zq/bb/zqqlmxbzd/:id/edit',
                  name: 'xxxx.zq.bb.zqqlmxbzd.edit',
                  meta: {
                    title: '编辑页面',
                    roles: [ADMIN, 'xxxx.zq.bb.zqqlmxbzd']
                  },
                  component: () => import('./pages/zq/bb/zqqlmxbzd/Edit'),
                  hidden: true
                }
 <template slot-scope="scope">
            <router-link
              :to="{ name: 'xxxx.zq.tz.zqhtmx.index', params: { htdh: scope.row.htdh }}"
              v-if="scope.row.htdh"
            >{{ scope.row.htdh }}</router-link>
          </template>

参考链接:https://router.vuejs.org/zh/api/#router-link

 elementUI中文链接:https://element.eleme.cn/#/zh-CN

 vue-element-admin参考网址: vue-element-admin

原文地址:https://www.cnblogs.com/pzw23/p/13530277.html