/** * @file 分页组件 * @author fuqiangqiang@baidu.com */ import './style/index'; import Base from 'santd/base'; import Icon from '../icon'; import {classCreator} from '../core/util'; import pagination from './Pagination'; import localeReceiver from '../locale-provider/receiver'; import { PaginationData, TItemRender, TShowTotal } from './interface'; interface State { componentName: string; } export interface Props extends Partial { /** * 用于自定义页码的结构 */ itemRender?: TItemRender | boolean; showTotal?: TShowTotal; } const prefixCls = classCreator('pagination')(); class PrevIcon extends Base { static components = { 's-icon': Icon } static template = ` ` }; class NextIcon extends Base { static components = { 's-icon': Icon } static template = ` ` }; class JumpPrevIcon extends Base { static components = { 's-icon': Icon } static template = `
•••
` }; class JumpNextIcon extends Base { static components = { 's-icon': Icon } static template = `
•••
` }; export default class extends Base { static components = { pagination, previcon: PrevIcon, nexticon: NextIcon, jumpprevicon: JumpPrevIcon, jumpnexticon: JumpNextIcon } handleShowSizeChange(payload: {current: number, pageSize: number}) { this.fire('showSizeChange', payload); } handleChange(payload: {page: number, pageSize: number}) { this.fire('change', payload); } inited() { this.data.set('itemRender', !!this.sourceSlots.named.itemRender); localeReceiver.inited.call(this); } initData() { return { componentName: 'Pagination' }; } static computed = localeReceiver.computed static template = `
` };