File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
front-end/h5/src/components/plugins Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 22 * @Author : ly525
33 * @Date : 2019-11-24 18:51:58
44 * @LastEditors : ly525
5- * @LastEditTime : 2019-11-30 23:01:55
5+ * @LastEditTime : 2020-04-25 11:14:38
66 * @FilePath : /luban-h5/front-end/h5/src/components/plugins/lbp-text.js
77 * @Github : https://github.com/ly525/luban-h5
88 * @Description : luban-h5 text component/plugin
@@ -27,7 +27,13 @@ export default {
2727 border : `${ this . borderWidth } px solid ${ this . borderColor } ` ,
2828 borderRadius : `${ this . borderRadius } px`
2929 }
30- const pureText = < div domPropsInnerHTML = { this . text } class = "ql-editor ql-container" > </ div >
30+ /**
31+ * https://github.com/ly525/luban-h5/issues/155
32+ * 需要给预览模式的文字添加 ql-snow 样式原因:文字样式和文字编辑器(ql-editor)的 theme 有关系
33+ * 比如编辑模式 h1 样式为:.ql-snow .ql-editor h1 {font-size: 2em;}
34+ * 因此预览模式的文字内容也需要加上 div.ql-snow > div.ql-editor 作为wrapper
35+ */
36+ const previewText = < div class = "ql-snow" > < div domPropsInnerHTML = { this . text } class = "ql-editor ql-container" > </ div > </ div >
3137 return (
3238 < div
3339 onDblclick = { e => {
@@ -68,7 +74,7 @@ export default {
6874 } )
6975 } } >
7076 </ quillEditor >
71- : pureText
77+ : previewText
7278 }
7379 </ div >
7480 )
You can’t perform that action at this time.
0 commit comments