feat: 添加prettier格式化代码

This commit is contained in:
539943419 committed 2024-12-25 19:44:18 +08:00
1 parent 5823d5876b
commit f33e9386cd
81 files changed
+8114 -7395

No files matched your search

+40 -36
View File
@@ -1,24 +1,26 @@
<template>
<n-scrollbar>
<div class="miao-markdown-container-miaomiaomiao" v-html="renderedMarkdown"></div>
<div style="height: 50px; width: 100%;"></div>
</n-scrollbar>
<n-scrollbar>
<div
class="miao-markdown-container-miaomiaomiao"
v-html="renderedMarkdown"
></div>
<div style="height: 50px; width: 100%"></div>
</n-scrollbar>
</template>
<script setup lang="ts">
import { NScrollbar } from 'naive-ui';
import { NScrollbar } from 'naive-ui'
import { VirtualFile } from '@/class/VirtualDirectory'
import { onMounted, ref } from 'vue'
import MarkdownIt from 'markdown-it'
import useMiaoFetchApi from '@/hooks/useMiaoFetchApi';
import useMiaoFetchApi from '@/hooks/useMiaoFetchApi'
const decoder = new TextDecoder('utf-8');
const decoder = new TextDecoder('utf-8')
const miaoFetchApi = useMiaoFetchApi()
const currentFiles = defineModel<VirtualFile[]>('currentFiles', {
required: true
required: true
})
const markdownSrc = ref<string>()
@@ -27,41 +29,43 @@ const renderedMarkdown = ref<string>('')
const md = new MarkdownIt()
onMounted(async () => {
markdownSrc.value = currentFiles.value[0].url
const text = decoder.decode(await(miaoFetchApi.getFile(currentFiles.value[0])).response)
renderedMarkdown.value = md.render(text)
markdownSrc.value = currentFiles.value[0].url
const text = decoder.decode(
await miaoFetchApi.getFile(currentFiles.value[0]).response
)
renderedMarkdown.value = md.render(text)
})
</script>
<style lang="scss">
.miao-markdown-container-miaomiaomiao {
width: 95%;
margin: 20px;
width: 95%;
margin: 20px;
table,
td,
th {
border: 1px solid #ddd;
text-align: left;
}
table,
td,
th {
border: 1px solid #ddd;
text-align: left;
}
table {
border-collapse: collapse;
margin-bottom: 20px;
}
table {
border-collapse: collapse;
margin-bottom: 20px;
}
th,
td {
padding: 15px;
}
th,
td {
padding: 15px;
}
tr:nth-child(even) {
background-color: #f2f2f2
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
th {
background-color: #04AA6D;
color: white;
}
th {
background-color: #04aa6d;
color: white;
}
}
</style>
</style>