fix: faster page loading with no async
This commit is contained in:
+3
-14
@@ -1,25 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { ABOUT_LINK, TITLE } from '@lib/config'
|
||||
import { stripHTML } from '@lib/strings'
|
||||
import { onBeforeMount, onMounted, onUpdated, ref } from 'vue'
|
||||
import { onMounted, onUpdated } from 'vue'
|
||||
import { updateDynamicContent } from '@lib/articles'
|
||||
import BackHomeButton from '@components/BackHomeButton.vue'
|
||||
import { html } from '@articles/about.md'
|
||||
|
||||
const loading = ref<boolean>(true)
|
||||
const html = ref<string>('')
|
||||
|
||||
onBeforeMount(async () => {
|
||||
window.document.title = stripHTML(TITLE) + ' — ' + stripHTML(ABOUT_LINK)
|
||||
html.value = (await import('@articles/about.md')).html
|
||||
loading.value = false
|
||||
await updateDynamicContent()
|
||||
})
|
||||
onMounted(updateDynamicContent)
|
||||
onUpdated(updateDynamicContent)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="!loading" class="article">
|
||||
<div class="article">
|
||||
<div v-html="html"></div>
|
||||
<BackHomeButton />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user