File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -51,9 +51,13 @@ export class CodeBlock {
5151 return {
5252 view : ( vnode ) => {
5353 return [
54- m ( CodeEditor ) ,
54+ m ( CodeEditor , {
55+ path : vnode . attrs . path ,
56+ workbench : vnode . attrs . workbench ,
57+ } ) ,
5558 m ( CodeEditorOutput , {
5659 output : this . output ,
60+ path : vnode . attrs . path ,
5761 } ) ,
5862 ] ;
5963 } ,
@@ -149,18 +153,13 @@ const CodeEditorOutput = {
149153 attrs : { path } ,
150154 } = vnode ;
151155 const snippet = path . node . getComponent ( CodeBlock ) ;
152- window . hljs . highlightBlock (
153- dom . querySelector ( ".code-editor-output" )
154- ) ;
156+
157+ window . hljs . highlightBlock ( dom ) ;
155158
156159 dom
157160 . querySelector ( "button" )
158161 . addEventListener ( "click" , async ( ) => {
159- snippet . output = await defaultExecutor . execute ( snippet . code , {
160- language : snippet . language ,
161- } ) ;
162- console . log ( snippet . output ) ;
163- vnode . state . output = snippet . output ;
162+ console . log ( snippet ) ;
164163 } ) ;
165164 } ,
166165
You can’t perform that action at this time.
0 commit comments