Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbbbbbbbbbbba committed Feb 4, 2024
1 parent 0ffe55e commit 043fd57
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 78 deletions.
3 changes: 1 addition & 2 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"eslint": "^8.56.0",
"nuxt": "^3.10.0",
"sass": "^1.70.0",
"typescript": "^5.3.3",
"vue": "^3.4.15"
"typescript": "^5.3.3"
},
"dependencies": {
"@pinia/nuxt": "^0.5.1",
Expand Down
3 changes: 0 additions & 3 deletions site/pnpm-lock.yaml

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

30 changes: 0 additions & 30 deletions site/src/layouts/topics.vue

This file was deleted.

36 changes: 25 additions & 11 deletions site/src/pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
<template>
<section class="main">
<div class="container main-container left-main size-320">
<div class="left-container">
<div class="main-content no-padding no-bg topics-wrapper">
<div class="topics-nav">
<topics-nav />
</div>
<div class="topics-main">
<load-more-async v-slot="{ results }" url="/api/topic/topics">
<topic-list :topics="results" show-sticky />
</load-more-async>
</div>
</div>
</div>
<div class="right-container">
<check-in />
<site-notice />
<score-rank />
<friend-links />
</div>
</div>
</section>
</template>

<script setup>
definePageMeta({
layout: "topics",
});
useHead({
title: useSiteTitle(),
});
</script>

<template>
<div class="topics-main">
<load-more-async v-slot="{ results }" url="/api/topic/topics">
<topic-list :topics="results" show-sticky />
</load-more-async>
</div>
</template>

<style scoped></style>
30 changes: 22 additions & 8 deletions site/src/pages/topics/index.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
<template>
<div class="topics-main">
<load-more-async v-slot="{ results }" url="/api/topic/topics">
<topic-list :topics="results" show-sticky />
</load-more-async>
</div>
<section class="main">
<div class="container main-container left-main size-320">
<div class="left-container">
<div class="main-content no-padding no-bg topics-wrapper">
<div class="topics-nav">
<topics-nav />
</div>
<div class="topics-main">
<load-more-async v-slot="{ results }" url="/api/topic/topics">
<topic-list :topics="results" show-sticky />
</load-more-async>
</div>
</div>
</div>
<div class="right-container">
<check-in />
<site-notice />
<score-rank />
<friend-links />
</div>
</div>
</section>
</template>

<script setup>
definePageMeta({
layout: "topics",
});
useHead({
title: useSiteTitle("话题"),
});
Expand Down
38 changes: 26 additions & 12 deletions site/src/pages/topics/node/[id].vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,33 @@
<template>
<div class="topics-main">
<load-more-async
v-slot="{ results }"
url="/api/topic/topics"
:params="{ nodeId: nodeId }"
>
<topic-list :topics="results" show-sticky />
</load-more-async>
</div>
<section class="main">
<div class="container main-container left-main size-320">
<div class="left-container">
<div class="main-content no-padding no-bg topics-wrapper">
<div class="topics-nav">
<topics-nav />
</div>
<div class="topics-main">
<load-more-async
v-slot="{ results }"
url="/api/topic/topics"
:params="{ nodeId: nodeId }"
>
<topic-list :topics="results" show-sticky />
</load-more-async>
</div>
</div>
</div>
<div class="right-container">
<check-in />
<site-notice />
<score-rank />
<friend-links />
</div>
</div>
</section>
</template>

<script setup>
definePageMeta({
layout: "topics",
});
const route = useRoute();
let nodeId = Number.parseInt(route.params.id) || 0;
Expand Down
38 changes: 26 additions & 12 deletions site/src/pages/topics/tag/[id].vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
<template>
<div class="topics-main">
<load-more-async
v-slot="{ results }"
url="/api/topic/tag/topics"
:params="{ tagId: tagId }"
>
<topic-list :topics="results" />
</load-more-async>
</div>
<section class="main">
<div class="container main-container left-main size-320">
<div class="left-container">
<div class="main-content no-padding no-bg topics-wrapper">
<div class="topics-nav">
<topics-nav />
</div>
<div class="topics-main">
<load-more-async
v-slot="{ results }"
url="/api/topic/tag/topics"
:params="{ tagId: tagId }"
>
<topic-list :topics="results" />
</load-more-async>
</div>
</div>
</div>
<div class="right-container">
<check-in />
<site-notice />
<score-rank />
<friend-links />
</div>
</div>
</section>
</template>

<script setup>
const route = useRoute();
const tagId = route.params.id;
const { data: tag } = await useAsyncData(() => useMyFetch(`/api/tag/${tagId}`));
definePageMeta({
layout: "topics",
});
useHead({
title: useSiteTitle(tag.value.name, "话题"),
meta: [
Expand Down

0 comments on commit 043fd57

Please sign in to comment.