1、首先需要安裝 md-editor-v3
yarn add md-editor-v3
或者是在vue圖形化界面中直接搜索 md-editor-v3 進行安裝。
2、引入該編輯頁
引入可以參考這個,根據自己的需求進行修改和添加。
<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,文檔比較詳細。可以參考一下。=