grapesjs
grapesjs copied to clipboard
insert element or block inside parent element
Good day, i have component, have block
editor.BlockManager.add("bootstrap-container", {
attributes: {class: "gjs-fonts gjs-f-b1 gjs-block gjs-one-bg gjs-four-color-h"},
category: "test",
label: "Test",
content: '<div class="container" style="min-height:10px;"></div>'
});
i have Trait on listen changes, how can I add "h1 " inside that block "'<div class="container" style="min-height:10px;"></div>".
How to add tag inside this model
like:
doStuff(){
var coll = this.collection;
var at = coll.indexOf(this)
coll.add('<h1>Hello world</h1>', { at });
}
Given the current model you can add other components in this way model.components('<h1>Hello world</h1>')
@vladbpython hi,do you solve this problem?i also want to know how to drag one element into parent element.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.