# HtEditor 说明

HtEditor 自定义富文本组件,基于tinymce组件实现
Author andy.ten@tom.com & xukaixing@hotmail.com

# 示例

富文本

效果预览
<template>
  <div>
    <h2>富文本</h2>
    <!-- 富文本编辑组件 -->
    <ht-editor ref="myDemoEditor" :content="content" vref="myDemoEditor" @input="handleInput" />
    <div style="padding: 10px;font-size: 16px;font-weight: bolder;">效果预览</div>
    <div style="padding: 10px;" v-html="content" />
  </div>
</template>
<script>
export default {
  data() {
    return {
      content: '',
    }
  },
  methods: {
    /**
     * @todo: input事件响应方法
     * @Date: 2023-02-23 09:48:51
     * @param {*} event
     * @param {*} val
     */
    handleInput(event, val) {
      this.content = val;
    },
  },
};
</script>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Expand Copy

# API

# HtEditor Attributes

参数 说明 类型 可选值 默认值
vref 设置editor的ref属性 String
content 设置富文本内容 String ''
language 设置显示语言 String zh_CN
width 设置富文本输入域宽度 String,Number auto
height 设置富文本输入域高度 String,Number 400
toolbar 设置富文本的工具栏 Array

# Anchor Event

方法名 说明 参数
input 值改变时响应方法 (inputValue)

# 版本

  • v1.0.3