We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
I need to use the Anchor in Nuxt Content, any idea how I can make the component available for MDC?
Anchor
The text was updated successfully, but these errors were encountered:
Sorry for replying so late!
I'm poor in Nuxt MDC, but I think you should define Anchor outside the markdown via some config.
<template> <div ref="mdc"> <MDC /> </div> <Anchor> <AnchorLink v-for="item in anchors" :key="item.id" :to="`#${item.id}`"> {{ item.name }} </AnchorLink> </Anchor> </template> <script lang="ts" setup> const mdc = ref<HTMLElement>() const anchors = reactive<{ id: string, name: string }[]>([]) onMounted(() => { const links = mdc.value?.querySelectorAll('a.anchor') if (!links?.length) return // build anchors }) </script>
Sorry, something went wrong.
No branches or pull requests
Description
I need to use the
Anchor
in Nuxt Content, any idea how I can make the component available for MDC?Validations
The text was updated successfully, but these errors were encountered: