uni-app路由相关
带参数的回源跳转
onLoad(){
//测试代码
const currentPage = getCurrentPages().pop()
const options = currentPage.options
//带参数的key
const optionKeys = Object.keys(options)//[id]
let params = ''
if(optionKeys.length!== 0){
params = optionKeys.reduce((pre,current)=>{
return pre + current + '='+ options[current]+ '&'
},'?').slice(0,-1)
}
console.log(params)
},