Skip to content

Commit

Permalink
Merge pull request #79 from MarleneJiang/issue-54-新增文章列表
Browse files Browse the repository at this point in the history
Issue 54 新增文章列表
  • Loading branch information
MarleneJiang committed Jan 25, 2023
2 parents bc7024a + f02843f commit 59098f7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 103 deletions.
8 changes: 4 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// "prettier.enable": false,
"editor.codeActionsOnSave": {
// "source.fixAll": true
"source.fixAll": true
},
"files.associations": {
"*.css": "postcss"
Expand All @@ -23,9 +23,9 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
}
}
Binary file modified backend/.tmp/data.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
},
"x-generation-date": "2023-01-25T04:39:01.335Z"
"x-generation-date": "2023-01-25T11:25:51.172Z"
},
"x-strapi-config": {
"path": "/documentation",
Expand Down
36 changes: 11 additions & 25 deletions frontend/components/Articles/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const artModeHandler = (mode: string) => {
artlistNav.value = mode
const allEl = document.querySelectorAll('.navlist') as unknown as HTMLElement[]
allEl.forEach((item) => {
item.style.color = '#6b7280'
item.classList.remove('text-active')
})
const el = document.getElementById(mode) as unknown as HTMLElement
if (el.style)
el.style.color = 'deepskyblue'
el.classList.add('text-active')
artlistData.value = []
// TODO: 请求数据
artlistData.value = initialItem
Expand All @@ -49,34 +49,17 @@ onUnmounted(() => {
<div class="all-text-black pb-5 box-border w-full">
<div class="flex" style="font-size: 13.67px;" border-b-1>
<ul all-px-7 all-my-4 flex all-cursor-pointer all-text-gray-500>
<li id="recommend" class="text-blue navlist border-r-1" @click="artModeHandler('recommend')">
<li id="recommend" class=" text-blue-600 navlist border-r-1 hover:text-[#007fff]" @click="artModeHandler('recommend')">
推荐
</li>
<li id="latest" class="navlist border-r-1" @click="artModeHandler('latest')">
<li id="latest" class="navlist border-r-1 hover:text-[#007fff]" @click="artModeHandler('latest')">
最新
</li>
<li id="hot" class="navlist" @click="artModeHandler('hot')">
<li id="hot" class="navlist hover:text-[#007fff]" @click="artModeHandler('hot')">
热榜
</li>
</ul>
<!-- <select
v-if="artlistNav === 'hot'" v-model="hotRange" class="text-2 px-2 border-1"
@change="hotRangeHandler"
>
<option class="" :value="24 * 60 * 60 * 1000 * 3">
3天内
</option>
<option class="" :value="24 * 60 * 60 * 1000 * 7">
7天内
</option>
<option class="" :value="24 * 60 * 60 * 1000 * 30">
30天内
</option>
<option value="all">
全部
</option>
</select> -->
<UnoSelect class="" />
<UnoSelect v-if="artlistNav === 'hot'" class="" />
</div>
<ul v-if="!isLoading && initialItem">
<ArticlesItem
Expand All @@ -91,7 +74,10 @@ onUnmounted(() => {
</template>

<style scoped>
li:hover {
color: deepskyblue!important;
#recommend {
color: #007fff;
}
.text-active {
@apply text-[#007fff]
}
</style>
2 changes: 1 addition & 1 deletion frontend/components/Uno/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const isShow = ref(false)
<div class="drop-down dorp-down">
<li class="dropdown-toggle flex items-center justify-between" @click="isShow = !isShow">
7天内
<div class=" text-[#b2bac2]" i-carbon:caret-up :class="!!isShow ? 'toggled' : ''" style="transition: all .5s;" />
<div class=" text-[#b2bac2]" i-carbon:caret-up :class="!isShow ? 'toggled' : ''" style="transition: all .5s;" />
</li> <ul v-if="isShow" class="dropdown-menu">
<li class="route-active">
<a href="/?sort=three_days_hottest">3天内</a>
Expand Down
72 changes: 0 additions & 72 deletions frontend/composables/useFetchPostData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,78 +101,6 @@ export default async (/* mode = 'recommend' | 'latest' | 'heat' , pagenum = 1,
desc: '在开发中,不论是一个团队一起开发一个项目,还是自己独立开发一个项目。都少不了',
topicHeat: [2022, 26, 6],
},
{
uname: 'OrzR3',
duration: '2月',
tags: ['后端', 'Go', '前端'],
title: 'Go 语言中的 Gin 框架',
desc: 'Go 语言中的 gin 框架简易上手指南,初始化安装,加载静态资源和页面,以及表单提交Go 语言中的 gin 框架简易上手指南,初始化安装,加载静态资源和页面,以及表单提交',
topicHeat: [3182, 22, 6],
},
{
uname: 'xj',
duration: '2月',
tags: ['Vue.js', 'arco design', 'koa'],
title: '帮朋友搭建后台管理系统',
desc: '对,还是那位朋友,一位接近40的澳洲老哥,找我帮忙搞一个管理后台,他刚找到编程',
topicHeat: [15000, 276, 45],
},
{
uname: 'sx',
duration: '8天',
tags: ['前端', '后端'],
title: '如何打造一个优雅的git工作流',
desc: '在开发中,不论是一个团队一起开发一个项目,还是自己独立开发一个项目。都少不了',
topicHeat: [2022, 26, 6],
},
{
uname: 'OrzR3',
duration: '2月',
tags: ['后端', 'Go', '前端'],
title: 'Go 语言中的 Gin 框架',
desc: 'Go 语言中的 gin 框架简易上手指南,初始化安装,加载静态资源和页面,以及表单提交Go 语言中的 gin 框架简易上手指南,初始化安装,加载静态资源和页面,以及表单提交',
topicHeat: [3182, 22, 6],
},
{
uname: 'xj',
duration: '2月',
tags: ['Vue.js', 'arco design', 'koa'],
title: '帮朋友搭建后台管理系统',
desc: '对,还是那位朋友,一位接近40的澳洲老哥,找我帮忙搞一个管理后台,他刚找到编程',
topicHeat: [15000, 276, 45],
},
{
uname: 'sx',
duration: '8天',
tags: ['前端', '后端'],
title: '如何打造一个优雅的git工作流',
desc: '在开发中,不论是一个团队一起开发一个项目,还是自己独立开发一个项目。都少不了',
topicHeat: [2022, 26, 6],
},
{
uname: 'OrzR3',
duration: '2月',
tags: ['后端', 'Go', '前端'],
title: 'Go 语言中的 Gin 框架',
desc: 'Go 语言中的 gin 框架简易上手指南,初始化安装,加载静态资源和页面,以及表单提交Go 语言中的 gin 框架简易上手指南,初始化安装,加载静态资源和页面,以及表单提交',
topicHeat: [3182, 22, 6],
},
{
uname: 'xj',
duration: '2月',
tags: ['Vue.js', 'arco design', 'koa'],
title: '帮朋友搭建后台管理系统',
desc: '对,还是那位朋友,一位接近40的澳洲老哥,找我帮忙搞一个管理后台,他刚找到编程',
topicHeat: [15000, 276, 45],
},
{
uname: 'sx',
duration: '8天',
tags: ['前端', '后端'],
title: '如何打造一个优雅的git工作流',
desc: '在开发中,不论是一个团队一起开发一个项目,还是自己独立开发一个项目。都少不了',
topicHeat: [2022, 26, 6],
},
]
// 数据内容
postData.push(...value)
Expand Down

1 comment on commit 59098f7

@vercel
Copy link

@vercel vercel bot commented on 59098f7 Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.