File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ class TextEditorEmbed {
4646 return this
4747 }
4848
49+ #getEditorComponent( ) {
50+ return this . #vm. $children [ 0 ]
51+ }
52+
4953 onLoaded ( onLoadedCallback = ( ) => { } ) {
5054 this . #vm. $on ( 'ready' , ( ) => {
5155 onLoadedCallback ( )
@@ -84,12 +88,12 @@ class TextEditorEmbed {
8488 // Update reactive prop for MarkdownContentEditor
8589 this . #vm. $set ( this . #data, 'content' , content )
8690 // Call setContent for file based Editor
87- this . #vm . $children [ 0 ] ?. setContent ?. ( content )
91+ this . #getEditorComponent ( ) ?. setContent ?. ( content )
8892 return this
8993 }
9094
9195 async save ( ) {
92- return this . #vm . $children [ 0 ] . save ?. ( )
96+ return this . getEditorComponent ( ) . save ?. ( )
9397 }
9498
9599 setShowOutline ( value ) {
@@ -103,11 +107,11 @@ class TextEditorEmbed {
103107 }
104108
105109 insertAtCursor ( content ) {
106- this . #vm . $children [ 0 ] . $editor . chain ( ) . insertContent ( content ) . focus ( ) . run ( )
110+ this . getEditorComponent ( ) . $editor . chain ( ) . insertContent ( content ) . focus ( ) . run ( )
107111 }
108112
109113 focus ( ) {
110- this . #vm . $children [ 0 ] . $editor . commands . focus ( )
114+ this . getEditorComponent ( ) . $editor . commands . focus ( )
111115 }
112116
113117 #registerDebug( ) {
You can’t perform that action at this time.
0 commit comments