This commit is contained in:
2024-01-22 12:30:30 +08:00
parent 230cf1bdeb
commit 275f49e54e
3 changed files with 66 additions and 11 deletions

View File

@@ -1,3 +1,18 @@
<script lang="ts" setup>
import {
code,
init,
input,
output,
changeCode,
changeInput,
} from "../composables/code"
import CodeEditor from "../components/CodeEditor.vue"
import { onMounted } from "vue"
onMounted(init)
</script>
<template>
<n-layout-content class="container">
<n-split direction="horizontal" :min="1 / 3" :max="4 / 5">
@@ -5,6 +20,7 @@
<CodeEditor
label="代码区"
v-model="code.value"
@update:model-value="changeCode"
:language="code.language"
/>
</template>
@@ -16,7 +32,11 @@
:max="3 / 5"
>
<template #1>
<CodeEditor label="输入框" v-model="input" />
<CodeEditor
label="输入框"
v-model="input"
@update:model-value="changeInput"
/>
</template>
<template #2>
<CodeEditor label="输出框" v-model="output" readonly />
@@ -26,10 +46,7 @@
</n-split>
</n-layout-content>
</template>
<script lang="ts" setup>
import { code, input, output } from "../composables/code"
import CodeEditor from "../components/CodeEditor.vue"
</script>
<style scoped>
.container {
height: calc(100vh - 60px);