Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
dev
/
pingan-life-index-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
852824d7
authored
2019-12-18 00:21:40 +0800
by
simon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
默认提交
1 parent
3ca02206
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
3 deletions
src/components/pagination/pagination.js
src/components/pagination/pagination.vue
src/pages/news-list/news-list.js
src/pages/news-list/news-list.scss
src/pages/news-list/news-list.vue
src/components/pagination/pagination.js
View file @
852824d
...
...
@@ -10,6 +10,11 @@ export default {
total
:
{
type
:
Number
,
default
:
1
},
// 总条数,名字自取 还有国家化
totalItem
:
{
type
:
Number
,
default
:
1
}
},
data
()
{
...
...
src/components/pagination/pagination.vue
View file @
852824d
...
...
@@ -2,6 +2,7 @@
<
template
>
<div
class=
"comp"
>
<div
class=
"pagination gird-g"
>
<div>
共
<span
class=
"t1"
>
{{
totalItem
}}
</span>
条
</div>
<div
class=
"pagination-item"
>
<span
class=
"pointer"
:class=
"
{'pagination-disabled' : cur == 1}">
<a
@
click=
"prevPage()"
>
{{
$t
(
'pagination.firstPage'
)
}}
</a>
...
...
src/pages/news-list/news-list.js
View file @
852824d
...
...
@@ -37,12 +37,24 @@ export default {
let
{
page
}
=
val
;
this
.
queryForm
.
page
=
page
;
// this.queryForm.page = page;
this
.
$router
.
push
({
path
:
"/news/list"
,
query
:
{
page
:
page
}
});
this
.
initData
();
},
initData
()
{
let
l
=
this
.
$i18n
.
locale
;
this
.
queryForm
.
l
=
l
;
let
page
=
this
.
$route
.
query
.
page
||
1
;
this
.
queryForm
.
page
=
page
;
this
.
$nextTick
(()
=>
{
this
.
$refs
.
pagination
.
selPage
(
page
);
});
httpGet
({
url
:
api
.
newsList
,
data
:
this
.
queryForm
}).
then
(
res
=>
{
let
newsList
=
res
.
list
;
newsList
.
forEach
(
element
=>
{
...
...
src/pages/news-list/news-list.scss
View file @
852824d
...
...
@@ -40,7 +40,7 @@
&
-tit
{
display
:
flex
;
align-items
:
center
;
flex
:
1
;
//
flex: 1;
.point
{
width
:
.5rem
;
...
...
@@ -89,6 +89,7 @@
&
-item
{
&
-tit
{
flex
:
1
;
.point
{
width
:
.5rem
;
height
:
.5rem
;
...
...
src/pages/news-list/news-list.vue
View file @
852824d
...
...
@@ -15,7 +15,7 @@
<div
class=
"news-item-date"
>
{{
item
.
dateFormat
}}
</div>
</div>
</div>
<pagination
@
selpage=
"selPage"
:total=
"total"
class=
"pagination"
></pagination>
<pagination
ref=
"pagination"
@
selpage=
"selPage"
:total=
"total"
class=
"pagination"
></pagination>
</div>
</div>
</div>
...
...
Please
register
or
sign in
to post a comment