feat: code highlighting
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import type { Article } from '@interfaces'
|
||||
import { ref, onBeforeMount } from 'vue'
|
||||
import { ref, onBeforeMount, onUpdated } from 'vue'
|
||||
import { loadArticle } from '@lib/articles'
|
||||
import { useRoute, onBeforeRouteUpdate, type RouteLocation } from 'vue-router'
|
||||
import NotFoundView from './NotFoundView.vue'
|
||||
import { dateFromParts, simpleDateFormat } from '@lib/dates'
|
||||
import { SIGNATURE, TITLE } from '@lib/meta'
|
||||
import PageFooter from '@components/PageFooter.vue'
|
||||
import hljs from 'highlight.js'
|
||||
|
||||
const article = ref<Article | null>(null)
|
||||
const loading = ref<boolean>(true)
|
||||
@@ -27,6 +28,10 @@ async function loadPage(target: RouteLocation) {
|
||||
|
||||
onBeforeMount(() => loadPage(route))
|
||||
onBeforeRouteUpdate(loadPage)
|
||||
|
||||
onUpdated(() => {
|
||||
hljs.highlightAll()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user