This repository was archived by the owner on Apr 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change 2
2
<div ref =" tuiEditorViewer" ></div >
3
3
</template >
4
4
<script >
5
- import Viewer from " tui-editor/dist/tui-editor-Viewer " ;
5
+ import Editor from " tui-editor" ;
6
6
7
7
import editorEvents from " ./editorEvents" ;
8
8
9
9
export default {
10
10
name: " TuiEditorViewer" ,
11
11
props: {
12
12
height: {
13
- type: String ,
14
- default: " 300px"
13
+ type: String
15
14
},
16
15
value: {
17
- type: String ,
18
- default: " "
16
+ type: String
17
+ },
18
+ exts: {
19
+ type: Array
19
20
}
20
21
},
21
22
data () {
@@ -38,18 +39,29 @@ export default {
38
39
};
39
40
});
40
41
41
- this .editor = new Viewer ({
42
+ this .editor = Editor . factory ({
42
43
el: this .$refs .tuiEditorViewer ,
43
44
events: eventOption,
44
45
initialValue: this .value ,
45
- height: this .height
46
+ height: this .height ,
47
+ viewer: true
46
48
});
47
49
},
48
50
destroyed () {
49
51
editorEvents .forEach (event => {
50
52
this .editor .off (event );
51
53
});
52
54
this .editor .remove ();
55
+ },
56
+ methods: {
57
+ invoke (methodName , ... args ) {
58
+ let result = null ;
59
+ if (this .editor [methodName]) {
60
+ result = this .editor [methodName](... args);
61
+ }
62
+
63
+ return result;
64
+ }
53
65
}
54
66
};
55
67
</script >
You can’t perform that action at this time.
0 commit comments