fix(android): 禁止 Android App 文件卡片内图片点击预览
This commit is contained in:
parent
bb2b98fc82
commit
09a67f20dd
@ -61,9 +61,10 @@
|
|||||||
<template v-else-if="fileType === 'image'">
|
<template v-else-if="fileType === 'image'">
|
||||||
<img
|
<img
|
||||||
class="sfc-image"
|
class="sfc-image"
|
||||||
|
:class="{ 'sfc-image--android': isAndroidApp }"
|
||||||
:src="contentUrl"
|
:src="contentUrl"
|
||||||
:alt="displayName"
|
:alt="displayName"
|
||||||
@click="openFullImage"
|
@click="!isAndroidApp && openFullImage()"
|
||||||
@error="onImageError"
|
@error="onImageError"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@ -110,6 +111,11 @@ const canPreview = computed(() => {
|
|||||||
|
|
||||||
const canCopy = computed(() => ['text', 'code', 'json', 'csv', 'markdown'].includes(fileType.value));
|
const canCopy = computed(() => ['text', 'code', 'json', 'csv', 'markdown'].includes(fileType.value));
|
||||||
|
|
||||||
|
const isAndroidApp = computed(() => {
|
||||||
|
return typeof (window as any).AndroidDownloadBridge !== 'undefined' ||
|
||||||
|
typeof (window as any).AndroidThemeBridge !== 'undefined';
|
||||||
|
});
|
||||||
|
|
||||||
const metaText = computed(() => {
|
const metaText = computed(() => {
|
||||||
if (!rawContent.value) return '';
|
if (!rawContent.value) return '';
|
||||||
const sizeKB = (new Blob([rawContent.value]).size / 1024).toFixed(1);
|
const sizeKB = (new Blob([rawContent.value]).size / 1024).toFixed(1);
|
||||||
@ -465,4 +471,11 @@ onMounted(() => {
|
|||||||
padding: 12px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sfc-image--android {
|
||||||
|
cursor: default;
|
||||||
|
pointer-events: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user