feat(projects): 添加富文本和markdown编辑器插件及示例页面

This commit is contained in:
Soybean
2021-11-08 22:44:54 +08:00
parent ed90cb8f8e
commit 60c20647a0
14 changed files with 236 additions and 60 deletions

View File

@ -0,0 +1,35 @@
<template>
<div>
<n-card title="富文本插件" class="shadow-sm rounded-16px">
<div ref="domRef"></div>
<template #footer>
<github-link link="https://github.com/wangeditor-team/wangEditor" />
</template>
</n-card>
</div>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { NCard } from 'naive-ui';
import WangEditor from 'wangeditor';
import { GithubLink } from '@/components';
const editor = ref<WangEditor | null>(null);
const domRef = ref<HTMLElement | null>(null);
function renderWangEditor() {
editor.value = new WangEditor(domRef.value);
setEditorConfig();
editor.value.create();
}
function setEditorConfig() {
editor.value!.config.zIndex = 10;
}
onMounted(() => {
renderWangEditor();
});
</script>
<style scoped></style>