Skip to content

Commit

Permalink
feat: complete workspace projects module
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwa committed Oct 3, 2018
1 parent 66fa69d commit 7da43ce
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mock/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const fetchProjects = [
id: 'xxx5',
title: titles[4],
logo: avatars[4],
description: '凛冬将至',
description: '专注于前端发展',
updatedAt: new Date('2018-07-23'),
member: '高逼格设计天团',
href: '',
Expand Down
6 changes: 3 additions & 3 deletions src/components/Workspace/ProjectItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
>
<router-link
class="projects__item__title projects__item__inner-link"
:to="link"
:to="link ? link : '/dashboard/analysis'"
>{{title}}</router-link>
</header>
<div class="projects__item__description">{{description}}</div>
<footer class="projects__item__author">
<router-link
class="projects__author__link projects__item__inner-link"
:to="author.link"
:to="author.link ? author.link : '/dashboard/analysis'"
>{{author.name}}</router-link>
<time class="projects__item__time">{{createTime}}</time>
</footer>
Expand Down Expand Up @@ -91,7 +91,7 @@ export default {
.projects
&__item
width: 33.33%
flex-basis: 33%
color: rgba(0, 0, 0, .45)
&__inner-link
Expand Down
13 changes: 10 additions & 3 deletions src/components/Workspace/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
v-for="item of projects"
:key="item.title"
:title="item.title"
:avatar-src="item.avatar"
:link="item.link"
:avatar-src="item.logo"
:link="item.href"
:description="item.description"
:author="item.author"
:author="{
name: item.member,
link: item.memberLink
}"
></workspace-pro-item>
</div>
</el-card>
Expand Down Expand Up @@ -68,6 +71,10 @@ export default {
font-size: 16px
font-weight: normal
&__wrapper
display: flex
flex-wrap: wrap
.projects
&__title
&__more
Expand Down
3 changes: 1 addition & 2 deletions src/view/Workspace.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
class="workspace__projects__gutter"
:xs="24" :sm="24" :md="24" :lg="16" :xl="16"
>
<!-- v-for area -->
<workspace-projects></workspace-projects>
<workspace-projects :projects="projects"></workspace-projects>
</el-col>
<el-col
class="workspace__navigator__wrapper"
Expand Down

0 comments on commit 7da43ce

Please # to comment.