Browse Source

Up Block doc

pull/4363/head
Artur Arseniev 4 years ago
parent
commit
c512ee25f5
  1. 14
      docs/api/block.md
  2. 4
      src/block_manager/model/Block.js

14
docs/api/block.md

@ -2,8 +2,6 @@
## Block
### Properties
* `label` **[String][1]** Block label, eg. `My block`
@ -17,31 +15,31 @@
* `onClick` **[Function][5]?** Custom behavior on click, eg. `(block, editor) => editor.getWrapper().append(block.get('content'))`
* `attributes` **[Object][2]?** Block attributes to apply in the view element
### getId
## getId
Get block id
Returns **[String][1]**
### getLabel
## getLabel
Get block label
Returns **[String][1]**
### getMedia
## getMedia
Get block media
Returns **[String][1]**
### getContent
## getContent
Get block content
Returns **([Object][2] | [String][1] | [Array][6]<([Object][2] | [String][1])>)** Component definition | HTML string
Returns **([Object][2] | [String][1] | [Array][6]<([Object][2] | [String][1])>)**
### getCategoryLabel
## getCategoryLabel
Get block category label

4
src/block_manager/model/Block.js

@ -12,6 +12,8 @@ import { isFunction } from 'underscore';
* @property {Boolean} [disable=false] Disable the block from being interacted
* @property {Function} [onClick] Custom behavior on click, eg. `(block, editor) => editor.getWrapper().append(block.get('content'))`
* @property {Object} [attributes={}] Block attributes to apply in the view element
*
* @module docsjs.Block
*/
export default class Block extends Model {
defaults() {
@ -55,7 +57,7 @@ export default class Block extends Model {
/**
* Get block content
* @returns {Object|String|Array<Object|String>} Component definition | HTML string
* @returns {Object|String|Array<Object|String>}
*/
getContent() {
return this.get('content');

Loading…
Cancel
Save