Fuxi/application/components/problem/preview/program.vue
2023-12-13 21:18:14 +08:00

21 lines
481 B
Vue

<template>
<n-card>
<n-code :hljs="hljs" :language="language" :code="props.answers?.code" />
</n-card>
</template>
<script setup lang="ts">
import { NCard, NCode } from "naive-ui";
import hljs from "highlight.js/lib/core";
import cpp from "highlight.js/lib/languages/cpp";
hljs.registerLanguage("cpp", cpp);
const props = defineProps<{
challenge: any,
problem: any,
answers: any,
}>();
const language = computed(() => props.answers?.language ?? "text");
</script>