Skip to content

富文本编辑器

使用 TinyMCE 作为富文本编辑器。

导入使用

typescript
import { Tinymce } from '#/components/tinymce';

基本使用

vue
<template>
  <Tinymce v-model="content" :height="400" />
</template>

配置项

属性说明类型默认值
v-model绑定值string-
height高度number400
width宽度string | numberauto
optionsTinyMCE 配置object{}
plugins插件列表string[]默认插件
toolbar工具栏配置string[]默认工具栏
showImageUpload显示图片上传booleantrue

只读模式

vue
<Tinymce v-model="content" :options="{ readonly: true }" />

注意事项

  • 默认支持图片上传(点击、粘贴、拖拽)
  • 使用本地自托管模式,打包文件较大
  • 如需 CDN 模式,请修改 editor.vue 中的 tinymceScriptSrc

相关文档

贡献者

The avatar of contributor named as dubai dubai

页面历史

基于 MIT 许可发布.