相册
加载此插件,编辑器中插入的图片可以相册查看。
对应 js 文件
shimo.sdk.document.plugins.gallery.min.js
暴露对象shimo.sdk.document.plugins.Gallery
构造函数
- 用法
const Editor = window.shimo.sdk.document.Editor
const Gallery = window.shimo.sdk.document.plugins.Gallery
const editor = new Editor()
const gallery = new Gallery({
editor,
genDownloadUrl(url) {
// 以下为简单的举例,无实际意义
return `http://image.example.com/download?url=${url}`
}
})
editor.render(...)
gallery.render()
- 参数
名称 | 类型 | 默认值 | 描述 |
---|---|---|---|
editor | Editor | 必选 | 编辑器实例 |
genDownloadUrl | Function | 可选 | 自定义相册下载按钮的实际链接 |
方法列表
render
渲染初始化。
- 返回
undefined
- 用法
gallery.render()
destroy
使用完销毁。
- 返回
undefined
- 用法
gallery.destroy()