vue watch route params change

    watch: {
'$route.params.menuKey' (val, oldVal) {
console.log('new route ', val);
// this.currentTab = val;
},
},
watch: {
'$route.params.search': {
handler: function(search) {
console.log(search)
},
deep: true,
immediate: true,
}
}
watch:{
'$route' (to, from){
// Put your logic here...
}
},
this.$forceUpdate()

vm.$forceUpdate()
vm.$nextTick( [callback] )

https://vuejs.org/v2/api/#vm-forceUpdate

https://vuejs.org/v2/api/#vm-nextTick

refs

https://stackoverflow.com/questions/50981059/watch-route-object-on-vue-js/50981093

https://router.vuejs.org/guide/essentials/dynamic-matching.html

https://forum.vuejs.org/t/rerendering-component-on-route-param-change-recalling-created-hooks/9536



xgqfrms 2012-2020

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


vue watch route params change的更多相关文章

  1. vue vue-route 传参 $route.params

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  2. vue之this.$route.params和this.$route.query的区别

    1.this.$route.query的使用 A.传参数: this.$router.push({          path: '/monitor',          query:{       ...

  3. vue嵌套路由--params传递参数

    在嵌套路由中,父路由向子路由传值除了query外,还有params,params传值有两种情况,一种是值在url中显示,另一种是值不显示在url中. 1.显示在url中index.html <d ...

  4. Vue Router的params和query传参的使用和区别

    vue页面跳转有两种方式分别是:name和path this.$router.push({name: 'HelloWorld2}) this.$router.push({path: '/hello-w ...

  5. vue路由传值params和query的区别

    vue路由传值params和query的区别1.query传参和接收参数传参: this.$router.push({ path:'/xxx' query:{ id:id } })接收参数: this ...

  6. 路由传值及获取参数,路由跳转,路由检测,this.$route.query和this.$route.params接收参数,HttpGet请求拼接url参数

    配置动态路由参数id: routes: [ // 动态路径参数 以冒号开头 { path: '/user/:id', component: User } ] html路由跳转: <router- ...

  7. vue & this.$route & this.$router

    vue & this.\(route & this.\)router const User = { template: '<div>User</div>' } ...

  8. vue router & query params

    vue router & query params vue router get params from url https://zzk.cnblogs.com/my/s/blogpost-p ...

  9. vue & @on-change !== on-change @on-change === @change

    vue & @on-change !== on-change @on-change === @change https://jsfiddle.net/Lasx1fod/ i-switch ht ...

随机推荐

  1. C语言中二维数组声明时,探究省略第一维的原因

    我们在使用二维数组作为参数时,我们既可以指明这个数组各个维度的维数,同时我们也可以省略一维,但是二维却不能省略.why呢?由于编译器原理的限制,在一个数组Elemtype test[m][n]中,访问 ...

  2. zabbix客户端监控脚本shell

    zabbix客户端监控脚本shell #!/bin/sh sleep 3 zabbixdir=`pwd` zabbix_version=4.2.5 ###指定版本,最好和server端吻合版本,可以自 ...

  3. MySQL之谓词下推

    MySQL之谓词下推 什么是谓词 在SQL中,谓词就是返回boolean值即true或者false的函数,或是隐式转换为boolean的函数.SQL中的谓词主要有 LKIE.BETWEEN.IS NU ...

  4. 选出ip记录表最近的10行数据

    w select * from wip where id>(select (select max(id)from wip)-10) ;

  5. TCP随笔

    目录 前言 正文 time_wait和rst fin与连接关闭 nagel和ack延迟算法 滑动窗口与拥塞控制 文末 总结 测试代码 前言 网上已经有大量关于tcp的文章,感觉作为一名技术人员,不写一 ...

  6. STM32 定时器详细篇(基于HAL库)

    l  16位的向上.向下.向上/向下(中心对齐)计数模式,支持自动重装载 l  16位的预分频器 l  每个定时器都有多个独立通道,每个通道可用于 *  输入捕获 *  输出比较 *  PWM输出 * ...

  7. Prometheus 初探和配置(安装测试)

    本文大纲: • Prometheus 官⽹下载• Prometheus 开始安装• Prometheus 启动运⾏• Prometheus 基本配置⽂件讲解• 安装第⼀个exporter => ...

  8. HBase性能优化完全版

    近期在处理HBase的业务方面常常遇到各种瓶颈,一天大概一亿条数据,在HBase性能调优方面进行相关配置和调优后取得了一定的成效,于是,特此在这里总结了一下关于HBase全面的配置,主要参考我的另外两 ...

  9. java 读取text内容

    public static String readToString(String fileName) { String encoding = "UTF-8"; File file ...

  10. linux(8)Linux 查看端口占用情况

    前言 平常使用linux,我们经常需要查看哪个服务占用了哪个端口,接下来就为大家介绍了2种 Linux 查看端口占用情况可以使用 lsof 和 netstat 命令. 1. lsof -i:端口号 用 ...