1
0
mirror of https://github.com/elk-zone/elk synced 2024-11-30 15:58:06 +09:00
elk/pages/share-target.vue

39 lines
913 B
Vue
Raw Permalink Normal View History

<script setup lang="ts">
definePageMeta({
middleware: () => {
if (!useAppConfig().pwaEnabled)
return navigateTo('/')
},
})
useWebShareTarget()
2024-02-25 01:46:14 +09:00
const pwaIsInstalled = import.meta.client && !!useNuxtApp().$pwa?.isInstalled
</script>
<template>
<MainContent>
<template #title>
<NuxtLink to="/share-target" flex items-center gap-2>
<div i-ri:share-line />
<span>{{ $t('share_target.title') }}</span>
</NuxtLink>
</template>
<slot>
<div flex="~ col" px5 py2 gap-y-4>
<div
v-if="!pwaIsInstalled || !currentUser"
role="alert"
gap-1
p-2
text-red-600 dark:text-red-400
border="~ base rounded red-600 dark:red-400"
>
{{ $t('share_target.hint') }}
</div>
<div>{{ $t('share_target.description') }}</div>
</div>
</slot>
</MainContent>
</template>