Commit fc8ffc4 1 parent be68bae commit fc8ffc4 Copy full SHA for fc8ffc4
File tree 1 file changed +9
-3
lines changed
front-end/h5/src/components/plugins
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 2
2
* @Author : ly525
3
3
* @Date : 2019-11-24 18:51:58
4
4
* @LastEditors : ly525
5
- * @LastEditTime : 2019-11-30 23:01:55
5
+ * @LastEditTime : 2020-04-25 11:14:38
6
6
* @FilePath : /luban-h5/front-end/h5/src/components/plugins/lbp-text.js
7
7
* @Github : https://github.com/ly525/luban-h5
8
8
* @Description : luban-h5 text component/plugin
@@ -27,7 +27,13 @@ export default {
27
27
border : `${ this . borderWidth } px solid ${ this . borderColor } ` ,
28
28
borderRadius : `${ this . borderRadius } px`
29
29
}
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 >
31
37
return (
32
38
< div
33
39
onDblclick = { e => {
@@ -68,7 +74,7 @@ export default {
68
74
} )
69
75
} } >
70
76
</ quillEditor >
71
- : pureText
77
+ : previewText
72
78
}
73
79
</ div >
74
80
)
You can’t perform that action at this time.
0 commit comments