feat: vue3中解析渲染md教程
parent
d145ddc07e
commit
1fdbd0ee0d
@ -0,0 +1,18 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="markdown-body"
|
||||||
|
v-html="htmlStr"
|
||||||
|
></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { marked } from 'marked';
|
||||||
|
import { getMarkdownContent } from '@/utils/tools';
|
||||||
|
|
||||||
|
const htmlStr = ref('');
|
||||||
|
|
||||||
|
getMarkdownContent('./md/h5唤起app.md').then((res) => {
|
||||||
|
htmlStr.value = marked(res);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
class="markdown-body"
|
||||||
|
v-html="htmlStr"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { marked } from 'marked';
|
||||||
|
import { getMarkdownContent } from '@/utils/tools';
|
||||||
|
|
||||||
|
const htmlStr = ref('');
|
||||||
|
|
||||||
|
getMarkdownContent('./md/vue3中渲染markdown.md').then((res) => {
|
||||||
|
htmlStr.value = marked(res);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue