refactor(components): refactor pagination (#3526)

* refactor(components): refactor pagination

* fix: tests

* fix: emits

* refactor: improve props
This commit is contained in:
三咲智子
2021-09-22 01:19:04 +08:00
committed by GitHub
parent bb5ec2c487
commit 6256189100
15 changed files with 474 additions and 487 deletions

View File

@@ -1,3 +1,4 @@
import type { Mutable } from './types'
import type { PropType } from 'vue'
/**
@@ -69,5 +70,7 @@ export function buildProp<
}
export const keyOf = <T>(arr: T) => Object.keys(arr) as Array<keyof T>
export const mutable = <T extends readonly any[]>(val: T) =>
val as Mutable<typeof val>
export const componentSize = ['large', 'medium', 'small', 'mini'] as const

View File

@@ -49,3 +49,5 @@ export type TimeoutHandle = ReturnType<typeof global.setTimeout>
export type ComponentSize = 'large' | 'medium' | 'small' | 'mini'
export type StyleValue = string | CSSProperties | Array<StyleValue>
export type Mutable<T> = { -readonly [P in keyof T]: T[P] }