simple image
1.0.0
为编辑器提供图像块。
仅与粘贴的图像URL一起使用,并且不需要服务器端上传器。

获取包裹
yarn add @editorjs/simple-image在您的应用程序中包括模块
import SimpleImage from "@editorjs/simple-image" ;可选,您可以从CDN JSDELIVR CDN加载此工具
将新工具添加到editor.js初始配置的tools属性中。
var editor = EditorJS ( {
...
tools : {
...
image : SimpleImage ,
}
. . .
} ) ; 该工具没有配置参数
添加边框
伸展到全宽
添加背景
| 场地 | 类型 | 描述 |
|---|---|---|
| URL | string | 图像的URL |
| 标题 | string | 图像的标题 |
| 使用BORDE | boolean | 将边框添加到图像 |
| 堆放 | boolean | 需要添加背景 |
| 拉伸 | boolean | 将图像拉伸到屏幕的宽度 |
{
"type" : " image " ,
"data" : {
"url" : " https://www.tesla.com/tesla_theme/assets/img/_vehicle_redesign/roadster_and_semi/roadster/hero.jpg " ,
"caption" : " Roadster // tesla.com " ,
"withBorder" : false ,
"withBackground" : false ,
"stretched" : true
}
}