mirror of
https://github.com/keven1024/015.git
synced 2026-05-31 01:19:35 +00:00
feat(config): add site_enable_bg property to app configuration and update layout to conditionally render background image
This commit is contained in:
@@ -6,6 +6,7 @@ const useMyAppConfig = () => {
|
||||
site_url: string
|
||||
site_icon: string
|
||||
site_bg_url: string
|
||||
site_enable_bg: boolean
|
||||
version: string
|
||||
build_time: number
|
||||
features: string[]
|
||||
|
||||
@@ -4,13 +4,16 @@ const { locale } = useI18n()
|
||||
await useSeo({ locale: locale.value })
|
||||
const appConfig = useMyAppConfig()
|
||||
const bgUrl = computed(() => appConfig.value?.site_bg_url)
|
||||
const enableBg = computed(() => appConfig.value?.site_enable_bg ?? true)
|
||||
</script>
|
||||
<template>
|
||||
<div class="h-screen w-screen">
|
||||
<GlobalDrawer />
|
||||
<GlobalDayjs />
|
||||
<Toaster position="top-center" richColors closeButton />
|
||||
<img class="w-full h-full object-cover absolute inset-0 -z-[1] bg-gradient-to-bl from-primary/40 to-primary" :src="bgUrl" />
|
||||
<div class="w-full h-full absolute inset-0 z-[-1] bg-linear-to-bl from-primary/40 to-primary">
|
||||
<img v-if="enableBg" class="w-full h-full object-cover" :src="bgUrl" />
|
||||
</div>
|
||||
<div class="h-full w-full flex flex-col items-center lg:p-10 p-5 overflow-y-auto">
|
||||
<Navbar />
|
||||
<slot />
|
||||
|
||||
Reference in New Issue
Block a user