Dynamically change Quill toolbar visibility

*爱你&永不变心* 提交于 2019-12-11 01:48:36

问题


I know that on instantiation of a Quill editor, there is a toolbar visibility option. Is there a way that I can change this toolbar visibility dynamically after the editor is instantiated?

options = {
            debug: 'info',
            placeholder: "Place your content here",
            readOnly: false,
            theme: 'snow',
            modules: {
                toolbar: toolbarOptions --> i want to change this property as false at runtime
            },
    };

回答1:


To clarify the option is not just visibility, it's whether to create a toolbar at all or not. A toolbar cannot be added or removed after the editor is initialized. If you just want to control visibility, one option is just to use CSS to show/hide the toolbar.




回答2:


Hello you can use display: none/block too it's working. It will create or delete the element. Show/hide is a bit different i let you find why.



来源:https://stackoverflow.com/questions/44261469/dynamically-change-quill-toolbar-visibility

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!