File tree Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Expand file tree Collapse file tree 4 files changed +22
-16
lines changed Original file line number Diff line number Diff line change @@ -75,8 +75,8 @@ sfcOptions.script.fs = {
75
75
76
76
store .init ()
77
77
78
- const editorSlotName = computed (() => props .layoutReverse ? ' right' : ' left' )
79
- const outputSlotName = computed (() => props .layoutReverse ? ' left' : ' right' )
78
+ const editorSlotName = computed (() => ( props .layoutReverse ? ' right' : ' left' ) )
79
+ const outputSlotName = computed (() => ( props .layoutReverse ? ' left' : ' right' ) )
80
80
81
81
provide (' store' , store )
82
82
provide (' autoresize' , props .autoResize )
Original file line number Diff line number Diff line change @@ -9,25 +9,14 @@ import {
9
9
} from 'vue/compiler-sfc'
10
10
import { OutputModes } from './output/types'
11
11
import type { editor } from 'monaco-editor-core'
12
+ import welcomeCode from './template/welcome.vue?raw'
13
+ import newFileCode from './template/new-file.vue?raw'
12
14
13
15
const defaultMainFile = 'src/App.vue'
14
16
15
17
export const importMapFile = 'import-map.json'
16
18
export const tsconfigFile = 'tsconfig.json'
17
19
18
- const welcomeCode = `
19
- <script setup>
20
- import { ref } from 'vue'
21
-
22
- const msg = ref('Hello World!')
23
- </script>
24
-
25
- <template>
26
- <h1>{{ msg }}</h1>
27
- <input v-model="msg">
28
- </template>
29
- ` . trim ( )
30
-
31
20
const tsconfig = {
32
21
compilerOptions : {
33
22
allowJs : true ,
@@ -254,7 +243,7 @@ export class ReplStore implements Store {
254
243
addFile ( fileOrFilename : string | File ) : void {
255
244
const file =
256
245
typeof fileOrFilename === 'string'
257
- ? new File ( fileOrFilename )
246
+ ? new File ( fileOrFilename , newFileCode )
258
247
: fileOrFilename
259
248
this . state . files [ file . filename ] = file
260
249
if ( ! file . hidden ) this . setActive ( file . filename )
Original file line number Diff line number Diff line change
1
+ <script setup></script >
2
+
3
+ <template >
4
+ <div >
5
+ <slot />
6
+ </div >
7
+ </template >
Original file line number Diff line number Diff line change
1
+ <script setup>
2
+ import { ref } from ' vue'
3
+
4
+ const msg = ref (' Hello World!' )
5
+ </script >
6
+
7
+ <template >
8
+ <h1 >{{ msg }}</h1 >
9
+ <input v-model =" msg" />
10
+ </template >
You can’t perform that action at this time.
0 commit comments