File tree Expand file tree Collapse file tree 3 files changed +64
-1
lines changed Expand file tree Collapse file tree 3 files changed +64
-1
lines changed Original file line number Diff line number Diff line change 31
31
"vue-ls" : " ^3.2.0" ,
32
32
"vue-router" : " ^3.0.1" ,
33
33
"vue-svg-component-runtime" : " ^1.0.1" ,
34
- "vuex" : " ^3.1.0"
34
+ "vuex" : " ^3.1.0" ,
35
+ "wangeditor" : " ^3.1.1"
35
36
},
36
37
"devDependencies" : {
37
38
"@babel/polyfill" : " ^7.2.5" ,
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div :class =" prefixCls" >
3
+ <div ref =" editor" class =" editor-wrapper" ></div >
4
+ </div >
5
+ </template >
6
+
7
+ <script >
8
+ import WEditor from ' wangeditor'
9
+
10
+ export default {
11
+ name: ' WangEditor' ,
12
+ props: {
13
+ prefixCls: {
14
+ type: String ,
15
+ default: ' ant-editor-wang'
16
+ },
17
+ // eslint-disable-next-line
18
+ value: {
19
+ type: String
20
+ }
21
+ },
22
+ data () {
23
+ return {
24
+ editor: null ,
25
+ editorContent: null
26
+ }
27
+ },
28
+ watch: {
29
+ value (val ) {
30
+ this .editorContent = val
31
+ this .editor .txt .html (val)
32
+ }
33
+ },
34
+ mounted () {
35
+ this .initEditor ()
36
+ },
37
+ methods: {
38
+ initEditor () {
39
+ this .editor = new WEditor (this .$refs .editor )
40
+ // this.editor.onchangeTimeout = 200
41
+ this .editor .customConfig .onchange = (html ) => {
42
+ this .editorContent = html
43
+ this .$emit (' change' , this .editorContent )
44
+ }
45
+ this .editor .create ()
46
+ }
47
+ }
48
+ }
49
+ </script >
50
+
51
+ <style lang="less" scoped>
52
+ .ant-editor-wang {
53
+ .editor-wrapper {
54
+ text-align : left ;
55
+ }
56
+ }
57
+ </style >
Original file line number Diff line number Diff line change @@ -10548,6 +10548,11 @@ walker@~1.0.5:
10548
10548
dependencies :
10549
10549
makeerror "1.0.x"
10550
10550
10551
+ wangeditor@^3.1.1 :
10552
+ version "3.1.1"
10553
+ resolved "https://registry.npm.taobao.org/wangeditor/download/wangeditor-3.1.1.tgz#fbd3c1d4976923c9edebb85b29d30b35512ad039"
10554
+ integrity sha1-+9PB1JdpI8nt67hbKdMLNVEq0Dk=
10555
+
10551
10556
warning@^3.0.0 :
10552
10557
version "3.0.0"
10553
10558
resolved "https://registry.yarnpkg.com/warning/-/warning-3.0.0.tgz#32e5377cb572de4ab04753bdf8821c01ed605b7c"
You can’t perform that action at this time.
0 commit comments