vue-route 路由传参的使用
1 router/index.js 中的定义
{
path: '/product',
component: ProductIndex,
meta: {
requiredAuth: true,
}
},
2 category-link.vue 中的调用
<router-link :to="{path: '/product', query: {caa_id: item.caa_id}}">
<img :src="item.caa005" class="img-responsive link-item-image">
<div class="link-item-title text-primary">{{item.caa001}}</div>
</router-link>
3 product-list.vue 中的响应
let caa_id = this.$route.query.caa_id;
let _self = this;
this.rows.map(function (item) {
if (item.caa_id == caa_id) {
_self.select(item);
}
});
4 小结:
在任何一个组件中都可以用以下的语法捕捉到参数
let params = this.$route.query;
然后作出相应的处理。
vue-route 路由传参的使用的更多相关文章
- 18 vue 动态路由传参
params形式 http://192.168.1.100:8080/#/infoDetailed/231 //定义路由{ path: "/infoDetailed/:newsId" ...
- vue里面路由传参的三种方式
1.方式一 通过query的方式也就是?的方式路径会显示传递的参数 HTML的方式<router-link :to="{name:xxx,query:{page:1,code:8899 ...
- vue之路由传参三种基本方式
现有如下场景,点击父组件的li元素跳转到子组件中,并携带参数,便于子组件获取数据. 父组件中: <li v-for="article in articles" @click= ...
- vue中路由传参的方式
一.params的类型: 配置路由格式: /router/:id 传递的方式: 在path后面跟上对应的值 传递后形成的路径: /router/123, /router/abc 通过:to字符串拼接的 ...
- redirect route 路由传参
return redirect()->route('exams.sign',['token'=>$token,'id'=>$result['id']]); // 签到页面 Route ...
- vue链接传参与路由传参
1.链接传参: 例如:链接是:http://localhost:3333/#/index?id=001 我们要获取参数:console.log(this.$route.query.id):即可 2.路 ...
- webpack+vue 组件间传参(单一事件中心管理组件通信--$root),如果有路由的话会失效
先给一个例子: <body> <div id="box"> <com-a></com-a> <com-b></co ...
- react router @4 和 vue路由 详解(六)vue怎么通过路由传参?
完整版:https://www.cnblogs.com/yangyangxxb/p/10066650.html 8.vue怎么通过路由传参? a.通配符传参数 //在定义路由的时候 { path: ' ...
- vue路由传参的三种方式以及解决vue路由传参页面刷新参数丢失问题
最近项目中涉及到跨页面传参数和后台进行数据交互,看到需求之后第一反应就是用路由传参来解决:Vue中给我们提供了三种路由传参方式,下面我们一个一个的来看一下: 方法一:params传参: this.$r ...
- [Vue 牛刀小试]:第十三章 - Vue Router 基础使用再探(命名路由、命名视图、路由传参)
一.前言 在上一章的学习中,我们简单介绍了前端路由的概念,以及如何在 Vue 中通过使用 Vue Router 来实现我们的前端路由.但是在实际使用中,我们经常会遇到路由传参.或者一个页面是由多个组件 ...
随机推荐
- python之socket编写
Socket 类型 套接字格式: socket(family,type[,protocal]) 使用给定的地址族.套接字类型.协议编号(默认为0)来创建套接字. socket类型 描述 socket. ...
- 下载Chrome独立版(alternate/offline Installer)的地方
因为Great fire wall,Chrome无法更新,下载独立版(alternate/offline Installer)的地方 很多朋友可以用proxy firefox访问google,却无法让 ...
- UVA327
模拟 这个问题的任务是求解一组c语言里的表达式,但是你不需要知道c语言是怎么解决这个问题!每一行一个表达式,每个表达式的组成不会超过110个字符.待求解的表达式只包含一个int类型变量和一个组有限的操 ...
- Nginx-ingress-controller部署
参考官网https://kubernetes.github.io/ingress-nginx/ 部署pod:nginx-ingress-controller/nginx-default-backend ...
- 微信小程序注册身份证验证
// 校验身份证号 //校验码校验 checkCode: function (val) { var p = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2])) ...
- C# WEB.API 接收并解析保存base64格式的图片
using System; using System.Collections.Generic; using System.Drawing; using System.IO; using System. ...
- Centos LVM 创建 删除 扩大 缩小
新建LVM的过程1.使用fdisk 新建分区 修改ID为8e3.使用 pvcreate 创建 PV 4.使用 vgcreate 创建 VG 5.使用 lvcreate 创建 LV 6.格式化LV7.挂 ...
- Nexus使用
Nexus使用: Nexus的默认登录账户:admin,密码:admin123. 以下为步骤说明: 1.右上角->login 2.左菜单->security->user->ad ...
- Python内存管理机制及优化简析(转载)
from:http://kkpattern.github.io/2015/06/20/python-memory-optimization-zh.html 准备工作 为了方便解释Python的内存管理 ...
- 【转】Phong和Blinn-Phong光照模型
来自:http://www.cnblogs.com/bluebean/p/5299358.html Phong和Blinn-Phong是计算镜面反射光的两种光照模型,两者仅仅有很小的不同之处. 1.P ...