kid*_*tal 14 javascript rte richtext quill
我无法弄清楚如何让图像像http://quilljs.com/上的示例一样工作.
我尝试添加<span title="Image" class="ql-format-button ql-image"></span>到工具栏,添加按钮,但点击按钮什么都不做,我在文档中找不到任何内容.有什么建议吗?
Chr*_*kes 14
更新的答案
从版本1.0及更高版本开始,您不再需要添加默认包含的工具提示模块.如何启用它的一个例子就是这个.
<script>
var toolbarOptions = [
['bold', 'italic', 'underline', 'strike'], // toggled buttons
['blockquote', 'code-block'],
[{ 'header': 1 }, { 'header': 2 }], // custom button values
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
[{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript
[{ 'indent': '-1'}, { 'indent': '+1' }], // outdent/indent
[{ 'direction': 'rtl' }], // text direction
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[ 'link', 'image', 'video', 'formula' ], // add's image support
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
[{ 'font': [] }],
[{ 'align': [] }],
['clean'] // remove formatting button
];
var quill = new Quill('#editor', {
modules: {
toolbar: toolbarOptions
},
theme: 'snow'
});
</script>
Run Code Online (Sandbox Code Playgroud)
jhc*_*hen 10
编辑:从1.0开始不再准确.克里斯霍克斯的回答是正确的.
遗憾的是,这似乎没有在任何地方记录,但您需要包含image-tooltip模块.例如,这是quilljs.com主页上的编辑器使用的内容:
quill = new Quill('#editor', {
modules: {
'toolbar': { container: '#toolbar' },
'image-tooltip': true,
'link-tooltip': true
},
theme: 'snow'
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15914 次 |
| 最近记录: |