first commit

This commit is contained in:
2024-01-21 20:48:03 +08:00
commit c4bdcac452
28 changed files with 7707 additions and 0 deletions

53
src/desktop/Header.vue Normal file
View File

@@ -0,0 +1,53 @@
<script setup lang="ts">
import type { SelectOption } from "naive-ui"
import { useDark, useToggle } from "@vueuse/core"
import Play from "../icons/Play.vue"
import { copy, reset, run, loading } from "../composables/code"
const isDark = useDark()
const toggleDark = useToggle(isDark)
const languages: SelectOption[] = [
{ value: "c", label: "C" },
{ value: "python", label: "Python" },
{ value: "cpp", label: "C++" },
{ value: "java", label: "Java" },
]
</script>
<template>
<n-layout-header bordered class="header">
<n-flex justify="space-between" align="center">
<div class="title">徐越的自测猫</div>
<n-flex>
<n-button @click="toggleDark()">
{{ isDark ? "浅色" : "深色" }}
</n-button>
<n-button @click="reset">重置</n-button>
<n-button @click="copy">复制</n-button>
<n-select class="select" :options="languages"></n-select>
<n-button type="primary" @click="run" :loading="loading">
<template #icon>
<n-icon>
<Play />
</n-icon>
</template>
运行 (F5)
</n-button>
</n-flex>
</n-flex>
</n-layout-header>
</template>
<style scoped>
.header {
height: 60px;
padding: 12px;
}
.title {
font-size: 20px;
}
.select {
width: 100px;
}
</style>