This commit is contained in:
2024-01-25 09:41:31 +08:00
parent 09e970245c
commit 28536af48b
5 changed files with 68 additions and 26 deletions

View File

@@ -24,7 +24,7 @@ export const code = reactive<Code>({
export const input = ref(cache.input.value)
export const output = ref("")
export const status = ref(Status.NotStarted)
export const loading = ref(false)
export const loading = ref(!code.value)
export const size = ref(cache.fontsize)
watch(size, (value: number) => {
@@ -45,7 +45,7 @@ watch(
() => code.value,
(value: string) => {
cache.code[code.language].value = value
if (!code.value) loading.value = true
loading.value = !value
},
)

View File

@@ -1,3 +1,33 @@
import { ref } from "vue"
export const insertText = ref("")
export const cTexts = [
",",
";",
"printf();",
"{\n}",
"int",
"%d",
"if () ",
" else ",
]
export const pythonTexts = [
":",
'""',
" = ",
" == ",
" > ",
" < ",
" != ",
"print()",
"input()",
"if ",
"else:",
"elif ",
"for ",
" in ",
"range():",
"while",
]