javascriptgrapesjs

Set HTML with style in a GrapesJs component


I use GrapesJs and I want to update the html content of a component.
So I use the components method of a component : cmp.components('<h1 style="text-align:left">Hello</h1>').
But when I retrieve the html content of my component (cmp.toHTML()) the style is not here.


Solution

  • It was an issue with my grapesjs version. I was in 0.21.1 and the problem disappears using 0.21.5.