vue-quill-editor
vue-quill-editor copied to clipboard
请问,空格和缩进,保存后不生效,这么解决?
style="white-space:pre" 试试这个看看
同求方案,中文首行锁进怎么解决啊!!!!!!!
https://cdn.quilljs.com/1.0.0-beta.9/quill.bubble.css
在style 样式里面添加一个white-space:pre 就行了,浏览器默认空白是会被去除掉的,这个样式就是把空白替换成pre
white-space: pre-wrap
try to replace the content before rendering
html.replace(/\s/g, ' ')
ql-editor: { white-space: normal!important; } // 解决空格被合并问题 ql-container: {white-space: pre-wrap!important; } // 解决回显时空格减半问题
导出的html 在使用时( v_html )需要注意: 1、添加 class="ql-editor" // 保持和 富文本编辑器中的样式一致 2、white-space: pre-wrap // 设置空格的显示 可参考示例:https://www.yuque.com/u177061/skzsvt/tb2oih
try to replace the content before rendering
html.replace(/\s/g, ' ')
这样可以但是会把标签属性中间的空格也替换掉。。。<p class="">
解决了。。。按照上面那个加上CSS属性返回的空格就被替换了
ql-editor: { white-space: normal!important; } // 解决空格被合并问题 ql-container: {white-space: pre-wrap!important; } // 解决回显时空格减半问题
导出的html 在使用时( v_html )需要注意: 1、添加 class="ql-editor" // 保持和 富文本编辑器中的样式一致 2、white-space: pre-wrap // 设置空格的显示 可参考示例:https://www.yuque.com/u177061/skzsvt/tb2oih
按照你这个办法确实可以解决 但是只能输入空格 不能用tab了