1.引入方式不同
query要用path来引入
this.$router.push({ path: ‘test‘, query: { type: 2, detail: ‘哈哈‘ } })
params要用name来引入
this.$router.push({ name: ‘test‘, query: { type: 2, detail: ‘哈哈‘ } })
2.url不同
query在url中显示参数
http://localhost:8080/detail?type=0&detail=哈哈
params在url中不显示参数
http://localhost:8080/detail
原文地址:https://www.cnblogs.com/PeunZhang/p/12090469.html
时间: 2024-11-01 19:53:02