当前位置:网站首页>router---编程式导航
router---编程式导航
2022-08-04 12:59:00 【monstkl】
一、编程式导航和声明式导航
声明式:<router-ling to="">
编程式: router.push('')二、编程式导航的方法
1、push 导航到不同位置
2、replace
3、 go(n) 参数为整数,可正可负
导航的方法会返回一个promise来告诉导航是否成功三、编程式导航方法(push、replace)的参数:字符串 | 对象
1、字符串
router.push('/detail')
2、对象(提供了path,params就会被忽略)
router.push({path: '/detail'})
router.push({path: '/detail', query:{}})
router.push({name: 'detail', params:{}}) // 这里的name对应路由配置中的name,大小写敏感四、在组件中接受导航时传递的参数
route.query.xx
route.params.xx五、params参数不会显示在地址栏,除非路由里配置了路径参数
边栏推荐
- 博尔赫斯-诗中的经典语段
- Geoffrey Hinton:深度学习的下一个大事件
- redisTemplate存取List遇到的坑
- 【软考 系统架构设计师】软件架构设计② 软件架构风格
- A comprehensive understanding of MOS tubes, an article is enough
- 永磁同步电机FOC驱动代码讲解
- String is a reference type
- Matlab记录
- Motion Rule (16)-Union Check Basic Questions-Grid Game
- 论文翻译:2022_Time-Frequency Attention for Monaural Speech Enhancement
猜你喜欢

技术分享| 小程序实现音视频通话

“蔚来杯“2022牛客暑期多校训练营2 G、J、K

使用SQLServer复制数据库

rpm安装提示error: XXX: not an rpm package (or package manifest):

"Lonely Walking on the Moon" is a powerful medicine, it can't cure the internal friction of happy twist

持续交付(三)Jenkinsfile语法使用介绍

《独行月球》猛药,治不了开心麻花内耗

视觉SLAM十四讲学习笔记 第7讲 视觉里程计

COMSOL空气反应 模型框架

新 Nsight Graph、Nsight Aftermath 版本中的性能提升和增强功能
随机推荐
sqlplus报错ORA-12547: TNS:lost contact解决
论文翻译:2022_Time-Frequency Attention for Monaural Speech Enhancement
SCA兼容性分析工具(ORACLE/MySQL/DB2---&gt;MogDB/openGauss/PostgreSQL)
“蔚来杯“2022牛客暑期多校训练营2 G、J、K
HDU1580 输出先手能取的方案数
高手,云集在于REST、gRPC 和 GraphQL之间!
【自动微分实现】反向OO实现自动微分(Pytroch核心机制)
5 cloud security management strategies enterprises should implement
Two years of independent development experience Programmers tell us the experience of making money (listen to the masters who really make money)
面试官:如何查看/etc目录下包含abc字符串的文件?
MySQL-数据类型
获取本机IP地址的脚本
接到“网站动态换主题”的需求,我是如何踩坑的
【牛客刷题-SQL大厂面试真题】NO5.某宝店铺分析(电商模式)
GeoAO:一种快速的环境光遮蔽方案
DateTimeFormatter api
Control CD-ROM with VbScript
石子 无限拿
【软考 系统架构设计师】软件架构设计② 软件架构风格
新 Nsight Graph、Nsight Aftermath 版本中的性能提升和增强功能