小程序获取当前页面路径及参数的代码:
export function getCurrentPageUrlWithArgs() {
const pages = getCurrentPages()
const currentPage = pages[pages.length – 1]
const url = currentPage.route
const options = currentPage.options
let urlWithArgs = `/${url}?`
for (let key in options) {
const value = options[key]
urlWithArgs += `${key}=${value}&`
}
urlWithArgs = urlWithArgs.substring(0, urlWithArgs.length – 1)
return u活动:慈云数据爆款香港服务器,CTG+CN2高速带宽、快速稳定、平均延迟10+ms 速度快,免备案,每月仅需19元!! 点击查看rlWithArgs
}
《小程序页面路径参数怎么看》来自互联网同行内容,若有侵权,请联系我们删除!
还没有评论,来说两句吧...