Closed nikhilmate closed 5 years ago
I am also getting really confused about this. For example, how do you decide where to put the html markup, in the block content property or in the component view property? Also in the basic-blocks plugin it defines rows/cells as classes instead of using the default DomC components. Should we be doing that when creating multi-component blocks?
For example, how do you decide where to put the html markup, in the block content property or in the component view property?
It depends, but I highly suggest to adopt more a component-oriented approach, so blocks could only be a mix of already defined components.
Blocks.add('...', {
...
content: {
type: 'component-type-1',
components: [
{ type: 'component-type-2' },
{ type: 'component-type-2', someProp: '...' },
]
}
})
Yeah, after 3-4 re-writes I've managed to get to the approach there, haha. Would it be possible for that snippet to be added to the docs? It's taken a few days of searching through issues to see that it is even possible to pass an array of components to the content property
WARNING
READ and FOLLOW next 5 steps, then REMOVE them before posting the issue
[Bug]: ....
You're submitting a BUG
grapesjs.version
in console and press ENTERYou're submitting a FEATURE REQUEST