add page count

This commit is contained in:
Theluyuan 2022-11-15 14:58:26 +08:00
parent 7b125d0216
commit eb1b0c9b16
7 changed files with 20 additions and 11 deletions

View File

@ -203,7 +203,7 @@ const _sfc_main = defineComponent({
disabled: currentPageShow.value > maxPage.value || currentPageShow.value == currentPage.value
}, toDisplayString(unref(t)("page.confirm")), 9, _hoisted_10)
])) : createCommentVNode("", true),
props.count ? (openBlock(), createElementBlock("span", _hoisted_11, "\u5171" + toDisplayString(props.count) + "\u6761", 1)) : createCommentVNode("", true)
__props.count ? (openBlock(), createElementBlock("span", _hoisted_11, "\u5171" + toDisplayString(__props.count) + "\u6761", 1)) : createCommentVNode("", true)
]);
};
}

View File

@ -551,7 +551,8 @@ const _sfc_main$1 = defineComponent({
pages: null,
total: null,
limit: null,
theme: null
theme: null,
count: null
},
emits: ["update:current", "update:limit", "change"],
setup(__props, { emit }) {
@ -586,6 +587,7 @@ const _sfc_main$1 = defineComponent({
limits: __props.limits,
theme: __props.theme,
pages: __props.pages,
count: __props.count,
modelValue: unref(current),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(current) ? current.value = $event : null),
limit: unref(limit),
@ -599,7 +601,7 @@ const _sfc_main$1 = defineComponent({
createVNode(unref(_sfc_main$2E), { type: "layui-icon-right" })
]),
_: 1
}, 8, ["total", "show-page", "show-skip", "show-limit", "show-count", "show-refresh", "limits", "theme", "pages", "modelValue", "limit"]);
}, 8, ["total", "show-page", "show-skip", "show-limit", "show-count", "show-refresh", "limits", "theme", "pages", "count", "modelValue", "limit"]);
};
}
});
@ -1387,12 +1389,13 @@ const _sfc_main = defineComponent({
showRefresh: __props.page.showRefresh,
showLimit: __props.page.showLimit,
showCount: __props.page.showCount,
count: __props.page.count,
current: __props.page.current,
"onUpdate:current": _cache[7] || (_cache[7] = ($event) => __props.page.current = $event),
limit: __props.page.limit,
"onUpdate:limit": _cache[8] || (_cache[8] = ($event) => __props.page.limit = $event),
onChange: change
}, null, 8, ["total", "pages", "theme", "limits", "showSkip", "show-page", "showRefresh", "showLimit", "showCount", "current", "limit"])
}, null, 8, ["total", "pages", "theme", "limits", "showSkip", "show-page", "showRefresh", "showLimit", "showCount", "count", "current", "limit"])
])) : createCommentVNode("", true)
], 2)
], 512);

View File

@ -18791,7 +18791,7 @@ const _sfc_main$F = defineComponent({
disabled: currentPageShow.value > maxPage.value || currentPageShow.value == currentPage.value
}, toDisplayString$1(unref(t)("page.confirm")), 9, _hoisted_10$7)
])) : createCommentVNode("", true),
props.count ? (openBlock(), createElementBlock("span", _hoisted_11$7, "\u5171" + toDisplayString$1(props.count) + "\u6761", 1)) : createCommentVNode("", true)
__props.count ? (openBlock(), createElementBlock("span", _hoisted_11$7, "\u5171" + toDisplayString$1(__props.count) + "\u6761", 1)) : createCommentVNode("", true)
]);
};
}
@ -18812,7 +18812,8 @@ const _sfc_main$E = defineComponent({
pages: null,
total: null,
limit: null,
theme: null
theme: null,
count: null
},
emits: ["update:current", "update:limit", "change"],
setup(__props, { emit }) {
@ -18847,6 +18848,7 @@ const _sfc_main$E = defineComponent({
limits: __props.limits,
theme: __props.theme,
pages: __props.pages,
count: __props.count,
modelValue: unref(current),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(current) ? current.value = $event : null),
limit: unref(limit),
@ -18860,7 +18862,7 @@ const _sfc_main$E = defineComponent({
createVNode(unref(_sfc_main$2E), { type: "layui-icon-right" })
]),
_: 1
}, 8, ["total", "show-page", "show-skip", "show-limit", "show-count", "show-refresh", "limits", "theme", "pages", "modelValue", "limit"]);
}, 8, ["total", "show-page", "show-skip", "show-limit", "show-count", "show-refresh", "limits", "theme", "pages", "count", "modelValue", "limit"]);
};
}
});
@ -19648,12 +19650,13 @@ const _sfc_main$D = defineComponent({
showRefresh: __props.page.showRefresh,
showLimit: __props.page.showLimit,
showCount: __props.page.showCount,
count: __props.page.count,
current: __props.page.current,
"onUpdate:current": _cache[7] || (_cache[7] = ($event) => __props.page.current = $event),
limit: __props.page.limit,
"onUpdate:limit": _cache[8] || (_cache[8] = ($event) => __props.page.limit = $event),
onChange: change3
}, null, 8, ["total", "pages", "theme", "limits", "showSkip", "show-page", "showRefresh", "showLimit", "showCount", "current", "limit"])
}, null, 8, ["total", "pages", "theme", "limits", "showSkip", "show-page", "showRefresh", "showLimit", "showCount", "count", "current", "limit"])
])) : createCommentVNode("", true)
], 2)
], 512);

View File

@ -224,6 +224,6 @@ watch(
{{ t("page.confirm") }}
</button>
</span>
<span v-if="props.count">{{props.count}}</span>
<span v-if="count">{{count}}</span>
</div>
</template>

View File

@ -21,6 +21,7 @@ export interface TablePageProps {
total: number;
limit: number;
theme?: string;
count?:number;
}
const props = withDefaults(defineProps<TablePageProps>(), {
@ -65,6 +66,7 @@ const change = (pageData: any) => {
:limits="limits"
:theme="theme"
:pages="pages"
:count="count"
v-model="current"
v-model:limit="limit"
@change="change"

View File

@ -910,6 +910,7 @@ onBeforeUnmount(() => {
:showRefresh="page.showRefresh"
:showLimit="page.showLimit"
:showCount="page.showCount"
:count="page.count"
v-model:current="page.current"
v-model:limit="page.limit"
@change="change"

File diff suppressed because one or more lines are too long