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)
            
        },

 

 

 

posted @ 2022-03-12 16:19  Clematis  阅读(22)  评论(0)    收藏  举报