VueRouter中的跳转

除了使用<router-view>,<router-link>,还有一种push是用来作跳转的。

如下面的方式:

router/index.js

  {
    path: '/ops/',
    component: Home,
      children: [
          {
              path: 'appdetail/:app_id',
              name: 'AppDetail',
              component: appdetail,
            meta: {
                icon: 'fa fa-home fa-lg',
                title: '部署应用',
                index: 0
            }
          },
      ]
  }

处理跳转的按钮点击

handleEnter: function (data) {
    this.$router.push({ name: 'AppDetail', params: {app_id: data.row.id }})
},

就像下面这样:

猜你喜欢

转载自www.cnblogs.com/aguncn/p/12337421.html