Fuxi/application/components/problem/preview/program.vue

21 lines
481 B
Vue
Raw Normal View History

2023-12-13 13:18:14 +00:00
<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>