Skip to content

Latest commit

 

History

History
90 lines (75 loc) · 2.2 KB

CHANGELOG.md

File metadata and controls

90 lines (75 loc) · 2.2 KB

1.5.6 - 2022-03-07

  • chore: 更新 wangeditor 版本
  • fix: 包的完整
  • chore: react 依赖调整 (#23)

1.5.3 - 2021-08-23

  • fix: 修复类型应用问题

1.5.2 - 2021-08-20

  • fix: 修复类型定义问题

1.5.1 - 2021-08-08

  • chore: 增加类型声明文件

1.5.0 - 2021-07-05

  • chore: 删除 babel 编译及相关依赖
  • refactor: 重构为 ts
  • feat: 升级 wangeditor 版本
  • doc: 修改官方文档最新地址
  • chore: 增加 lint 规范

1.4.1 - 2021-06-25

  • fix: 修复受控组件强制替换 html 内容
  • chore: 修改脚本

1.4.0 - 2021-06-05

  • feat: 增加钩子方法

1.3.0 - 2021-05-15

  • perf: 更新 wangeditor 版本
  • chore: 自动发布脚本
  • 更新 CHANGELOG

1.2.2 - 2021/05/11

  • feat: 多语言支持
  • feat: 增加销毁方法
  • feat: 支持 onlineVideoCallback 和 linkImgCallback 回调函数
  • doc: 修改了介绍

1.1.3 - 2021/05/08

  • fix: 兼容 v3 版本
  • feat: 容器支持内联样式与样式类
  • feat: 追加 onFous 与 onBlur 事件

1.1.2 - 2021/05/06

  • fix: 设置 localBlobImg 修复无图片时的错误提醒

1.0.1 - 2021/04/27

  • feat: 增加 Blob 本地图片,并在类中提供处理函数 replaceHTMLImgBlobURL
import React from 'react';
import ReactWEditor from 'wangeditor-for-react';

class Demo extends React.Component {
  submit () {
    if (this.editorRef) {
      // 当前曾经添加过所有的图片文件,包括在编辑器中删除的图片,key 是 blob 地址,value 是 File
      const imgs = this.editorRef.imgFile.getAllImgFiles()
      console.log('imgs', imgs)

      // 根据 blob 地址,替换 html 中图片�地址
      const content = this.editorRef.replaceHTMLImgBlobURL(
        '<img src="blob:http://localhost/330f3a67-7be9-4871-8f94-473c45c1f524>',
        file =>
          `/image?filename=${file.lastModified}_${file.name}`,
      )
      console.log('content', content)
    }
  }

  render () {
    return (
    <div>
      <ReactWEditor
        localBlobImg
        ref={ref => this.editorRef = ref}
      />
      <a onClick={this.submit}>submit</a>
    </div>
    )
  }
}