<template>
<a @click="goNext">Next</a>
<input type="text" v-model="year"/>
<input type="text" v-model="day"/>
</template> <script>
export default {
data() {
rerurn {year: '', day: ''}
},
methods: {
goNext() {
this.$router.push({name: 'test', params: {year: this.year, day: this.day}})
}
}
}
</script>

A页面传递

<template>
<div>{{this.$route.params.year}}{{this.$route.params.day}}</div>
</template>

B页面接收

{
path: '/test',
name: 'test',
component: Test
}

修改router的index.js

如果还看不明白,参考:https://www.cnblogs.com/WQLong/p/7804215.html、https://blog.csdn.net/qq_15646957/article/details/78070862

反正我是看了这才明白的。

VUE,页面跳转传多个参数的更多相关文章

  1. vue 页面跳转传参

    页面之间的跳转传参,正常前端js里写 window.location.href="xxxxx?id=1" 就可以了: 但是vue不一样 需要操作的是路由history,需要用到 V ...

  2. vue页面跳转传参

    跳转页 this.$router.push({name:'路由命名',params:{参数名:参数值,参数名:参数值}}) 接收页 this.$route.params.参数名

  3. 用jQuery.ajaxWebService请求WebMethod,Ajax处理实现局部刷新;及Jquery传参数,并跳转页面 用post传过长参数

    首先在aspx.cs文件里建一个公开的静态方法,然后加上WebMethod属性. 如: [WebMethod]  public static string GetUserName()   {  //. ...

  4. 小程序页面跳转传参-this和that的区别-登录流程-下拉菜单-实现画布自适应各种手机尺寸

    小程序页面跳转传参 根目录下的 app.json 文件 页面文件的路径.窗口表现.设置网络超时时间.设置多 tab { "pages": [ "pages/index/i ...

  5. Vue页面跳转动画效果实现

    Vue页面跳转动画效果实现:https://juejin.im/post/5ba358a56fb9a05d2068401d

  6. vue页面跳转以及传参和取参

    vue中this.$router.push()路由传值和获取的两种常见方法 1.路由传值   this.$router.push() (1) 想要导航到不同的URL,使用router.push()方法 ...

  7. vue:页面跳转和传参(页面之间,父传子,子传父)

    1.返回上一个页面: A.<a @click="$router.back(-1)" class="btn">重新加载</a> B.thi ...

  8. vue 中 this.$router.push() 路由跳转传参 及 参数接收的方法

    传递参数的方法:1.Params 由于动态路由也是传递params的,所以在 this.$router.push() 方法中 path不能和params一起使用,否则params将无效.需要用name ...

  9. VUE页面跳转方式

    一.to +跳转路径 <router-link to="/">跳转到主页</router-link> <router-link :to="{ ...

随机推荐

  1. Selenium: Trying to log in with cookies and get the errorMessage - “Can only set cookies for current domain” or "Unable to set Cookie"

    from selenium import webdriver driver = webdriver.PhantomJS(executable_path='G:/OpenSources/phantomj ...

  2. 使用CloneDB克隆数据库

    本节包含以下主题: 关于使用CloneDB克隆数据库 使用CloneDB克隆数据库 使用CloneDB克隆数据库后 关于使用CloneDB克隆数据库 出于测试目的或其他目的克隆生产数据库通常是必要的. ...

  3. python使用pudb调试

    pudb是pdb的升级版本 安装 pip3 install pudb 使用方法 在程序文件的开头导入包 from pudb import set_trace set_trace()#断点位置 运行的时 ...

  4. lnmp 搭建 初试

    #初始化环境检查 # uname -r -.el6.x86_64 # uname -m x86_64 #添加mysql用户 useradd -s /sbin/nologin mysql -M #下载安 ...

  5. win7 vs2012/2013 编译boost 1.55

    bjam install stage --toolset=msvc-11.0 --stagedir="C:\Boost\boost_vc_110" link=shared runt ...

  6. win32编程中消息循环和WndProc()窗口过程函数

    原文地址:https://blog.csdn.net/zxxSsdsd/article/details/45504383 在win32程序的消息循环函数中  while (GetMessage (&a ...

  7. hibernate框架学习之数据类型

  8. 竞赛常用STL备忘录

    __builtin: __builtin_popcount:二进制中 1 的个数__builtin_ctz:末尾的 0,即对 lowbit 取log__builtin_clz:开头的 0,用 31 减 ...

  9. T-SQL ORDER BY子句 排序方式

    MS SQL Server ORDER BY子句用于根据一个或多个列以升序或降序对数据进行排序. 默认情况下,一些数据库排序查询结果按升序排列. 语法 以下是ORDER BY子句的基本语法. SELE ...

  10. Spring initializr使用

    Spring initializr 是Spring 官方提供的一个很好的工具,用来初始化一个Spring boot 的项目. 有两种方式可以使用Spring initializr来创建一个项目: ht ...