GrapesJS / mjml

Newsletter Builder with MJML components in GrapesJS
http://grapesjs.com/demo-mjml.html
BSD 3-Clause "New" or "Revised" License
618 stars 218 forks source link

How to add new button configuration options? #319

Closed karlitaviky811 closed 1 year ago

karlitaviky811 commented 1 year ago

How can I add options to the button href? I need to place a dropdown with options (which are urls), but I can't find the way

I got this piece of code, but it doesn't work for me:

editor.getSelected().getTrait('href').set('options', [ { value: 'page1.html', name: 'Page 1' }, ... ])

artf commented 1 year ago

https://grapesjs.com/docs/modules/Traits.html