fix(PaginationField): 修复最后一页时上一页按钮显示逻辑
最后一页时根据 submitButton.is_back 控制上一页按钮的显示,保持逻辑一致性
Showing
1 changed file
with
9 additions
and
1 deletions
| ... | @@ -39,7 +39,15 @@ const props = defineProps({ | ... | @@ -39,7 +39,15 @@ const props = defineProps({ |
| 39 | 39 | ||
| 40 | const emit = defineEmits(['prev', 'next', 'submit']) | 40 | const emit = defineEmits(['prev', 'next', 'submit']) |
| 41 | 41 | ||
| 42 | -const showPrev = computed(() => props.current > 0) | 42 | +/** |
| 43 | + * @description 是否显示上一页按钮(最后一页且 is_back 为 false 时不显示) | ||
| 44 | + * @returns {import('vue').ComputedRef<boolean>} | ||
| 45 | + */ | ||
| 46 | +const showPrev = computed(() => { | ||
| 47 | + // 非最后一页按原逻辑显示;最后一页由 submitButton.is_back 控制显示与否 | ||
| 48 | + if (!showSubmit.value) return props.current > 0 | ||
| 49 | + return props.current > 0 && props.submitButton?.is_back !== false | ||
| 50 | +}) | ||
| 43 | const showNext = computed(() => props.current < props.total - 1) | 51 | const showNext = computed(() => props.current < props.total - 1) |
| 44 | const showSubmit = computed(() => props.current === props.total - 1) | 52 | const showSubmit = computed(() => props.current === props.total - 1) |
| 45 | 53 | ... | ... |
-
Please register or login to post a comment