xdesign-vue-next
Version:
XDesign Component for vue-next
40 lines (34 loc) • 1.07 kB
JavaScript
/**
* xdesign v1.0.6
* (c) 2023 xdesign
* @license MIT
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var vue = require('vue');
function useMoreAction(props, pageCount, innerCurrent) {
var prevMore = vue.ref(false);
var nextMore = vue.ref(false);
var curPageLeftCount = vue.computed(function () {
return Math.ceil((props.foldedMaxPageBtn - 1) / 2);
});
var curPageRightCount = vue.computed(function () {
return Math.ceil((props.foldedMaxPageBtn - 1) / 2);
});
var isPrevMoreShow = vue.computed(function () {
return 2 + curPageLeftCount.value < innerCurrent.value;
});
var isNextMoreShow = vue.computed(function () {
return pageCount.value - 1 - curPageRightCount.value > innerCurrent.value;
});
return {
prevMore: prevMore,
nextMore: nextMore,
curPageLeftCount: curPageLeftCount,
curPageRightCount: curPageRightCount,
isPrevMoreShow: isPrevMoreShow,
isNextMoreShow: isNextMoreShow
};
}
exports["default"] = useMoreAction;
//# sourceMappingURL=useMoreAction.js.map