Skip to content

Commit 69729eb

Browse files
committed
Pagination: make page-size attribute supports .sync
1 parent b1be1f4 commit 69729eb

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

examples/docs/en-US/pagination.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ Add more modules based on your scenario.
224224
| Attribute | Description | Type | Accepted Values | Default |
225225
|--------------------|----------------------------------------------------------|-------------------|-------------|--------|
226226
| small | whether to use small pagination | boolean || false |
227-
| background | whether the buttons have a background color | Boolean || false |
228-
| page-size | item count of each page | number || 10 |
227+
| background | whether the buttons have a background color | boolean || false |
228+
| page-size | item count of each page, supports the .sync modifier | number || 10 |
229229
| total | total item count | number |||
230230
| page-count | total page count. Set either `total` or `page-count` and pages will be displayed; if you need `page-sizes`, `total` is required | number |||
231231
| pager-count | number of pagers. Pagination collapses when the total page count exceeds this value | number | odd number between 5 and 21 | 7 |

examples/docs/es/pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Agrega más modulos basados en su escenario.
211211
| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
212212
| ------------ | ---------------------------------------- | -------- | ---------------------------------------- | -------------------------------------- |
213213
| small | usar paginación pequeña | boolean || false |
214-
| page-size | cantidad de elementos por página | number || 10 |
214+
| page-size | cantidad de elementos por página, soporta el modificador .sync | number || 10 |
215215
| total | total de elementos | number |||
216216
| page-count | total de páginas. Asigna `total` o `page-count` y las páginas serán mostradas; si necesitas `page-sizes`, `total` es **requerido** | number |||
217217
| pager-count | número de paginadores. La paginación colapsa cuando el número total de páginas excede este valor. | number | odd number between 5 and 21 | 7 |

examples/docs/zh-CN/pagination.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,15 +223,15 @@
223223
### Attributes
224224
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
225225
|--------------------|----------------------------------------------------------|-------------------|-------------|--------|
226-
| small | 是否使用小型分页样式 | Boolean || false |
227-
| background | 是否为分页按钮添加背景色 | Boolean || false |
228-
| page-size | 每页显示条目个数 | Number || 10 |
229-
| total | 总条目数 | Number |||
226+
| small | 是否使用小型分页样式 | boolean || false |
227+
| background | 是否为分页按钮添加背景色 | boolean || false |
228+
| page-size | 每页显示条目个数,支持 .sync 修饰符 | number || 10 |
229+
| total | 总条目数 | number |||
230230
| page-count | 总页数,total 和 page-count 设置任意一个就可以达到显示页码的功能;如果要支持 page-sizes 的更改,则需要使用 total 属性 | Number |||
231-
| pager-count | 页码按钮的数量,当总页数超过该值时会折叠 | Number | 大于等于 5 且小于等于 21 的奇数 | 7 |
232-
| current-page | 当前页数,支持 .sync 修饰符 | Number || 1 |
231+
| pager-count | 页码按钮的数量,当总页数超过该值时会折叠 | number | 大于等于 5 且小于等于 21 的奇数 | 7 |
232+
| current-page | 当前页数,支持 .sync 修饰符 | number || 1 |
233233
| layout | 组件布局,子组件名用逗号分隔| String | `sizes`, `prev`, `pager`, `next`, `jumper`, `->`, `total`, `slot` | 'prev, pager, next, jumper, ->, total' |
234-
| page-sizes | 每页显示个数选择器的选项设置 | Number[] || [10, 20, 30, 40, 50, 100] |
234+
| page-sizes | 每页显示个数选择器的选项设置 | number[] || [10, 20, 30, 40, 50, 100] |
235235
| popper-class | 每页显示个数选择器的下拉框类名 | string |||
236236
| prev-text | 替代图标显示的上一页文字 | string |||
237237
| next-text | 替代图标显示的下一页文字 | string |||

packages/pagination/src/pagination.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ export default {
206206
this.$parent.internalPageSize = val = parseInt(val, 10);
207207
this.$parent.userChangePageSize = true;
208208
this.$parent.$emit('size-change', val);
209+
this.$parent.$emit('update:pageSize', val);
209210
}
210211
}
211212
}
@@ -223,7 +224,7 @@ export default {
223224
components: { ElInput },
224225

225226
watch: {
226-
'$parent.internalPageSize'() {
227+
'$parent.internalPageSize'(newVal) {
227228
this.$nextTick(() => {
228229
this.$refs.input.$el.querySelector('input').value = this.$parent.internalCurrentPage;
229230
});

0 commit comments

Comments
 (0)