Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
admin-base
Project
Project
Details
Activity
Releases
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
new-sing
admin-base
Commits
3f708ac9
Commit
3f708ac9
authored
Sep 05, 2019
by
赵茹林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分页组件 修复 多弹窗公用时分页不能重置的问题
parent
01bbbb24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
13 deletions
+27
-13
page.vue
src/components/framework/page.vue
+21
-7
dialog.vue
src/components/team/dialog.vue
+6
-6
No files found.
src/components/framework/page.vue
View file @
3f708ac9
...
...
@@ -2,10 +2,11 @@
<div
class=
"page-div"
>
<el-pagination
:small=
"small"
@
size-change=
"handleSizeChange"
:page-sizes=
"[5, 10, 20, 30, 40, 50, 60, 80, 100]"
:page-size=
"limit"
:current-page
.
sync=
"nowPage"
:page-sizes=
"[5, 10, 20, 30, 40, 50, 60, 80, 100]"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"nowPage"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</el-pagination>
...
...
@@ -21,6 +22,9 @@
}
},
props
:
{
'currentPage'
:
{
required
:
false
,
},
'total'
:
{
required
:
true
},
...
...
@@ -28,19 +32,29 @@
default
:
10
},
'small'
:
{
required
:
false
,
type
:
Boolean
,
default
:
false
}
},
watch
:
{
nowPage
(
value
)
{
this
.
$emit
(
"pageChange"
,
value
);
}
currentPage
(
val
)
{
// 改变这个值并不会触发 handleCurrentChange
if
(
typeof
val
===
"number"
)
{
console
.
log
(
'prop currentPage!!!'
);
this
.
nowPage
=
val
;
}
},
},
methods
:
{
// 当前页变化
handleCurrentChange
(
val
)
{
console
.
log
(
'methods pageChange!!!'
)
this
.
$emit
(
"pageChange"
,
val
);
},
// size变化
handleSizeChange
(
val
)
{
this
.
nowPage
=
1
;
this
.
$emit
(
'sizeChange'
,
val
);
this
.
nowPage
=
1
},
}
}
...
...
src/components/team/dialog.vue
View file @
3f708ac9
...
...
@@ -129,8 +129,9 @@
<
/el-table
>
<!--
业绩
结束
-->
<!--
todo
分页有问题
-->
<
page
v
-
if
=
"total"
:
total
=
"total"
:
limit
=
"limit"
@
pageChange
=
"onPageChange"
@
sizeChange
=
"onSizeChange"
/>
<!--
todo
分页有问题
权限有问题
-->
<!--
<
page
v
-
if
=
"total"
:
total
=
"total"
:
limit
=
"limit"
@
pageChange
=
"onPageChange"
@
sizeChange
=
"onSizeChange"
/>-->
<
page
:
current
-
page
=
"nowPage"
:
total
=
"total"
:
limit
=
"limit"
@
pageChange
=
"onPageChange"
@
sizeChange
=
"onSizeChange"
/>
<
/div
>
<
/el-dialog
>
...
...
@@ -148,8 +149,7 @@
dialogObj
:
{
type
:
Object
,
required
:
true
,
default
:
()
=>
{
}
default
:
()
=>
{
}
}
}
,
data
()
{
...
...
@@ -168,7 +168,7 @@
}
,
methods
:
{
initDialog
()
{
console
.
log
(
this
.
dialogObj
)
//
console.log(this.dialogObj)
if
(
this
.
dialogObj
)
{
this
.
show
=
this
.
dialogObj
.
show
;
this
.
getData
();
...
...
@@ -293,7 +293,7 @@
deep
:
true
}
,
show
(
value
)
{
// this.nowPage = 1;
this
.
nowPage
=
1
;
// 重置
this
.
$emit
(
"changeShow"
,
value
);
}
}
...
...
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