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
}
}