Skip to content

Commit

Permalink
feat: 添加懒加载
Browse files Browse the repository at this point in the history
  • Loading branch information
Plumbiu committed Feb 17, 2023
1 parent bd9775f commit b65567f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions frontend/components/ArticlesList/Item/Bar/Top.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ defineProps<{
authorId?: IAuthor
adId?: string
}>()
const show = useState('authorCard', () => false)
</script>

<template>
<div class="topbar">
<div class="author">
<span class="name">{{ adId ? adId : authorId?.name }}</span>
<ArticlesListItemAuthorCard
v-if="authorId"
<span class="name" @mouseover="show = true">{{ adId ? adId : authorId?.name }}</span>
<LazyArticlesListItemAuthorCard
v-if="show && authorId"
:name="authorId.name"
:motto="authorId.motto"
:avatar="authorId.avatar"
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/ArticlesList/Navigation/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const routeMap = {
</script>

<template>
<div v-if="route.query.sort && route.query.sort?.indexOf('hottest') !== -1" class="z-9 relative">
<div class="z-9 relative">
<div class="drop-down">
<div class="dropdown-toggle" @click="isShow = !isShow">
{{ routeMap[String(route.query.sort)] }}
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/ArticlesList/Navigation/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="navigator">
<ArticlesListNavigationLink />
<LazyArticlesListNavigationSelect v-if="$route.query?.sort?.indexOf('hottest')" />
<LazyArticlesListNavigationSelect v-if="$route.query.sort && $route.query.sort?.indexOf('hottest') !== -1" />
</div>
</template>
Expand Down

0 comments on commit b65567f

Please sign in to comment.