WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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 = {
7575
7676store .init ()
7777
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' ) )
8080
8181provide (' store' , store )
8282provide (' autoresize' , props .autoResize )
Original file line number Diff line number Diff line change @@ -9,25 +9,14 @@ import {
99} from 'vue/compiler-sfc'
1010import { OutputModes } from './output/types'
1111import type { editor } from 'monaco-editor-core'
12+ import welcomeCode from './template/welcome.vue?raw'
13+ import newFileCode from './template/new-file.vue?raw'
1214
1315const defaultMainFile = 'src/App.vue'
1416
1517export const importMapFile = 'import-map.json'
1618export const tsconfigFile = 'tsconfig.json'
1719
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-
3120const tsconfig = {
3221 compilerOptions : {
3322 allowJs : true ,
@@ -254,7 +243,7 @@ export class ReplStore implements Store {
254243 addFile ( fileOrFilename : string | File ) : void {
255244 const file =
256245 typeof fileOrFilename === 'string'
257- ? new File ( fileOrFilename )
246+ ? new File ( fileOrFilename , newFileCode )
258247 : fileOrFilename
259248 this . state . files [ file . filename ] = file
260249 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