feat: support pwa

This commit is contained in:
vben
2024-06-16 15:45:15 +08:00
parent 222c73963d
commit 382652e0f4
24 changed files with 1787 additions and 128 deletions

View File

@@ -49,6 +49,9 @@ const titleText = computed(() => {
case 'offline': {
return $t('fallback.offline-error');
}
case 'hello': {
return $t('fallback.coming-soon');
}
default: {
return '';
}

View File

@@ -125,6 +125,10 @@ const { copy } = useClipboard();
const tabs = computed((): SegmentedItem[] => {
return [
{
label: $t('preferences.general'),
value: 'general',
},
{
label: $t('preferences.appearance'),
value: 'appearance',
@@ -133,10 +137,7 @@ const tabs = computed((): SegmentedItem[] => {
label: $t('preferences.layout'),
value: 'layout',
},
{
label: $t('preferences.general'),
value: 'general',
},
{
label: $t('preferences.shortcut-keys.title'),
value: 'shortcutKey',
@@ -171,7 +172,7 @@ function handleReset() {
</script>
<template>
<div class="z-100 fixed right-0 top-1/3">
<div class="z-100 fixed right-0 top-2/3">
<VbenSheet
v-model:open="openPreferences"
:description="$t('preferences.preferences-subtitle')"
@@ -194,8 +195,8 @@ function handleReset() {
</VbenIconButton>
</template>
<div class="p-5 pt-4">
<VbenSegmented :tabs="tabs" default-value="appearance">
<div class="p-4 pt-4">
<VbenSegmented :tabs="tabs" default-value="general">
<template #appearance>
<Block :title="$t('preferences.theme')">
<Theme

View File

@@ -12,8 +12,8 @@ defineOptions({
<template>
<VbenButton
:title="$t('preferences.preferences')"
class="bg-primary flex-col-center h-9 w-9 cursor-pointer rounded-l-md rounded-r-none border-none"
class="bg-primary flex-col-center h-12 w-12 cursor-pointer rounded-l-lg rounded-r-none border-none"
>
<IconSetting class="text-lg" />
<IconSetting class="duration-3000 animate-spin text-2xl" />
</VbenButton>
</template>

View File

@@ -67,7 +67,6 @@ function showSpinning(index: number) {
</script>
<template>
<template v-if="showIframe">
{{ iframeRoutes.length }}
<template v-for="(item, index) in iframeRoutes" :key="item.fullPath">
<div
v-if="canRender(item)"