mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-20 22:13:38 +08:00
39 lines
924 B
Vue
39 lines
924 B
Vue
<template>
|
|
<component
|
|
class="tmagic-design-pagination"
|
|
:is="uiComponent"
|
|
v-bind="uiProps"
|
|
@size-change="handleSizeChange"
|
|
@page-size-change="handleSizeChange"
|
|
@current-change="handleCurrentChange"
|
|
></component>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
|
|
import { getDesignConfig } from './config';
|
|
import type { PaginationProps } from './types';
|
|
|
|
defineOptions({
|
|
name: 'TMPagination',
|
|
});
|
|
|
|
const props = defineProps<PaginationProps>();
|
|
|
|
const emit = defineEmits(['size-change', 'current-change']);
|
|
|
|
const ui = getDesignConfig('components')?.pagination;
|
|
|
|
const uiComponent = ui?.component || 'el-pagination';
|
|
|
|
const uiProps = computed<PaginationProps>(() => ui?.props(props) || props);
|
|
|
|
const handleSizeChange = (...args: any[]) => {
|
|
emit('size-change', ...args);
|
|
};
|
|
const handleCurrentChange = (...args: any[]) => {
|
|
emit('current-change', ...args);
|
|
};
|
|
</script>
|