<template>
  <m-nav-bar class="navbar" title="学车必看" v-if="navbar" />
  <div class="markdown" v-html="markdownHtml"></div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import marked from "marked";
import axios from "axios";
import { useRoute } from "vue-router";
marked.setOptions({
  renderer: new marked.Renderer(),
});
const route = useRoute();
const markdownHtml = ref();
const navbar = route.query.navbar === "false" ? false : true;
axios({
  url: `/markdown/${route.query.markdown}.md`,
}).then((res) => {
  markdownHtml.value = marked(res.data);
});
</script>

<style scoped lang="scss">

.navbar{
    background-color: #ffffff;
}
.markdown{
    font-size: 17px;
    width: 100%;
}
</style>
