Skip to content

Commit 690c4cd

Browse files
committed
perf: MobileOnly+GkdOnly
1 parent c50479d commit 690c4cd

File tree

6 files changed

+48
-12
lines changed

6 files changed

+48
-12
lines changed

docs/.vitepress/components/AppInnerDownloadTip.vue

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<script setup lang="ts">
2+
const getShow = () => {
3+
return import.meta.env.DEV || Reflect.get(globalThis, 'gkd');
4+
};
5+
</script>
6+
<template>
7+
<ClientOnly>
8+
<slot v-if="getShow()"></slot>
9+
</ClientOnly>
10+
</template>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<script setup lang="ts">
2+
const getShow = () => {
3+
return (
4+
globalThis.document && 'ontouchstart' in globalThis.document.documentElement
5+
);
6+
};
7+
</script>
8+
<template>
9+
<ClientOnly>
10+
<slot v-if="getShow()"></slot>
11+
</ClientOnly>
12+
</template>

docs/.vitepress/components/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import GImg from './GImg';
33
import IdentifierField from './IdentifierField.vue';
44
import ImageTable from './ImageTable.vue';
55
import naiveComponents from './naive';
6-
import AppInnerDownloadTip from './AppInnerDownloadTip.vue';
6+
import GkdOnly from './GkdOnly.vue';
7+
import MobileOnly from './MobileOnly.vue';
78

89
export default {
910
...naiveComponents,
1011
GImg,
1112
ImageTable,
1213
IdentifierField,
1314
ApkTable,
14-
AppInnerDownloadTip,
15+
GkdOnly,
16+
MobileOnly,
1517
};

docs/guide/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
## 安装 {#install}
44

5-
<ClientOnly> <AppInnerDownloadTip/> </ClientOnly>
5+
<GkdOnly>
6+
7+
> [!TIP] 下载提示
8+
> 检测到您在应用内无法下载 APK,请点击右上角-外部打开后下载
9+
10+
</GkdOnly>
611

712
<ApkTable />
813

docs/guide/sponsor.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@
1414

1515
<GImg src="0046.png" />
1616

17+
<MobileOnly>
18+
<p text-center>
19+
20+
[--> 打开支付宝 <--](alipays://platformapi/startapp?saId=10000007&qrcode=https%3A%2F%2Fqr.alipay.com%2Ffkx18039ijnme6m5ef2na0a)
21+
22+
</p>
23+
</MobileOnly>
24+
1725
---
1826

1927
<GImg src="0047.png" />
28+
29+
<MobileOnly>
30+
<p text-center>
31+
32+
[--> 截图后打开微信 <--](gkd://invoke/openWeChat)
33+
34+
</p>
35+
</MobileOnly>

0 commit comments

Comments
 (0)