Files
workspace/code/g3soft-libs/docs/examples/pagination/hide-on-single.vue
T
2026-10-09 17:32:14 +08:00

17 lines
498 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// hideOnSinglePage:只有一页时整块隐藏
import { ref } from 'vue'
import { G3Pagination, G3Space, G3Switch } from '@g3soft/ui'
const current = ref(1)
const onlyOne = ref(false)
</script>
<template>
<G3Space direction="vertical" :size="12" style="display: flex">
<G3Switch v-model="onlyOne">只有一页(8 条)</G3Switch>
<G3Pagination v-model:current="current" :total="onlyOne ? 8 : 86" hide-on-single-page show-total />
</G3Space>
</template>