File tree Expand file tree Collapse file tree 4 files changed +54
-2
lines changed Expand file tree Collapse file tree 4 files changed +54
-2
lines changed Original file line number Diff line number Diff line change
1
+ export default {
2
+ mainFile : 'index.html' ,
3
+ ReplOptions : {
4
+ theme : 'dark' ,
5
+ } ,
6
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "imports" : {
3
+ "vue" : " https://unpkg.com/vue@3/dist/vue.esm-browser.js"
4
+ }
5
+ }
Original file line number Diff line number Diff line change
1
+ < script type ="module ">
2
+ import { createApp } from 'vue'
3
+
4
+ // give each todo a unique id
5
+ let id = 0
6
+
7
+ createApp ( {
8
+ data ( ) {
9
+ return {
10
+ newTodo : '' ,
11
+ todos : [
12
+ { id : id ++ , text : 'Learn HTML' } ,
13
+ { id : id ++ , text : 'Learn JavaScript' } ,
14
+ { id : id ++ , text : 'Learn Vue' } ,
15
+ ] ,
16
+ }
17
+ } ,
18
+ methods : {
19
+ addTodo ( ) {
20
+ this . todos . push ( { id : id ++ , text : this . newTodo } )
21
+ this . newTodo = ''
22
+ } ,
23
+ removeTodo ( todo ) {
24
+ this . todos = this . todos . filter ( ( t ) => t !== todo )
25
+ } ,
26
+ } ,
27
+ } ) . mount ( '#app' )
28
+ </ script >
29
+
30
+ < div id ="app ">
31
+ < form @submit.prevent ="addTodo ">
32
+ < input v-model ="newTodo " required placeholder ="new todo " />
33
+ < button > Add Todo</ button >
34
+ </ form >
35
+ < ul >
36
+ < li v-for ="todo in todos " :key ="todo.id ">
37
+ {{ todo.text }}
38
+ < button @click ="removeTodo(todo) "> X</ button >
39
+ </ li >
40
+ </ ul >
41
+ </ div >
Original file line number Diff line number Diff line change 12
12
<script setup lang="ts">
13
13
import { Repl , useStore } from ' ../../src'
14
14
import ScenarioSelector from ' ./ScenarioSelector.vue'
15
- import MonacoEditor from ' ../../src/editor/MonacoEditor .vue'
15
+ import CodeMirrorEditor from ' ../../src/editor/CodeMirrorEditor .vue'
16
16
// @ts-ignore
17
17
import playgroundFiles from ' virtual:playground-files'
18
18
import { ref , computed , watchEffect } from ' vue'
@@ -41,7 +41,7 @@ const store = useStore()
41
41
42
42
const replConfigs = computed (() => ({
43
43
store ,
44
- editor: MonacoEditor ,
44
+ editor: CodeMirrorEditor ,
45
45
editorOptions: {
46
46
autoSaveText: ' 💾' ,
47
47
},
You can’t perform that action at this time.
0 commit comments