我想要的路径:http://localhost:8080/#/main/hato/realtime/eventDetail/238

情况一:未进行路由配置:
 {
     path: 'eventDetail',
     name: 'eventDetail',
     component: () => import('@/views/security/alarm-management/eventDetail')
}

情况二:已进行路由配置

 {
     path: 'eventDetail/:id',
     name: 'eventDetail',
     component: () => import('@/views/security/alarm-management/eventDetail')
}
在情况一下:

路由用 name和params 路由跳转:http://localhost:8080/#/main/hato/realtime/eventDetail

路由用path和query路由跳转:http://localhost:8080/#/main/hato/realtime/eventDetail?id=238

const showButton = {

  props: ["scope"],
  render: function(h) {
    return (
      <div>
        <router-link to={{name: "eventDetail", params: {id: this.scope.row.id}}}>
          查看详情
        </router-link>
      </div>
    );
  }
};
在情况二下:

路由用 name和params 路由跳转:http://localhost:8080/#/main/hato/realtime/eventDetail/238

路由用path和query 下面这个路径很奇怪,所以vue在router.js里面有个name属性路由跳转:http://localhost:8080/#/main/hato/realtime/eventDetail/:id?id=238

const showButton = {
  props: ["scope"],
  render: function(h) {
    return (
      <div>
        <router-link to={{path: "eventDetail/:id", query: {id: this.scope.row.id}}}>
          查看详情
        </router-link>
      </div>
    );
  }
};
总结:query要用path来引入,params要用name来引入

最新文章

  1. 深入浅出node(2) 模块机制
  2. [Erlang 0121] 当我们谈论Erlang Maps时,我们谈论什么 Part 3
  3. Xcode playground markdown常用语法
  4. 卷土重来之staticHtml基础使用教程
  5. tree view
  6. string转换成color转
  7. task判断任务是否存在
  8. 欧几里得旅行商问题 java与c++实现
  9. android开发:点击缩略图查看大图
  10. 使用&lt;span&gt;标签为文字设置单独样式
  11. Oracle全角和半角处理函数
  12. jquery treeTable插件使用细则
  13. Jquery+Ajax限制查询间隔
  14. poj 2720 Last Digits
  15. Spring-Security自定义登录页&amp;inMemoryAuthentication验证
  16. Mysql 数据库管理
  17. Vue(二)基础
  18. LeetCode--No.002 Add Two Numbers
  19. Linux 小知识翻译 - 「TCP/IP」
  20. open()、fwrite()、fread()函数使用说明与示例

热门文章

  1. 使用csv模块读写csv格式文件
  2. JMS消息传递类型特点介绍
  3. idea整合svn
  4. make 命令与 Makefile
  5. go-家庭收支记账软件例子
  6. java基础(17):包装类、System、Math、Arrays、大数据运算
  7. java基础(22):File、递归
  8. Jquery补充及插件
  9. sqlserver2008R2 本地不能用localhost连接
  10. CSP认证201812