schema.uvue 1.1 KB
Newer Older
W
wanganxp 已提交
1
<template>
H
hdx 已提交
2 3
  <view>
    <button class="button" @click="openSchema('https://uniapp.dcloud.io/uni-app-x')">使用外部浏览器打开指定URL</button>
D
DCloud_LXH 已提交
4
    <!-- #ifdef APP-ANDROID -->
H
hdx 已提交
5
    <button class="button" @click="openSchema('market://details?id=com.tencent.mm')">使用应用商店打开指定App</button>
D
DCloud_LXH 已提交
6 7 8 9 10 11 12 13
    <button class="button" @click="openSchema('androidamap://viewMap?sourceApplication=Hello%20uni-app&poiname=DCloud&lat=39.9631018208&lon=116.3406135236&dev=0')">
      打开地图坐标
    </button>
    <!-- #endif -->
    <!-- #ifdef APP-IOS -->
    <button class="button" @click="openSchema('itms-apps://search.itunes.apple.com//WebObjects//MZSearch.woa/wa/search?media=software&lterm=')">打开 AppStore 到搜索页</button>
    <button class="button" @click="openSchema('http://maps.apple.com/?q=Mexican+Restaurant&sll=50.894967,4.341626&z=10&t=s')">打开 iOS 地图坐标</button>
    <!-- #endif -->
H
hdx 已提交
14
  </view>
W
wanganxp 已提交
15 16
</template>

D
DCloud_LXH 已提交
17 18
<script setup lang="uts">
import { openSchema } from '@/uni_modules/uts-openSchema'
W
wanganxp 已提交
19 20 21
</script>

<style>
H
hdx 已提交
22 23 24
  .button {
    margin: 15px;
  }
W
wanganxp 已提交
25
</style>