How can I add a align buttons to the toolbar in Qu

2019-07-19 04:02发布

I'm trying to add alignment buttons to the Quill editor toolbar.

The toolbar documentation isn't very detailed. It shows how to have a select for the alignment options but I'd like a set of toggle buttons side-by-side. Is this possible?

标签: quill
1条回答
倾城 Initia
2楼-- · 2019-07-19 05:00

You can do align: 'center', similar to the header: 3 example in the docs. Here's a working example: https://codepen.io/anon/pen/PKdEgN

var quill = new Quill('#editor-container', {
  modules: {
    toolbar: [
      [{ align: '' }, { align: 'center' }, { align: 'right' }, { align: 'justify' }]
    ]
  },
  placeholder: 'Compose an epic...',
  theme: 'snow'  // or 'bubble'
});
查看更多
登录 后发表回答