File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 39
39
v-for =" (page, key) in slotProps.computed.pageRange"
40
40
:key =" key"
41
41
v-on =" slotProps.pageButtonEvents(page)"
42
+ :disabled =" page === slotProps.computed.currentPage"
42
43
>
43
44
{{ page }}
44
45
</button >
@@ -70,7 +71,7 @@ export default {
70
71
compatConfig: {
71
72
MODE : 3
72
73
},
73
-
74
+
74
75
inheritAttrs: false ,
75
76
76
77
emits: [' pagination-change-page' ],
Original file line number Diff line number Diff line change @@ -146,6 +146,18 @@ test('does not emit event on current page', function () {
146
146
expect ( event ) . toBeUndefined ( ) ;
147
147
} ) ;
148
148
149
+ test ( 'current page button is disabled' , function ( ) {
150
+ exampleData . current_page = 1 ;
151
+ const wrapper = mount ( TailwindPagination , {
152
+ props : {
153
+ data : exampleData ,
154
+ } ,
155
+ } ) ;
156
+
157
+ const button = wrapper . findAll ( 'button' ) . at ( 1 ) ;
158
+ expect ( button . attributes ( 'disabled' ) ) . toBe ( '' ) ;
159
+ } ) ;
160
+
149
161
test ( 'has correct DOM structure when using slots' , function ( ) {
150
162
const wrapper = mount ( TailwindPagination , {
151
163
props : { data : exampleData } ,
You can’t perform that action at this time.
0 commit comments