<script setup>

import router from '@/router';
import { ref } from 'vue'
import { document } from '@/plugins/api';
import { MdPreview, MdCatalog } from 'md-editor-v3';


const libraryId = parseInt(router.currentRoute.value.params.LibraryId)
const documentId = parseInt(router.currentRoute.value.params.DocumentId)

const docu = ref({
    Title: "",
    Content: ""
})

document.libraryLibraryIdDocumentDocumentIdGet(libraryId, documentId).then((r) => {
    docu.value = r.data

    console.log(r.data)
})


</script>


<template>

    <v-btn @click="router.back(0)">返回</v-btn>

    <h2>{{ docu.Title }}</h2>

    <MdPreview  :modelValue="docu.Content" />

</template>