UNPKG

xdesign-vue-next

Version:

XDesign Component for vue-next

36 lines (32 loc) 979 B
/** * xdesign v1.0.6 * (c) 2023 xdesign * @license MIT */ import { ref, computed } from 'vue'; function useMoreAction(props, pageCount, innerCurrent) { var prevMore = ref(false); var nextMore = ref(false); var curPageLeftCount = computed(function () { return Math.ceil((props.foldedMaxPageBtn - 1) / 2); }); var curPageRightCount = computed(function () { return Math.ceil((props.foldedMaxPageBtn - 1) / 2); }); var isPrevMoreShow = computed(function () { return 2 + curPageLeftCount.value < innerCurrent.value; }); var isNextMoreShow = computed(function () { return pageCount.value - 1 - curPageRightCount.value > innerCurrent.value; }); return { prevMore: prevMore, nextMore: nextMore, curPageLeftCount: curPageLeftCount, curPageRightCount: curPageRightCount, isPrevMoreShow: isPrevMoreShow, isNextMoreShow: isNextMoreShow }; } export { useMoreAction as default }; //# sourceMappingURL=useMoreAction.js.map