多租户 前后端分离 怎么获取路由传值

提问 2 1193
版本:renren-security 开发环境:
alertLabel (row) { // 组装路由名称, 并判断是否已添加, 如是: 则直接跳转 var routeName = `${this.$route.name}__${row.id}` var route = window.SITE_CONFIG['dynamicRoutes'].filter(item => item.name === routeName)[0] if (route) { return this.$router.push({ name: routeName, params: { 'pid': row.id } }) } // 否则: 添加并全局变量保存, 再跳转 route = { path: routeName, component: () => import(`@/views/modules/cube/cubeproductlabel`), name: routeName, meta: { ...window.SITE_CONFIG['contentTabDefault'], menuId: this.$route.meta.menuId, // title: `${this.$route.meta.title} - ${row.dictType}` title: '商品标签' } } this.$router.addRoutes([ { ...moduleRoutes, name: `main-dynamic__${route.name}`, children: [route] } ]) window.SITE_CONFIG['dynamicRoutes'].push(route) this.$router.push({ name: route.name, params: { 'a': row.id } }) } 问题:此处值怎么在跳转页面获取到,并且跳转的页面直接获取这个值进行查询动作 this.$router.push({ name: route.name, params: { 'a': row.id } })
回帖
  • this.$route.params.a
    0 回复
  • 一缕阳光
    2019-08-14
    我也是这样做的 请问下怎么用create 获取这个值 怎么让 <el-form-item> <el-input v-model="dataForm.id" placeholder="id" clearable></el-input> </el-form-item> <el-form-item> <el-button @click="getDataList()">{{ $t('query') }}</el-button> </el-form-item> 进入页面的时候 按照这个值查询
    0 回复