refactor: use nuxt compatiable 4 folder
This commit is contained in:
31
app/app.vue
Normal file
31
app/app.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import { installPrompt } from './utils/pwa'
|
||||
import { appName } from '~/constants'
|
||||
import { useIndexedDB } from '~/composables/db'
|
||||
|
||||
// https://nuxt.com/docs/api/composables/use-head
|
||||
useHead({
|
||||
title: appName,
|
||||
meta: [
|
||||
{
|
||||
name: 'description',
|
||||
content: '好的,今天我们来做菜!',
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const indexedDB = useIndexedDB()
|
||||
|
||||
onMounted(() => {
|
||||
installPrompt()
|
||||
indexedDB.init()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VitePwaManifest />
|
||||
<NuxtLayout>
|
||||
<NuxtLoadingIndicator />
|
||||
<NuxtPage />
|
||||
</NuxtLayout>
|
||||
</template>
|
||||
Reference in New Issue
Block a user