66 </span>
77 <Slider v-model="ageCriteria" class="slider"/>
88 </div> -->
9+ <button @click =" switchToNested300" >use nested 300</button >
10+ <button @click =" switchToNested" >use nested</button >
911 <div class =" filter-wrapper" >
1012 <span class =" field" >
1113 filtering by sport:
4850 buttons-pagination
4951 alternating
5052 :max-height =" 200"
51- :filter-options =" filterOptions"
5253 sort-by =" age"
5354 sort-type =" desc"
5455 @click-row =" showItem"
5758
5859 <div class =" customize-footer" >
5960 <div class =" customize-index" >
60- Now displaying: {{currentPageFirstIndex}} ~ {{currentPageLastIndex}} of {{totalItemsLength}}
61+ Now displaying: {{ currentPageFirstIndex }} ~ {{ currentPageLastIndex }} of {{ totalItemsLength }}
6162 </div >
6263 <div class =" customize-buttons" >
6364 <span
6667 :class =" {'active': paginationNumber === currentPaginationNumber}"
6768 @click =" updatePage(paginationNumber)"
6869 >
69- {{paginationNumber}}
70+ {{ paginationNumber }}
7071 </span >
7172 </div >
7273 <div class =" customize-pagination" >
73- <button class =" prev-page" @click =" prevPage" :disabled =" isFirstPage" >prev page</button >
74- <button class =" next-page" @click =" nextPage" :disabled =" isLastPage" >next page</button >
74+ <button
75+ class =" prev-page"
76+ :disabled =" isFirstPage"
77+ @click =" prevPage"
78+ >
79+ prev page
80+ </button >
81+ <button
82+ class =" next-page"
83+ :disabled =" isLastPage"
84+ @click =" nextPage"
85+ >
86+ next page
87+ </button >
7588 </div >
7689 </div >
7790 </div >
7891</template >
7992
8093<script lang="ts" setup>
8194// import Slider from '@vueform/slider';
82- import { computed , ref , reactive , toRefs } from ' vue' ;
83- import { Header , Item , FilterOption , clickRowArgument } from " ../types/main" ;
95+ import {
96+ computed , ref , reactive , toRefs ,
97+ } from ' vue' ;
98+ import {
99+ Header , Item , FilterOption , clickRowArgument ,
100+ } from ' ../types/main' ;
84101import DataTable from ' ../components/DataTable.vue' ;
85- import { mockClientItems } from " ../mock" ;
102+ import { mockClientNestedItems , mockClientItems } from ' ../mock' ;
103+
104+ const searchField = ref (' name' );
105+ const searchValue = ref (' name-1' );
106+
107+ const items = ref <Item []>(mockClientNestedItems (100 ));
86108
87- const searchField = ref (" name" );
88- const searchValue = ref (" name-1" );
109+ const switchToNested300 = () => {
110+ items .value = mockClientNestedItems (300 );
111+ };
112+
113+ const switchToNested = () => {
114+ items .value = mockClientNestedItems (100 );
115+ };
89116
90- const items = ref <Item []>(mockClientItems (100 ));
91117const headers: Header [] = [
92- { text: " Name" , value: " name" },
93- { text: " Address" , value: " address" },
94- { text: " Height" , value: " height" , sortable: true },
95- { text: " Weight" , value: " weight" , sortable: true },
96- { text: " Age" , value: " age" , sortable: true },
97- { text: " Favourite sport" , value: " favouriteSport" },
98- { text: " Favourite fruits" , value: " favouriteFruits" },
118+ { text: ' Name' , value: ' name' },
119+ { text: ' Address' , value: ' address' },
120+ { text: ' Height' , value: ' info.out. height' , sortable: true },
121+ { text: ' Weight' , value: ' info.out. weight' , sortable: true },
122+ { text: ' Age' , value: ' age' , sortable: true },
123+ { text: ' Favourite sport' , value: ' favouriteSport' },
124+ { text: ' Favourite fruits' , value: ' favouriteFruits' },
99125];
100126
101127const itemsSelected = ref <Item []>([items .value [14 ]]);
@@ -108,24 +134,24 @@ const showItem = (item: clickRowArgument) => {
108134
109135const ageCriteria = ref <[number , number ]>([1 , 15 ]);
110136
111- const favouriteSportCriteria = ref (' basketball ' );
112-
113- const filterOptions = computed ((): FilterOption [] => {
114- const filterOptionsArray: FilterOption [] = [];
115- if (favouriteSportCriteria .value !== ' all' ) {
116- filterOptionsArray .push ({
117- field: ' favouriteSport' ,
118- comparison: ' =' ,
119- criteria: favouriteSportCriteria .value ,
120- });
121- }
122- filterOptionsArray .push ({
123- field: ' age' ,
124- comparison: ' between' ,
125- criteria: ageCriteria .value ,
126- });
127- return filterOptionsArray ;
128- });
137+ const favouriteSportCriteria = ref (' all ' );
138+
139+ // const filterOptions = computed((): FilterOption[] => {
140+ // const filterOptionsArray: FilterOption[] = [];
141+ // if (favouriteSportCriteria.value !== 'all') {
142+ // filterOptionsArray.push({
143+ // field: 'favouriteSport',
144+ // comparison: '=',
145+ // criteria: favouriteSportCriteria.value,
146+ // });
147+ // }
148+ // filterOptionsArray.push({
149+ // field: 'age',
150+ // comparison: 'between',
151+ // criteria: ageCriteria.value,
152+ // });
153+ // return filterOptionsArray;
154+ // });
129155
130156// $ref dataTable
131157const dataTable = ref ();
0 commit comments