# ks.getLaunchOptionsSync
# ks.getLaunchOptionsSync()
获取小游戏冷启动时的参数。热启动参数通过 ks.onShow 接口获取。
# 返回值
属性 | 类型 | 说明 | 最低版本 |
---|---|---|---|
from 【废弃】 | string | 游戏启动场景 | 该参数已经不可用,如果需要知道启动场景请参考获取启动来源 (opens new window) |
query | Object | 启动小游戏时传入的参数 |
# 示例代码
let result = ks.getLaunchOptionsSync()
this.content.string += `\nGetLaunchOptionSync, result: ${JSON.stringify(result)}`