-
原生微信小程序获取页面路由参数:
使用
onLoad
钩子函数获取页面参数onLoad((event) => { console.log(event?.type) // 4 })
-
在
uni-app
项目中获取页面路由参数:使用
defineProps
获取页面参数
也可以使用const query = defineProps<{ type: string }>() // console.log(query) Proxy {type: "4"}
onLoad
生命周期钩子函数获取页面路由参数
07-25
942
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-12
3869
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-26