以Promise风格调用: 不支持。
获取小程序启动时的参数。与 App.onLaunch 的回调参数一致。
属性 | 类型 | 说明 |
---|---|---|
path | string | 启动小程序的路径 (代码包路径) |
query | object | 启动小程序的 query 参数 |
scene | string | 启动小程序的场景值 |
shopId | string | 启动小程序的POI来源 |
try { const res = xhs.getLaunchOptionsSync() console.log(res.query) } catch (e) { // Do something when catch error }```