# 基础用法

通过on-text 获取当前绑定的纯文字

html:
text:
url: http://doubao-web-parent.oss-cn-beijing.aliyuncs.com/resources/text/plain/1646900999990_tiny1646900999145.text
上传内容
<template>
  <div>
    <div>html:{{editorValue}}</div>
    <div>text:{{editorText}}</div>
    <div>url: {{fileUrl}}</div>
    <higher-tinymce
      @on-text="v => editorText = v"
      v-model="editorValue"
      :fileUrl="fileUrl"
      ref="tinymce"
    >
    </higher-tinymce>
    <db-button @click="uploadText">上传内容</db-button>
  </div>
</template>

<script>
export default {
  data() {
    // 数据
    return {
      editorValue: '',
      editorText: '',
      fileUrl: "http://doubao-web-parent.oss-cn-beijing.aliyuncs.com/resources/text/plain/1646900999990_tiny1646900999145.text"
    };
  },
  methods: {
    async uploadText() {
      const url = await this.$refs.tinymce.uploadText()
      this.fileUrl = url
      this.$db_message.success('上传成功!')
    }
  }
};
</script>
Expand Copy

# Attributes

参数 说明 类型 可选值 默认值
value / v-model 绑定值 array
height 高度 Number 500
code_dialog_height 使用代码编辑器高度 Number 450
initialValue 初始值 String -
disabled 禁用 String false
outputFormat 输出类型 String 'text'
code_dialog_width 使用代码编辑器宽度 Number 1000
tinymceId 编辑id String -
apiKey 应用id String bg0i6js34w1uecbu7bq627umowc54ptqg4m9gytn2l6k4ye1
plugins 编辑组装插件 Array ['link lists image code table colorpicker textcolor wordcount contextmenu paste autosave fullscreen save']
toolbar 添加的工具栏 String 'bold italic underline strikethrough| fontsizeselect|forecolor backcolor| alignleft aligncenter alignright alignjustify|bullist numlist|outdent indent blockquote|undo redo|link unlink image code|remove format|save'
menubar 添加的菜单栏 String 'file edit insert view format table'
autosave_interval 自动保存时间 String 30s
autosave_retention 此选项允许您指定持续时间编辑器内容应保留在本地存储中。超过设定时间的内容将被忽略。语法是将字母附加m到数字值的末尾。例如,“20m”持续20分钟。 String 5m
autoSaveName 保存本地缓存自定义 String -
fileUrl 用于回显文件地址 String -

# Methods

方法名 说明 参数
getFileText 获取线上文件内容
getText 获取当前纯文本 -
uploadText 手动上传内容文本