mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 15:13:30 +00:00
15 lines
391 B
Vue
15 lines
391 B
Vue
<script setup lang="ts">
|
|
import markdownit from 'markdown-it'
|
|
import { cx } from 'class-variance-authority'
|
|
const props = defineProps<{
|
|
markdown: string
|
|
class?: string
|
|
}>()
|
|
const renderHtml = computed(() => {
|
|
const md = markdownit()
|
|
return md.render(props?.markdown || '')
|
|
})
|
|
</script>
|
|
<template>
|
|
<div :class="cx('prose', props?.class)" v-html="renderHtml" />
|
|
</template> |