Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
inscode
NodeJS_639770
提交
630264bf
N
NodeJS_639770
项目概览
inscode
/
NodeJS_639770
与 Fork 源项目一致
Fork自
inscode / NodeJS
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
NodeJS_639770
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
630264bf
编写于
6月 07, 2024
作者:
View Design
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
移动端主题
上级
9050eb61
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
49 addition
and
9 deletion
+49
-9
components/i/library/Header.vue
components/i/library/Header.vue
+25
-2
components/i/library/Thread.vue
components/i/library/Thread.vue
+2
-2
pages/library/index.vue
pages/library/index.vue
+22
-5
未找到文件。
components/i/library/Header.vue
浏览文件 @
630264bf
<
template
>
<
template
>
<div
class=
"flex flex-col w-full items-center sticky top-0 bg-white dark:bg-black z-10"
>
<div
class=
"flex flex-col w-full items-center sticky top-0 bg-white dark:bg-black z-10"
>
<div
class=
"container max-w-screen-lg flex flex-col p-6"
>
<div
class=
"container max-w-screen-lg
2xl:max-w-screen-xl
flex flex-col p-6"
>
<div
class=
"flex justify-between items-center"
>
<div
class=
"flex justify-between items-center"
>
<div
class=
"flex gap-4"
>
<div
class=
"flex gap-4"
>
<div
class=
"flex items-center text-xl gap-2"
v-if=
"!collect"
>
<div
class=
"flex items-center text-xl gap-2"
v-if=
"!collect"
>
...
@@ -52,6 +52,9 @@
...
@@ -52,6 +52,9 @@
<div
v-if=
"description"
class=
"text-gray-500 ml-12 mt-2"
>
{{ description }}
</div>
<div
v-if=
"description"
class=
"text-gray-500 ml-12 mt-2"
>
{{ description }}
</div>
</div>
</div>
<UDivider
/>
<UDivider
/>
<div
v-if=
"showTabs"
class=
"w-full p-6 block lg:hidden"
>
<UTabs
:model-value=
"tab"
@
update:modelValue=
"handleChangeTab"
:items=
"tabs"
/>
</div>
</div>
</div>
</template>
</template>
<
script
setup
>
<
script
setup
>
...
@@ -71,9 +74,17 @@ defineProps({
...
@@ -71,9 +74,17 @@ defineProps({
collectId
:
{
collectId
:
{
type
:
[
String
,
Number
],
type
:
[
String
,
Number
],
default
:
''
default
:
''
},
showTabs
:
{
type
:
Boolean
,
default
:
false
},
tab
:
{
type
:
Number
,
default
:
0
}
}
})
})
const
emit
=
defineEmits
([
'
search
'
,
'
clear
'
])
const
emit
=
defineEmits
([
'
search
'
,
'
clear
'
,
'
change-tab
'
])
const
searchQuery
=
ref
(
''
)
const
searchQuery
=
ref
(
''
)
const
searchLoading
=
ref
(
false
)
const
searchLoading
=
ref
(
false
)
defineShortcuts
({
defineShortcuts
({
...
@@ -91,4 +102,16 @@ function handleClear () {
...
@@ -91,4 +102,16 @@ function handleClear () {
searchQuery
.
value
=
''
searchQuery
.
value
=
''
emit
(
'
clear
'
)
emit
(
'
clear
'
)
}
}
const
tabs
=
[
{
label
:
'
全部主题
'
,
icon
:
'
i-heroicons-square-3-stack-3d
'
},
{
label
:
'
合集
'
}
]
function
handleChangeTab
(
index
)
{
emit
(
'
change-tab
'
,
index
)
}
</
script
>
</
script
>
components/i/library/Thread.vue
浏览文件 @
630264bf
<
template
>
<
template
>
<ULink
:to=
"`/search/$
{thread.c_id}`" class="flex flex-col group">
<ULink
:to=
"`/search/$
{thread.c_id}`" class="flex flex-col group">
<div
class=
"flex items-center gap-2 transition group-hover:text-primary"
>
{{
thread
.
title
}}
</div>
<div
class=
"flex items-center gap-2 transition group-hover:text-primary"
>
{{
thread
.
title
}}
</div>
<div
class=
"break-word text-balance line-clamp-2 font-sans text-sm"
:class=
"textColor"
>
<div
class=
"break-word text-balance line-clamp-2 font-sans text-sm"
:class=
"textColor"
v-if=
"false"
>
{{
thread
.
description
||
'
待补充
'
}}
{{
thread
.
description
}}
</div>
</div>
</ULink>
</ULink>
<div
class=
"flex justify-between items-center"
>
<div
class=
"flex justify-between items-center"
>
...
...
pages/library/index.vue
浏览文件 @
630264bf
<
template
>
<
template
>
<div
class=
"w-full items-center flex flex-col"
>
<div
class=
"w-full items-center flex flex-col"
>
<ILibraryHeader
@
search=
"handleSearch"
@
clear=
"getThreadData"
/>
<ILibraryHeader
show-tabs
:tab=
"tab"
@
change-tab=
"handleChangeTab"
@
search=
"handleSearch"
@
clear=
"getThreadData"
/>
<div
class=
"container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6"
>
<div
class=
"container max-w-screen-lg 2xl:max-w-screen-xl flex flex-col p-6
pt-0 lg:pt-6
"
>
<div
class=
"flex gap-10"
>
<div
class=
"flex gap-10"
v-show=
"ready"
>
<div
class=
"flex flex-col flex-grow"
>
<div
class=
"flex flex-col flex-grow"
v-show=
"tab === 0 || tab === -1"
>
<div
v-auto-animate
class=
"flex flex-col gap-4"
>
<div
v-auto-animate
class=
"flex flex-col gap-4"
>
<ILibraryThread
<ILibraryThread
v-for=
"item in threads"
v-for=
"item in threads"
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<IEmpty
v-if=
"!threads.length"
/>
<IEmpty
v-if=
"!threads.length"
/>
</div>
</div>
</div>
</div>
<div
class=
"flex flex-col flex-shrink-0 w-
56
"
>
<div
class=
"flex flex-col flex-shrink-0 w-
full lg:w-56"
v-show=
"tab === 1 || tab === -1
"
>
<div
class=
"flex justify-between items-center"
>
<div
class=
"flex justify-between items-center"
>
<div
class=
"flex items-center text-lg gap-2"
>
<div
class=
"flex items-center text-lg gap-2"
>
<UIcon
name=
"i-heroicons-squares-2x2"
/>
<UIcon
name=
"i-heroicons-squares-2x2"
/>
...
@@ -39,6 +39,8 @@
...
@@ -39,6 +39,8 @@
</div>
</div>
</
template
>
</
template
>
<
script
setup
>
<
script
setup
>
import
{
LG
}
from
'
~/composables/useMQ.js
'
;
const
{
$collection
}
=
storeToRefs
(
useLibraryStore
())
const
{
$collection
}
=
storeToRefs
(
useLibraryStore
())
const
{
$openLibraryCreate
,
$getCollection
}
=
useLibraryStore
()
const
{
$openLibraryCreate
,
$getCollection
}
=
useLibraryStore
()
const
{
getThreadsList
}
=
useLibraryRequest
()
const
{
getThreadsList
}
=
useLibraryRequest
()
...
@@ -61,6 +63,21 @@ function handleDeletedThread (c_id) {
...
@@ -61,6 +63,21 @@ function handleDeletedThread (c_id) {
function
handleSearch
(
data
)
{
function
handleSearch
(
data
)
{
threads
.
value
=
data
threads
.
value
=
data
}
}
const
tab
=
ref
(
-
1
)
watch
(()
=>
LG
.
value
,
(
value
)
=>
{
if
(
value
)
tab
.
value
=
0
else
tab
.
value
=
-
1
})
const
ready
=
ref
(
false
)
onMounted
(()
=>
{
if
(
LG
.
value
)
tab
.
value
=
0
ready
.
value
=
true
})
function
handleChangeTab
(
index
)
{
tab
.
value
=
index
}
useHead
({
useHead
({
title
:
'
全部主题 - GitBot
'
title
:
'
全部主题 - GitBot
'
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录