Skip to content

Commit a9bfa36

Browse files
YunaiVgitee-org
authored andcommitted
!216 update src/components/Pagination/index.vue.
Merge pull request !216 from AKING/N/A
2 parents 65f9e3e + ff8a8e7 commit a9bfa36

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/Pagination/index.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,27 @@
88
:page-sizes="[10, 20, 30, 50, 100]"
99
:pager-count="pagerCount"
1010
:total="total"
11+
:small="isSmall"
1112
class="float-right mt-15px mb-15px"
1213
layout="total, sizes, prev, pager, next, jumper"
1314
@size-change="handleSizeChange"
1415
@current-change="handleCurrentChange"
1516
/>
1617
</template>
1718
<script lang="ts" setup>
18-
import { computed } from 'vue'
19+
import { computed, watchEffect } from 'vue'
20+
import { useAppStore } from '@/store/modules/app'
1921
2022
defineOptions({ name: 'Pagination' })
2123
24+
// 此处解决了当全局size为small的时候分页组件样式太大的问题
25+
const appStore = useAppStore()
26+
const layoutCurrentSize = computed(() => appStore.currentSize)
27+
const isSmall = ref<boolean>(layoutCurrentSize.value === 'small')
28+
watchEffect(() => {
29+
isSmall.value = layoutCurrentSize.value === 'small'
30+
})
31+
2232
const props = defineProps({
2333
// 总条目数
2434
total: {

0 commit comments

Comments
 (0)