GrapesJS / blocks-basic

Basic blocks for the GrapesJS editor
BSD 3-Clause "New" or "Revised" License
76 stars 107 forks source link

Defaults traits for link block #12

Closed MisterFK closed 5 years ago

MisterFK commented 5 years ago

Hi, Is it possible to update a basic-block traits? I try to select by default the option "this window" and delete the other option.

Thanks for your help !

artf commented 5 years ago

You can update any aspect of the block

const linkBlock = editor.BlockManager.get('link');
linkBlock.set({
    content: {
        ...linkBlock.get('content'), // current content
        traits: [...],
    }
})