This commit is contained in:
2024-01-21 21:41:31 +08:00
parent 0ea4c14732
commit d940c684ad
6 changed files with 56 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
import { ref } from "vue"
import copyTextToClipboard from "copy-text-to-clipboard"
import { Code } from "../types"
import { Code, LANGUAGE } from "../types"
import { sources } from "../templates"
import { submit } from "../api"
@@ -21,6 +21,11 @@ export function reset() {
output.value = ""
}
export function changeLanguage(language: LANGUAGE) {
code.value.value = sources[language]
output.value = ""
}
export async function run() {
loading.value = true
const cleanCode = code.value.value.trim()