准备修复一些控制台警告
This commit is contained in:
18
app/components/content/ProseH1.vue
Normal file
18
app/components/content/ProseH1.vue
Normal 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>
|
18
app/components/content/ProseH2.vue
Normal file
18
app/components/content/ProseH2.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<h2 :id class="scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight transition-colors [&:not(:first-child)]:mt-10">
|
||||
<NuxtLink
|
||||
v-if="id && generate"
|
||||
:to="`#${id}`"
|
||||
>
|
||||
<slot />
|
||||
</NuxtLink>
|
||||
<slot v-else />
|
||||
</h2>
|
||||
</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?.h2)));
|
||||
</script>
|
18
app/components/content/ProseH3.vue
Normal file
18
app/components/content/ProseH3.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<h3 :id class="scroll-m-20 text-2xl font-semibold tracking-tight [&:not(:first-child)]:mt-8">
|
||||
<NuxtLink
|
||||
v-if="id && generate"
|
||||
:to="`#${id}`"
|
||||
>
|
||||
<slot />
|
||||
</NuxtLink>
|
||||
<slot v-else />
|
||||
</h3>
|
||||
</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?.h3)));
|
||||
</script>
|
18
app/components/content/ProseH4.vue
Normal file
18
app/components/content/ProseH4.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<h4 :id class="scroll-m-20 text-xl font-semibold tracking-tight [&:not(:first-child)]:mt-6">
|
||||
<NuxtLink
|
||||
v-if="id && generate"
|
||||
:to="`#${id}`"
|
||||
>
|
||||
<slot />
|
||||
</NuxtLink>
|
||||
<slot v-else />
|
||||
</h4>
|
||||
</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?.h4)));
|
||||
</script>
|
18
app/components/content/ProseH5.vue
Normal file
18
app/components/content/ProseH5.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<h5 :id class="scroll-m-20 text-lg font-semibold tracking-tight [&:not(:first-child)]:mt-6">
|
||||
<NuxtLink
|
||||
v-if="id && generate"
|
||||
:to="`#${id}`"
|
||||
>
|
||||
<slot />
|
||||
</NuxtLink>
|
||||
<slot v-else />
|
||||
</h5>
|
||||
</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?.h5)));
|
||||
</script>
|
18
app/components/content/ProseH6.vue
Normal file
18
app/components/content/ProseH6.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<h6 :id class="scroll-m-20 text-lg font-semibold tracking-tight [&:not(:first-child)]:mt-6">
|
||||
<NuxtLink
|
||||
v-if="id && generate"
|
||||
:to="`#${id}`"
|
||||
>
|
||||
<slot />
|
||||
</NuxtLink>
|
||||
<slot v-else />
|
||||
</h6>
|
||||
</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?.h6)));
|
||||
</script>
|
Reference in New Issue
Block a user