Commit c71fdc8 authored Nov 5, 2024 · 1 / 2 · Verified
1 parent 6844f7b commit c71fdc8 Copy full SHA for c71fdc8
File tree 3 files changed +40
-12
lines changed
docs/components/content/examples
src/runtime/components/navigation
3 files changed +40
-12
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,29 @@ const items = ref(Array(55))
5
5
6
6
<template >
7
7
<UPagination v-model =" page" :total =" items.length" :ui =" { rounded: 'first-of-type:rounded-s-md last-of-type:rounded-e-md' }" >
8
- <template #first =" { onClick } " >
8
+ <template #first =" { onClick , canGoFirst } " >
9
9
<UTooltip text =" First page" >
10
- <UButton icon =" i-heroicons-arrow-uturn-left" color =" primary" :ui =" { rounded: 'rounded-full' }" class =" rtl:[& _span:first-child]:rotate-180 me-2" @click =" onClick" />
10
+ <UButton
11
+ icon =" i-heroicons-arrow-uturn-left"
12
+ color =" primary"
13
+ :ui =" { rounded: 'rounded-full' }"
14
+ class =" rtl:[& _span:first-child]:rotate-180 me-2"
15
+ :disabled =" !canGoFirst"
16
+ @click =" onClick"
17
+ />
11
18
</UTooltip >
12
19
</template >
13
20
14
- <template #last =" { onClick } " >
21
+ <template #last =" { onClick , canGoLast } " >
15
22
<UTooltip text =" Last page" >
16
- <UButton icon =" i-heroicons-arrow-uturn-right-20-solid" color =" primary" :ui =" { rounded: 'rounded-full' }" class =" rtl:[& _span:last-child]:rotate-180 ms-2" @click =" onClick" />
23
+ <UButton
24
+ icon =" i-heroicons-arrow-uturn-right-20-solid"
25
+ color =" primary"
26
+ :ui =" { rounded: 'rounded-full' }"
27
+ class =" rtl:[& _span:last-child]:rotate-180 ms-2"
28
+ :disabled =" !canGoLast"
29
+ @click =" onClick"
30
+ />
17
31
</UTooltip >
18
32
</template >
19
33
</UPagination >
Original file line number Diff line number Diff line change @@ -5,15 +5,29 @@ const items = ref(Array(55))
5
5
6
6
<template >
7
7
<UPagination v-model =" page" :total =" items.length" :ui =" { rounded: 'first-of-type:rounded-s-md last-of-type:rounded-e-md' }" >
8
- <template #prev =" { onClick } " >
8
+ <template #prev =" { onClick , canGoPrev } " >
9
9
<UTooltip text =" Previous page" >
10
- <UButton icon =" i-heroicons-arrow-small-left-20-solid" color =" primary" :ui =" { rounded: 'rounded-full' }" class =" rtl:[& _span:first-child]:rotate-180 me-2" @click =" onClick" />
10
+ <UButton
11
+ icon =" i-heroicons-arrow-small-left-20-solid"
12
+ color =" primary"
13
+ :ui =" { rounded: 'rounded-full' }"
14
+ class =" rtl:[& _span:first-child]:rotate-180 me-2"
15
+ :disabled =" !canGoPrev"
16
+ @click =" onClick"
17
+ />
11
18
</UTooltip >
12
19
</template >
13
20
14
- <template #next =" { onClick } " >
21
+ <template #next =" { onClick , canGoNext } " >
15
22
<UTooltip text =" Next page" >
16
- <UButton icon =" i-heroicons-arrow-small-right-20-solid" color =" primary" :ui =" { rounded: 'rounded-full' }" class =" rtl:[& _span:last-child]:rotate-180 ms-2" @click =" onClick" />
23
+ <UButton
24
+ icon =" i-heroicons-arrow-small-right-20-solid"
25
+ color =" primary"
26
+ :ui =" { rounded: 'rounded-full' }"
27
+ class =" rtl:[& _span:last-child]:rotate-180 ms-2"
28
+ :disabled =" !canGoNext"
29
+ @click =" onClick"
30
+ />
17
31
</UTooltip >
18
32
</template >
19
33
</UPagination >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div :class =" ui.wrapper" v-bind =" attrs" >
3
- <slot name =" first" :on-click =" onClickFirst" >
3
+ <slot name =" first" :on-click =" onClickFirst" :can-go-first = " canGoFirstOrPrev " >
4
4
<UButton
5
5
v-if =" firstButton && showFirst"
6
6
:size =" size"
14
14
/>
15
15
</slot >
16
16
17
- <slot name =" prev" :on-click =" onClickPrev" >
17
+ <slot name =" prev" :on-click =" onClickPrev" :can-go-prev = " canGoFirstOrPrev " >
18
18
<UButton
19
19
v-if =" prevButton"
20
20
:size =" size"
41
41
@click =" () => onClickPage(page)"
42
42
/>
43
43
44
- <slot name =" next" :on-click =" onClickNext" >
44
+ <slot name =" next" :on-click =" onClickNext" :can-go-next = " canGoLastOrNext " >
45
45
<UButton
46
46
v-if =" nextButton"
47
47
:size =" size"
55
55
/>
56
56
</slot >
57
57
58
- <slot name =" last" :on-click =" onClickLast" >
58
+ <slot name =" last" :on-click =" onClickLast" :can-go-last = " canGoLastOrNext " >
59
59
<UButton
60
60
v-if =" lastButton && showLast"
61
61
:size =" size"
You can’t perform that action at this time.
0 commit comments