# uni.getLaunchOptionsSync()

获取本次启动时的参数。返回值与App.onLaunch的回调参数一致

# 返回值

类型
OnLaunchOptions
名称 类型 必备 默认值 描述
path string - -

# getLaunchOptionsSync 兼容性

Android iOS web
3.91 4.11 4.0

# 参见

相关 Bug

# 示例

hello uni-app x

Template

Script

<template>
  <page-head title="getLaunchOptionsSync"></page-head>
  <view class="uni-padding-wrap">
    <button @click="getLaunchOptionsSync">getLaunchOptionsSync</button>
    <view v-if="launchOptionsPath.length > 0" class="uni-common-mt">
      <text>应用启动路径:</text>
      <text style="margin-top: 5px">{{ launchOptionsPath }}</text>
    </view>
  </view>
</template>



# 通用类型

# GeneralCallbackResult

名称 类型 必备 默认值 描述
errMsg string - 错误信息