Skip to content

Commit 0217252

Browse files
committed
refactor: add literal types
1 parent c7ddf12 commit 0217252

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Repl.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface Props {
1414
showImportMap?: boolean
1515
clearConsole?: boolean
1616
sfcOptions?: SFCOptions
17-
layout?: string
17+
layout?: 'horizontal' | 'vertical'
1818
ssr?: boolean
1919
previewOptions?: {
2020
headHTML?: string
@@ -38,9 +38,9 @@ const props = withDefaults(defineProps<Props>(), {
3838
bodyHTML: '',
3939
customCode: {
4040
importCode: '',
41-
useCode: ''
42-
}
43-
})
41+
useCode: '',
42+
},
43+
}),
4444
})
4545
4646
if (!props.editor) {
@@ -61,7 +61,7 @@ sfcOptions.script.fs = {
6161
readFile(file: string) {
6262
if (file.startsWith('/')) file = file.slice(1)
6363
return store.state.files[file].code
64-
}
64+
},
6565
}
6666
6767
store.init()

src/SplitPane.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ref, reactive, computed, inject } from 'vue'
33
import { Store } from './store'
44
5-
const props = defineProps<{ layout?: string }>()
5+
const props = defineProps<{ layout?: 'horizontal' | 'vertical' }>()
66
const isVertical = computed(() => props.layout === 'vertical')
77
88
const container = ref()
@@ -13,10 +13,10 @@ const showOutput = ref(store.initialShowOutput)
1313
1414
const state = reactive({
1515
dragging: false,
16-
split: 50
16+
split: 50,
1717
})
1818
19-
const boundSplit = computed(()=>{
19+
const boundSplit = computed(() => {
2020
const { split } = state
2121
return split < 20 ? 20 : split > 80 ? 80 : split
2222
})
@@ -53,7 +53,7 @@ function dragEnd() {
5353
:class="{
5454
dragging: state.dragging,
5555
'show-output': showOutput,
56-
vertical: isVertical
56+
vertical: isVertical,
5757
}"
5858
@mousemove="dragMove"
5959
@mouseup="dragEnd"

0 commit comments

Comments
 (0)