跳到主要内容

resize-image

描述

在调整图片大小时触发

用法

"resize-image": ({ id: number, width: number, height: number }) => boolean | void;

参数

resize-image 事件的回调函数可接受一个包含以下参数的对象:

  • id - 图片 ID
  • width - 图片宽度
  • height - 图片高度
信息

如需处理内部事件,您可以使用 Event Bus 方法

示例

// 初始化 RichText
const editor = new richtext.Richtext("#root", {
// 配置属性
});
// 订阅 "resize-image" 事件
editor.api.on("resize-image", (obj) => {
console.log(obj);
console.log("The image was resized")
});

变更日志: 该事件在 v2.0 中新增