You need to sign in or sign up before continuing.
hookehuyr

fix(PaginationField): 修复最后一页时上一页按钮显示逻辑

最后一页时根据 submitButton.is_back 控制上一页按钮的显示,保持逻辑一致性
......@@ -39,7 +39,15 @@ const props = defineProps({
const emit = defineEmits(['prev', 'next', 'submit'])
const showPrev = computed(() => props.current > 0)
/**
* @description 是否显示上一页按钮(最后一页且 is_back 为 false 时不显示)
* @returns {import('vue').ComputedRef<boolean>}
*/
const showPrev = computed(() => {
// 非最后一页按原逻辑显示;最后一页由 submitButton.is_back 控制显示与否
if (!showSubmit.value) return props.current > 0
return props.current > 0 && props.submitButton?.is_back !== false
})
const showNext = computed(() => props.current < props.total - 1)
const showSubmit = computed(() => props.current === props.total - 1)
......