Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周韬
node-sample
Commits
bbdf57e8
Commit
bbdf57e8
authored
Jan 19, 2017
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Improve UI by adding 2nd paginator and making 1st one movable (#54)"
This reverts commit
b04ea0c4
.
parent
4114eff3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
47 deletions
+40
-47
App.vue
src/App.vue
+6
-1
ItemList.vue
src/components/ItemList.vue
+34
-7
NewsListNav.vue
src/components/NewsListNav.vue
+0
-39
No files found.
src/App.vue
View file @
bbdf57e8
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
</nav>
</nav>
</header>
</header>
<transition
name=
"fade"
mode=
"out-in"
>
<transition
name=
"fade"
mode=
"out-in"
>
<router-view></router-view>
<router-view
class=
"view"
></router-view>
</transition>
</transition>
</div>
</div>
</
template
>
</
template
>
...
@@ -76,6 +76,11 @@ a
...
@@ -76,6 +76,11 @@ a
display inline-block
display inline-block
vertical-align middle
vertical-align middle
.view
max-width 800px
margin 0 auto
position relative
.fade-enter-active, .fade-leave-active
.fade-enter-active, .fade-leave-active
transition all .2s ease
transition all .2s ease
...
...
src/components/ItemList.vue
View file @
bbdf57e8
<
template
>
<
template
>
<div>
<div
class=
"news-view"
>
<spinner
:show=
"loading"
></spinner>
<spinner
:show=
"loading"
></spinner>
<news-list-nav
:page=
"page"
:maxPage=
"maxPage"
:type=
"type"
v-if=
"displayedPage > 0"
></news-list-nav>
<div
class=
"news-list-nav"
>
<router-link
v-if=
"page > 1"
:to=
"'/' + type + '/' + (page - 1)"
>
<
prev
</router-link>
<a
v-else
class=
"disabled"
>
<
prev
</a>
<span>
{{
page
}}
/
{{
maxPage
}}
</span>
<router-link
v-if=
"hasMore"
:to=
"'/' + type + '/' + (page + 1)"
>
more
>
</router-link>
<a
v-else
class=
"disabled"
>
more
>
</a>
</div>
<transition
:name=
"transition"
>
<transition
:name=
"transition"
>
<div
class=
"news-list"
:key=
"displayedPage"
v-if=
"displayedPage > 0"
>
<div
class=
"news-list"
:key=
"displayedPage"
v-if=
"displayedPage > 0"
>
<transition-group
tag=
"ul"
name=
"item"
>
<transition-group
tag=
"ul"
name=
"item"
>
...
@@ -10,13 +16,11 @@
...
@@ -10,13 +16,11 @@
</transition-group>
</transition-group>
</div>
</div>
</transition>
</transition>
<news-list-nav
:page=
"page"
:maxPage=
"maxPage"
:type=
"type"
v-if=
"displayedPage > 0"
></news-list-nav>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
import
Spinner
from
'./Spinner.vue'
import
Spinner
from
'./Spinner.vue'
import
NewsListNav
from
'./NewsListNav.vue'
import
Item
from
'./Item.vue'
import
Item
from
'./Item.vue'
import
{
watchList
}
from
'../store/api'
import
{
watchList
}
from
'../store/api'
...
@@ -27,7 +31,6 @@ export default {
...
@@ -27,7 +31,6 @@ export default {
components
:
{
components
:
{
Spinner
,
Spinner
,
NewsListNav
,
Item
Item
},
},
...
@@ -57,6 +60,9 @@ export default {
...
@@ -57,6 +60,9 @@ export default {
maxPage
()
{
maxPage
()
{
const
{
itemsPerPage
,
lists
}
=
this
.
$store
.
state
const
{
itemsPerPage
,
lists
}
=
this
.
$store
.
state
return
Math
.
ceil
(
lists
[
this
.
type
].
length
/
itemsPerPage
)
return
Math
.
ceil
(
lists
[
this
.
type
].
length
/
itemsPerPage
)
},
hasMore
()
{
return
this
.
page
<
this
.
maxPage
}
}
},
},
...
@@ -106,10 +112,31 @@ export default {
...
@@ -106,10 +112,31 @@ export default {
</
script
>
</
script
>
<
style
lang=
"stylus"
>
<
style
lang=
"stylus"
>
.news-view
padding-top 45px
.news-list-nav, .news-list
background-color #fff
border-radius 2px
.news-list-nav
padding 15px 30px
position fixed
text-align center
top 55px
left 0
right 0
z-index 998
box-shadow 0 1px 2px rgba(0,0,0,.1)
a
margin 0 1em
.disabled
color #ccc
.news-list
.news-list
position absolute
margin 30px 0
width 100%
width 100%
max-width 800px
margin 30px auto
transition all .5s cubic-bezier(.55,0,.1,1)
transition all .5s cubic-bezier(.55,0,.1,1)
ul
ul
list-style-type none
list-style-type none
...
...
src/components/NewsListNav.vue
deleted
100644 → 0
View file @
4114eff3
<
template
>
<div
class=
"news-list-nav"
>
<router-link
v-if=
"page > 1"
:to=
"'/' + type + '/' + (page - 1)"
>
<
prev
</router-link>
<a
v-else
class=
"disabled"
>
<
prev
</a>
<span>
{{
page
}}
/
{{
maxPage
}}
</span>
<router-link
v-if=
"hasMore"
:to=
"'/' + type + '/' + (page + 1)"
>
more
>
</router-link>
<a
v-else
class=
"disabled"
>
more
>
</a>
</div>
</
template
>
<
script
>
export
default
{
name
:
'news-list-nav'
,
props
:
[
'page'
,
'maxPage'
,
'type'
],
computed
:
{
hasMore
()
{
return
this
.
page
<
this
.
maxPage
}
}
}
</
script
>
<
style
lang=
"stylus"
>
.news-list-nav, .news-list
background-color #fff
border-radius 2px
.news-list-nav
padding 15px 30px
text-align center
z-index 998
box-shadow 0 1px 2px rgba(0,0,0,.1)
a
margin 0 1em
.disabled
color #ccc
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment