feat: 页面懒加载 #98

Manually merged
remilia merged 7 commits from feat/lazy-load into master 2025-12-19 13:28:25 +08:00
6 changed files with 305 additions and 147 deletions
Showing only changes of commit f2533767d2 - Show all commits

View File

@ -1,36 +1,37 @@
<template> <template>
<div class="page-container"> <div class="page-container">
<div v-if="!pending"> <app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
<app-breadcrumb class="breadcrumb" :items="breadcrumbItems" />
<div class="content"> <div class="content">
<!-- eslint-disable-next-line vue/no-v-html --> <el-skeleton :loading="pending" :rows="10" animated>
<div class="html-typography" v-html="companyProfile.content || ''" /> <template #default>
<!-- <div v-if="!hydrated" v-html="companyProfile.content || ''" /> --> <!-- eslint-disable-next-line vue/no-v-html -->
<!-- <div v-else> --> <div class="html-typography" v-html="companyProfile?.content || ''" />
<!-- <html-renderer --> <!-- <div v-if="!hydrated" v-html="companyProfile.content || ''" /> -->
<!-- class="html-typography" --> <!-- <div v-else> -->
<!-- :html="companyProfile.content || ''" --> <!-- <html-renderer -->
<!-- /> --> <!-- class="html-typography" -->
<!-- </div> --> <!-- :html="companyProfile.content || ''" -->
</div> <!-- /> -->
<!-- </div> -->
<el-divider content-position="left">{{ $t('learn-more') }}</el-divider> <el-divider content-position="left">{{
<div class="button-group"> $t('learn-more')
<learn-more-card }}</el-divider>
:title="$t('navigation.contact-info')" <div class="button-group">
:icon="ElIconService" <learn-more-card
:to="$localePath('/support/contact-us')" :title="$t('navigation.contact-info')"
/> :icon="ElIconService"
<learn-more-card :to="$localePath('/support/contact-us')"
:title="$t('navigation.address')" />
:icon="ElIconMapLocation" <learn-more-card
@click="openMap" :title="$t('navigation.address')"
/> :icon="ElIconMapLocation"
</div> @click="openMap"
</div> />
<div v-else class="loading"> </div>
<el-skeleton :rows="5" animated /> </template>
</el-skeleton>
</div> </div>
</div> </div>
</template> </template>
@ -42,7 +43,9 @@
{ label: $t('navigation.home'), to: localePath('/') }, { label: $t('navigation.home'), to: localePath('/') },
{ label: $t('navigation.about-us') }, { label: $t('navigation.about-us') },
]; ];
const { data: companyProfile, pending, error } = await useCompanyProfile(); const { data, pending, error } = useCompanyProfile();
const companyProfile = computed(() => data.value ?? null);
const openMap = () => { const openMap = () => {
window.open(localePath('/locate')); window.open(localePath('/locate'));