@@ -56,6 +56,13 @@ const updatePages = (page: number) => {
5656 setMembers ();
5757};
5858
59+ const handlePageSizeChange = () => {
60+ currentPage .value = 1 ;
61+ setMembers ();
62+ };
63+
64+ const PAGE_SIZE_OPTIONS = [10 , 20 , 50 , 100 ];
65+
5966onMounted (setMembers );
6067 </script >
6168
@@ -74,9 +81,10 @@ onMounted(setMembers);
7481 <el-row class =" p-10" >
7582 <el-col :xs =" 24" :sm =" 24" :md =" 24" :lg =" 24" :xl =" 24" >
7683 <div class =" py-2 w-full" >
77- <el-pagination class =" items-center w-full" background layout =" prev, pager, next" :total =" total"
84+ <el-pagination class =" items-center w-full" background layout =" sizes, prev, pager, next" :total =" total"
85+ :page-sizes =" PAGE_SIZE_OPTIONS"
7886 v-model:page-size =" pageSize" v-model:currentPage =" currentPage" @current-change =" updatePages($event)"
79- @update:page- size = " pageSize " />
87+ @size-change = " handlePageSizeChange " />
8088 </div >
8189 <div v-loading =" isLoading" >
8290 <ul v-for =" item of items" :key =" item.id" class =" list-disc" >
@@ -85,6 +93,12 @@ onMounted(setMembers);
8593 </li >
8694 </ul >
8795 </div >
96+ <div class =" py-2 w-full" >
97+ <el-pagination class =" items-center w-full" background layout =" sizes, prev, pager, next" :total =" total"
98+ :page-sizes =" PAGE_SIZE_OPTIONS"
99+ v-model:page-size =" pageSize" v-model:currentPage =" currentPage" @current-change =" updatePages($event)"
100+ @size-change =" handlePageSizeChange" />
101+ </div >
88102 </el-col >
89103 </el-row >
90104 </template >
0 commit comments