vue & this.\(route & this.\)router


const User = {
template: '<div>User</div>'
} const router = new VueRouter({
routes: [
// dynamic segments start with a colon
{ path: '/user/:id', component: User }
]
})

$route.query



$route.params



$route.query



$route.hash



https://router.vuejs.org/api/#the-route-object

this.$route

读取

// Given a route { path: '/user-*' }
this.$router.push('/user-admin') this.$route.params.pathMatch // 'admin' // Given a route { path: '*' }
this.$router.push('/non-existing') this.$route.params.pathMatch // '/non-existing'

https://router.vuejs.org/guide/essentials/dynamic-matching.html#catch-all-404-not-found-route

this.$router

设置

// Given a route { path: '/user-*' }
this.$router.push('/user-admin') this.$route.params.pathMatch // 'admin' // Given a route { path: '*' }
this.$router.push('/non-existing') this.$route.params.pathMatch // '/non-existing'

https://router.vuejs.org/guide/essentials/dynamic-matching.html#catch-all-404-not-found-route

refs



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


vue & this.$route & this.$router的更多相关文章

  1. vue中$route 和$router的区别

    在vue中会出现一种情况 const url=this.$route.query.returnURL; this.$router.push(url);    $router和$route的区别傻傻的分 ...

  2. vue watch route params change

    vue watch route params change watch: { '$route.params.menuKey' (val, oldVal) { console.log('new rout ...

  3. vue中的$route和$router的区别

    1. $route是一个对象 可以获取当前页面的路由的路径query.params.meta等参数: 2.$router是VueRouter的一个实例对象 在options中可以获取路由的routes ...

  4. Vue:$route 和 $router 的区别

    参考: https://uzshare.com/view/788446 https://router.vuejs.org/zh/ $route 是“路由信息对象”,包括 path,params,has ...

  5. vue教程(五)--路由router介绍

    一.html页面中如何使用 1.引入 vue-router.js 2.安装插件 Vue.use(VueRouter) 3.创建路由对象 var router = new VueRouter({ // ...

  6. vue-router中$route 和 $router

    1.1 $route 表示(当前路由信息对象) 表示当前激活的路由的状态信息,包含了当前 URL 解析得到的信息,还有 URL 匹配到的 route records(路由记录).路由信息对象:即$ro ...

  7. vue初级学习--路由router的编写(resolve的使用)

    一.导语 最近在用vue仿写淘宝的商品详情页面以及加入购物车页面,若是成功了,分享给大家~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 二.正文 我先用控制台创建了vue项目demo(如 ...

  8. 已配置好的vue全家桶项目router,vuex,api,axios,vue-ls,async/await,less下载即使用

    github 地址: https://github.com/liangfengbo/vue-cli-project 点击进入 vue-cli-project 已构建配置好的vuejs全家桶项目,统一管 ...

  9. Vue页面跳转$router.push 的用法

    vue2.0在使用的过程中, .vue文件之间的跳转,在template中的常见写法是: <router-link to="/miniCard/statement/horizon&qu ...

随机推荐

  1. docker容器的基本命令

      #安装docker yum -y install docker systemctl start docker.service systemctl status docker systemctl e ...

  2. 使用cacti监控linux主机

    介绍:使用cacti监控linux主机,需要在linux主机上面安装snmp服务,并修改snmpd.conf文件,指定cacti服务器的地址,然后在cacti的前台界面添加此主机即可,此处以监控cen ...

  3. JAVA SSM整合流程以及注意点

    1.搭建整合环境 整合说明:SSM整合可以使用多种方式,咱们会选择XML + 注解的方式 先搭建整合的环境 先把Spring的配置搭建完成 再使用Spring整合SpringMVC框架 最后使用Spr ...

  4. 向HDFS中指定的文件追加内容,由用户指定内容追加到原有文件的开头或结尾。

    1 import java.io.FileInputStream; 2 import java.io.IOException; 3 import java.text.SimpleDateFormat; ...

  5. YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. data = yaml.load(file_data)

    YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsa ...

  6. 详述C++casting操作

    Casting----类型转换,也就是将数据从一种类型转换到另一种类型的操作.本文首先给出两种类型转换的方式:隐式转换和显式转换,然后简单介绍一下C语言常用的类型转换方式,最后详细叙述C++中常用的三 ...

  7. (四)整合 RocketMQ ,实现请求异步处理

    整合 RocketMQ ,实现请求异步处理 1.RocketMQ简介 1.1 架构图片 1.2 角色分类 1.3 通信机制 2.实现案例 2.1 项目结构图 2.2 配置文件 2.3 生产者配置 2. ...

  8. Linux性能分析:生产环境服务器变慢,诊断思路和性能评估

    Linux性能分析:生产环境服务器变慢,诊断思路和性能评估 一.整机:top 二.CPU:vmstat 所有CPU核信息 每个进程使用CPU的用量分解信息 三.内存:free 四.硬盘:df 五.磁盘 ...

  9. SLAM01

    上周末发现了一个巨大的问题,就是我们目前构建的室内定位的方法中,一个基本的假设是错的----这就非常尴尬了. 于是乎赶紧抱一波佛脚,学习一下slam里相关的问题是怎么解决的,找找灵感. 结果看了个开头 ...

  10. SealClient

    import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import ja ...