🐛(component): 修复 total 为 0 时禁用下一页操作
This commit is contained in:
parent
fccdf27ae2
commit
df8b318bdc
@ -84,7 +84,7 @@ const prev = () => {
|
||||
};
|
||||
|
||||
const next = () => {
|
||||
if (currentPage.value === maxPage.value) {
|
||||
if (currentPage.value === maxPage.value || maxPage.value === 0) {
|
||||
return;
|
||||
}
|
||||
currentPage.value++;
|
||||
@ -133,6 +133,7 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
{{ maxPage }}
|
||||
<div class="layui-laypage layui-laypage-default">
|
||||
<span v-if="showCount" class="layui-laypage-count"
|
||||
>共 {{ total }} 条 {{ maxPage }} 页</span
|
||||
@ -171,8 +172,8 @@ watch(
|
||||
href="javascript:;"
|
||||
class="layui-laypage-next"
|
||||
:class="[
|
||||
currentPage === maxPage ? 'layui-disabled' : '',
|
||||
theme && currentPage !== maxPage ? 'layui-laypage-a-' + theme : '',
|
||||
currentPage === maxPage || maxPage === 0 ? 'layui-disabled' : '',
|
||||
theme && (currentPage !== maxPage && maxPage !== 0) ? 'layui-laypage-a-' + theme : '',
|
||||
]"
|
||||
@click="next()"
|
||||
>
|
||||
|
@ -143,7 +143,7 @@ export default {
|
||||
setup() {
|
||||
|
||||
const limit4 = ref(20)
|
||||
const total4 = ref(100)
|
||||
const total4 = ref(0)
|
||||
const change4 = ({ current, limit }) => {
|
||||
layer.msg("current:" + current + " limit:" + limit);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user