1、首先需要安裝 md-editor-v3
yarn add md-editor-v3
或者是在vue圖形化界面中直接搜索 md-editor-v3 進行安裝。
2、引入該編輯頁
引入可以參考這個,根據自己的需求進行修改和添加。文章來源:http://www.zghlxwxcb.cn/news/detail-649539.html
<template>
<md-editor v-model="text"/>
</template>
<script>
import { ref } from 'vue';
import { MdEditor } from 'md-editor-v3';
export default {
components: {
MdEditor
},
setup() {
const text = ref('# Hello Editor');
return {
text,
}
}
}
</script>
<style>
@import 'md-editor-v3/lib/style.css';
</style>
3、自定義
參考md-editor-v3,文檔比較詳細。可以參考一下。=文章來源地址http://www.zghlxwxcb.cn/news/detail-649539.html
到了這里,關于如何在vue3中加入markdown語法的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!