generated from Seekra/repository-template
feat(legal): add legal notice loading indicator
This commit is contained in:
@@ -21,11 +21,13 @@ import { useI18n } from 'vue-i18n';
|
|||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
const loading = ref(true);
|
||||||
const legalNoticeError = ref(null);
|
const legalNoticeError = ref(null);
|
||||||
const legalNoticeHtml = ref(null);
|
const legalNoticeHtml = ref(null);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
legalNoticeHtml.value = await getLegalNotice();
|
legalNoticeHtml.value = await getLegalNotice();
|
||||||
|
loading.value = false;
|
||||||
} catch {
|
} catch {
|
||||||
legalNoticeError.value = 'legal.notice.loadError';
|
legalNoticeError.value = 'legal.notice.loadError';
|
||||||
}
|
}
|
||||||
@@ -40,7 +42,10 @@ onMounted(async () => {
|
|||||||
</h1>
|
</h1>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<div class="error" v-if="legalNoticeError">
|
<div v-if="loading">
|
||||||
|
{{ t('loading') }}
|
||||||
|
</div>
|
||||||
|
<div class="error" v-else-if="legalNoticeError">
|
||||||
{{ t(legalNoticeError) }}
|
{{ t(legalNoticeError) }}
|
||||||
</div>
|
</div>
|
||||||
<div class="legal-notice" v-html="legalNoticeHtml" v-else></div>
|
<div class="legal-notice" v-html="legalNoticeHtml" v-else></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user