vxe-table-demonic
Version:
一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟列表、虚拟树、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、弹窗、自定义模板、渲染器、JSON 配置式...
29 lines (25 loc) • 1.15 kB
TypeScript
import { VxeTableDefines, VxeTableDataRow } from '../table'
/* eslint-disable no-use-before-define */
export namespace VxeGlobalFormatsHandles {
export interface FormatsOptions<D = VxeTableDataRow> {
cellFormatMethod?: (params: FormatMethodParams<D>, ...args: any[]) => string | number
}
export interface FormatMethodParams<D = VxeTableDataRow> {
cellValue: any
row: D
column: VxeTableDefines.ColumnInfo<D>
}
}
/**
* 全局格式化
*/
export interface VxeGlobalFormats {
mixin(opts: {
[name: string]: VxeGlobalFormatsHandles.FormatsOptions<any> | ((params: VxeGlobalFormatsHandles.FormatMethodParams<any>, ...args: any[]) => string | number)
}): VxeGlobalFormats
has(name: string): boolean
get(name: string): VxeGlobalFormatsHandles.FormatsOptions<any>
add(name: string, options: VxeGlobalFormatsHandles.FormatsOptions<any> | ((params: VxeGlobalFormatsHandles.FormatMethodParams<any>, ...args: any[]) => string | number)): VxeGlobalFormats
delete(name: string): void
forEach(callback: (options: VxeGlobalFormatsHandles.FormatsOptions<any>, name: string) => void): void
}