mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-05 20:58:22 +08:00
feat(docs): right menu tag convert (#12606)
* feat(docs): right menu tag convert * fix: use localMd
This commit is contained in:
parent
3942e10340
commit
167582d8b4
@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
import { useToc } from '../../composables/use-toc'
|
||||
import { useActiveSidebarLinks } from '../../composables/active-bar'
|
||||
|
||||
@ -8,8 +9,10 @@ import { useLang } from '../../composables/lang'
|
||||
import SponsorsButton from '../sponsors/sponsors-button.vue'
|
||||
import SponsorRightTextList from '../sponsors/right-richtext-list.vue'
|
||||
import SponsorRightLogoSmallList from '../sponsors/right-logo-small-list.vue'
|
||||
import tag from '../../../plugins/tag'
|
||||
// import SponsorLarge from '../vp-sponsor-large.vue'
|
||||
|
||||
const localMd = MarkdownIt().use(tag)
|
||||
const headers = useToc()
|
||||
const marker = ref()
|
||||
const container = ref()
|
||||
@ -28,16 +31,24 @@ const sponsor = computed(() => sponsorLocale[lang.value])
|
||||
:key="link"
|
||||
class="toc-item"
|
||||
>
|
||||
<a class="toc-link" :href="link" :title="text">{{ text }}</a>
|
||||
<a
|
||||
class="toc-link"
|
||||
:href="link"
|
||||
:title="text"
|
||||
v-html="localMd.render(text)"
|
||||
/>
|
||||
<ul v-if="children">
|
||||
<li
|
||||
v-for="{ link: childLink, text: childText } in children"
|
||||
:key="childLink"
|
||||
class="toc-item"
|
||||
>
|
||||
<a class="toc-link subitem" :href="childLink" :title="text">{{
|
||||
childText
|
||||
}}</a>
|
||||
<a
|
||||
class="toc-link subitem"
|
||||
:href="childLink"
|
||||
:title="text"
|
||||
v-html="localMd.render(childText)"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user