后端返回的小程序码前端获取scene参数时注意点
onLoad (query) {
// scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
const scene = decodeURIComponent(query.scene)
}
- 虽然
page
参数会默认,但一定要传,不然获取不到scene
- 需跳转正式版
release
,不然也获取不到scene
试下
this.$nextTick(()=>{})