Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
9a0f7e30
Commit
9a0f7e30
authored
Aug 15, 2016
by
qingwei.li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update pagination and select event name
parent
0edd7b42
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
14 deletions
+28
-14
examples/docs/pagination.md
examples/docs/pagination.md
+8
-4
examples/docs/select.md
examples/docs/select.md
+5
-1
packages/pagination/src/pager.vue
packages/pagination/src/pager.vue
+1
-1
packages/pagination/src/pagination.js
packages/pagination/src/pagination.js
+14
-8
No files found.
examples/docs/pagination.md
View file @
9a0f7e30
...
@@ -50,8 +50,8 @@
...
@@ -50,8 +50,8 @@
<el-pagination
<el-pagination
@size
-
change="handleSizeChange"
@sizechange="handleSizeChange"
@current
-
change="handleCurrentChange"
@currentchange="handleCurrentChange"
layout="sizes, prev, pager, next, jumper, total"
layout="sizes, prev, pager, next, jumper, total"
:total="1000">
:total="1000">
</el-pagination>
</el-pagination>
...
@@ -85,6 +85,10 @@
...
@@ -85,6 +85,10 @@
| current-page | 当前页数 | Number | | 0|
| current-page | 当前页数 | Number | | 0|
| layout | 组件布局,子组件名用逗号分隔。| String |
`prev`
,
`pager`
,
`next`
,
`jumper`
,
`slot`
,
`->`
,
`total`
| 'prev, pager, next, jumper, slot, ->, total' |
| layout | 组件布局,子组件名用逗号分隔。| String |
`prev`
,
`pager`
,
`next`
,
`jumper`
,
`slot`
,
`->`
,
`total`
| 'prev, pager, next, jumper, slot, ->, total' |
| page-sizes | 切换每页显示个数的子组件值 | Number
[]
| |
[
10, 20, 30, 40, 50, 100
]
|
| page-sizes | 切换每页显示个数的子组件值 | Number
[]
| |
[
10, 20, 30, 40, 50, 100
]
|
| size-change | pageSize 改变时会触发的事件 | Function | | |
| current-change | currentPage 改变时会触发的事件 | Function | | |
## 事件
| 事件名称 | 说明 | 回调函数 |
|---------|--------|---------|
| sizechange | pageSize 改变时会触发 |
`size`
|
| currentchange | currentPage 改变时会触发 |
`currentPage`
|
examples/docs/select.md
View file @
9a0f7e30
...
@@ -755,7 +755,11 @@
...
@@ -755,7 +755,11 @@
| remote | 是否为远程搜索 | boolean | | false |
| remote | 是否为远程搜索 | boolean | | false |
| remote-method | 远程搜索方法,当搜索关键字变化时会调用该方法,参数为目前的搜索关键字 | function | | |
| remote-method | 远程搜索方法,当搜索关键字变化时会调用该方法,参数为目前的搜索关键字 | function | | |
| loading | 是否正在从远程获取数据 | boolean | | false |
| loading | 是否正在从远程获取数据 | boolean | | false |
| change | value 发生变化时的回调函数,参数为 value 的值 | function | | |
### el-select 事件
| 事件名称 | 说明 | 回调参数 |
|---------|---------|---------|
| change | value 发生变化|
`value`
|
### el-option-group
### el-option-group
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
...
...
packages/pagination/src/pager.vue
View file @
9a0f7e30
...
@@ -71,7 +71,7 @@
...
@@ -71,7 +71,7 @@
}
}
if
(
newPage
!==
currentPage
)
{
if
(
newPage
!==
currentPage
)
{
this
.
$emit
(
'
current
C
hange
'
,
newPage
);
this
.
$emit
(
'
current
c
hange
'
,
newPage
);
}
}
}
}
},
},
...
...
packages/pagination/src/pagination.js
View file @
9a0f7e30
...
@@ -49,7 +49,7 @@ export default {
...
@@ -49,7 +49,7 @@ export default {
const
TEMPLATE_MAP
=
{
const
TEMPLATE_MAP
=
{
prev
:
<
prev
><
/prev>
,
prev
:
<
prev
><
/prev>
,
jumper
:
<
jumper
><
/jumper>
,
jumper
:
<
jumper
><
/jumper>
,
pager
:
<
pager
currentPage
=
{
this
.
internalCurrentPage
}
pageCount
=
{
this
.
pageCount
}
on
-
current
C
hange
=
{
this
.
handleCurrentChange
}
><
/pager>
,
pager
:
<
pager
currentPage
=
{
this
.
internalCurrentPage
}
pageCount
=
{
this
.
pageCount
}
on
-
current
c
hange
=
{
this
.
handleCurrentChange
}
><
/pager>
,
next
:
<
next
><
/next>
,
next
:
<
next
><
/next>
,
sizes
:
<
sizes
><
/sizes>
,
sizes
:
<
sizes
><
/sizes>
,
slot
:
<
slot
><
/slot>
,
slot
:
<
slot
><
/slot>
,
...
@@ -114,6 +114,12 @@ export default {
...
@@ -114,6 +114,12 @@ export default {
},
},
Sizes
:
{
Sizes
:
{
created
()
{
if
(
Array
.
isArray
(
this
.
$parent
.
pageSizes
))
{
this
.
$parent
.
internalPageSize
=
this
.
$parent
.
pageSizes
[
0
];
}
},
render
(
h
)
{
render
(
h
)
{
return
(
return
(
<
span
class
=
"
el-pagination__sizes
"
>
<
span
class
=
"
el-pagination__sizes
"
>
...
@@ -144,7 +150,7 @@ export default {
...
@@ -144,7 +150,7 @@ export default {
handleChange
(
val
)
{
handleChange
(
val
)
{
if
(
val
!==
this
.
$parent
.
internalPageSize
)
{
if
(
val
!==
this
.
$parent
.
internalPageSize
)
{
this
.
$parent
.
internalPageSize
=
val
=
parseInt
(
val
,
10
);
this
.
$parent
.
internalPageSize
=
val
=
parseInt
(
val
,
10
);
this
.
$parent
.
$emit
(
'
size
-
change
'
,
val
);
this
.
$parent
.
$emit
(
'
sizechange
'
,
val
);
}
}
}
}
}
}
...
@@ -167,7 +173,7 @@ export default {
...
@@ -167,7 +173,7 @@ export default {
this
.
$parent
.
internalCurrentPage
=
this
.
$parent
.
getValidCurrentPage
(
target
.
value
);
this
.
$parent
.
internalCurrentPage
=
this
.
$parent
.
getValidCurrentPage
(
target
.
value
);
if
(
target
.
value
!==
this
.
oldValue
&&
Number
(
target
.
value
)
===
this
.
$parent
.
internalCurrentPage
)
{
if
(
target
.
value
!==
this
.
oldValue
&&
Number
(
target
.
value
)
===
this
.
$parent
.
internalCurrentPage
)
{
this
.
$parent
.
$emit
(
'
current
-
change
'
,
this
.
$parent
.
internalCurrentPage
);
this
.
$parent
.
$emit
(
'
currentchange
'
,
this
.
$parent
.
internalCurrentPage
);
}
}
this
.
oldValue
=
null
;
this
.
oldValue
=
null
;
...
@@ -209,7 +215,7 @@ export default {
...
@@ -209,7 +215,7 @@ export default {
methods
:
{
methods
:
{
handleCurrentChange
(
val
)
{
handleCurrentChange
(
val
)
{
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
val
);
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
val
);
this
.
$emit
(
'
current
-
change
'
,
this
.
internalCurrentPage
);
this
.
$emit
(
'
currentchange
'
,
this
.
internalCurrentPage
);
},
},
prev
()
{
prev
()
{
...
@@ -218,7 +224,7 @@ export default {
...
@@ -218,7 +224,7 @@ export default {
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
this
.
$emit
(
'
current
-
change
'
,
this
.
internalCurrentPage
);
this
.
$emit
(
'
currentchange
'
,
this
.
internalCurrentPage
);
}
}
},
},
...
@@ -228,7 +234,7 @@ export default {
...
@@ -228,7 +234,7 @@ export default {
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
this
.
$emit
(
'
current
-
change
'
,
this
.
internalCurrentPage
);
this
.
$emit
(
'
currentchange
'
,
this
.
internalCurrentPage
);
}
}
},
},
...
@@ -238,7 +244,7 @@ export default {
...
@@ -238,7 +244,7 @@ export default {
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
this
.
$emit
(
'
current
-
change
'
,
this
.
internalCurrentPage
);
this
.
$emit
(
'
currentchange
'
,
this
.
internalCurrentPage
);
}
}
},
},
...
@@ -248,7 +254,7 @@ export default {
...
@@ -248,7 +254,7 @@ export default {
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
this
.
internalCurrentPage
=
this
.
getValidCurrentPage
(
newVal
);
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
if
(
this
.
internalCurrentPage
!==
oldPage
)
{
this
.
$emit
(
'
current
-
change
'
,
this
.
internalCurrentPage
);
this
.
$emit
(
'
currentchange
'
,
this
.
internalCurrentPage
);
}
}
},
},
...
...
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