Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
984507092 committed Apr 28, 2024
1 parent 2e9c996 commit 1e29c5d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 15 deletions.
20 changes: 10 additions & 10 deletions docs/.vitepress/cache/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
{
"hash": "bc99534b",
"hash": "4dda2dd4",
"configHash": "e528c3da",
"lockfileHash": "e9d3bea4",
"browserHash": "315f7b0a",
"lockfileHash": "cebf1c37",
"browserHash": "88638b1b",
"optimized": {
"vue": {
"src": "../../../../node_modules/.pnpm/[email protected]/node_modules/vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js",
"fileHash": "ebeee3cf",
"fileHash": "7c9a3d28",
"needsInterop": false
},
"vitepress > @vue/devtools-api": {
"src": "../../../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@vue/devtools-api/dist/index.js",
"file": "vitepress___@vue_devtools-api.js",
"fileHash": "b368aa56",
"fileHash": "848adfb9",
"needsInterop": false
},
"vitepress > @vueuse/core": {
"src": "../../../../node_modules/.pnpm/@[email protected][email protected]/node_modules/@vueuse/core/index.mjs",
"file": "vitepress___@vueuse_core.js",
"fileHash": "9341a536",
"fileHash": "cbd27072",
"needsInterop": false
},
"vitepress > @vueuse/integrations/useFocusTrap": {
"src": "../../../../node_modules/.pnpm/@[email protected][email protected][email protected][email protected]/node_modules/@vueuse/integrations/useFocusTrap.mjs",
"file": "vitepress___@vueuse_integrations_useFocusTrap.js",
"fileHash": "31071df7",
"fileHash": "e840df36",
"needsInterop": false
},
"vitepress > mark.js/src/vanilla.js": {
"src": "../../../../node_modules/.pnpm/[email protected]/node_modules/mark.js/src/vanilla.js",
"file": "vitepress___mark__js_src_vanilla__js.js",
"fileHash": "873443c6",
"fileHash": "ddb8acc1",
"needsInterop": false
},
"vitepress > minisearch": {
"src": "../../../../node_modules/.pnpm/[email protected]/node_modules/minisearch/dist/es/index.js",
"file": "vitepress___minisearch.js",
"fileHash": "5fb5012e",
"fileHash": "abf09725",
"needsInterop": false
},
"naive-ui": {
"src": "../../../../node_modules/.pnpm/[email protected][email protected]/node_modules/naive-ui/es/index.mjs",
"file": "naive-ui.js",
"fileHash": "7955e7dc",
"fileHash": "b8c272ce",
"needsInterop": false
}
},
Expand Down
4 changes: 3 additions & 1 deletion docs/common/autoFormatData.data.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
// posts.data.js
import { createContentLoader } from "vitepress";
import dayjs from 'dayjs'

const pages = createContentLoader("view/problem/*.md", {
includeSrc: true, // 包含原始 markdown 源?
includeSrc: false, // 包含原始 markdown 源?
render: false, // 包含渲染的整页 HTML?
excerpt: false, // 包含摘录?
transform(rawData) {
Expand All @@ -19,6 +20,7 @@ const pages = createContentLoader("view/problem/*.md", {
return {
...page,
title: page.url.split('/')[3],
date: dayjs(page.frontmatter.date).format("YYYY-MM-DD"),
};
});
},
Expand Down
19 changes: 15 additions & 4 deletions docs/components/problemRecord/dataList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,29 @@
</div>
<div>
<ul>
<li v-for="(item,index) in page">
<span>{{index + 1}}、</span>
<a :href="item.url">{{item.title}}</a>
<li
class="flex flex-items-center justify-between"
v-for="(item,index) in page"
:key="index"
>
<div>
<span>{{index + 1}}、</span>
<a :href="item.url">{{ item.title }}</a>
</div>
<span class="time-str c-#999">{{ item.date }}</span>
</li>
</ul>
</div>
</div>
</template>

<script setup lang='ts'>
import { ref, reactive } from "vue";
import { ref, reactive, onMounted } from "vue";
import { data as page } from "../../common/autoFormatData.data.mjs";
onMounted(() => {
console.log(page);
});
</script>

<style lang='scss' scoped>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"docs:preview": "vitepress preview docs"
},
"dependencies": {
"dayjs": "^1.11.11",
"vitepress": "^1.1.3",
"vue": "^3.4.25",
"vue-loader": "^17.4.2"
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1e29c5d

Please sign in to comment.