forked from vueComponent/ant-design-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchanger.vue
51 lines (46 loc) · 918 Bytes
/
changer.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<docs>
---
order: 2
title:
zh-CN: 改变
en-US: Changer
---
## zh-CN
改变每页显示条目数。
## en-US
Change `pageSize`.
</docs>
<template>
<div>
<a-pagination
v-model:current="current1"
v-model:pageSize="pageSize"
show-size-changer
:total="500"
@showSizeChange="onShowSizeChange"
/>
<br />
<a-pagination
v-model:current="current2"
show-size-changer
:total="500"
disabled
@showSizeChange="onShowSizeChange"
/>
</div>
</template>
<script lang="ts" setup>
import { ref, watch } from 'vue';
const pageSize = ref(20);
const current1 = ref(3);
const current2 = ref(4);
const onShowSizeChange = (current: number, pageSize: number) => {
console.log(current, pageSize);
};
watch(pageSize, () => {
console.log('pageSize', pageSize.value);
});
watch(current1, () => {
console.log('current', current1.value);
});
</script>