准备修复一些控制台警告

This commit is contained in:
2025-07-25 23:47:01 +08:00
parent c84992cf87
commit e6e27c8ccf
10 changed files with 180 additions and 207 deletions

View File

@@ -0,0 +1,18 @@
<template>
<h1 :id class="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl">
<NuxtLink
v-if="generate"
:to="`#${id}`"
>
<slot />
</NuxtLink>
<slot v-else />
</h1>
</template>
<script setup lang="ts">
const { id } = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h1)));
</script>