zoukankan      html  css  js  c++  java
  • 编程式路由

    编程式路由
             通过js实现也面跳转
             $router.push('name')
             $router.push({path:'name'})
             $router.push({path:'name?a=123'})或者$router.push({path:'name',query:{a:123}})
             $router.go(1)


             ****页面获取值得区别
             1)<span>{{$route.params.testId}}</span>
                由:
                routes:[
                   {
                     path:'/goods/:testId'
                     ...
                   }
                ]

            2) <span>{{$route.query.testId}}</span>

               由:
               methods{
                 eg(){
                   this.$router.push(path:'/goods?a=123');
                     //this.$router.push('/cart');
                    //this.$router.push({path:'/cart?cartId=123'})
                    //this.$router.push({path:'/cart',query:{cartId:123}})  cartId写不写单引号都行
                    this.$router.go(-2);
                 }
               }

  • 相关阅读:
    repair table
    利用逻辑备份恢复部分库表
    Web框架理解
    BootStrape基础使用
    jQuery入门
    BOM操作
    DOM操作
    day12 css样式
    JavaScript基础
    day11 前端知识简单总结
  • 原文地址:https://www.cnblogs.com/lmxxlm-123/p/8295805.html
Copyright © 2011-2022 走看看