press-next
Version:
Vue3 组件库,支持 Composition API
96 lines (89 loc) • 1.7 kB
text/typescript
export interface Column {
key: string;
title: string;
width?: string;
minWidth?: string;
align?: 'left' | 'center' | 'right';
sortable?: boolean;
}
export function getMockData() {
// 基础列配置
const basicColumns: Column[] = [
{
key: 'rank',
title: '排名',
width: 'auto',
align: 'left',
sortable: false,
},
{
key: 'nickname',
title: '玩家昵称',
width: '1.2rem',
align: 'center',
sortable: false,
},
{
key: 'contact',
title: '联系方式',
width: '1.2rem',
align: 'center',
sortable: false,
},
{
key: 'kills',
title: '击杀数',
width: '1.2rem',
align: 'center',
sortable: false,
},
{
key: 'store',
title: '参与门店',
width: '1.2rem',
align: 'center',
sortable: false,
},
];
// 赛程表列配置
const scheduleColumns: Column[] = [
{
key: 'rounds',
title: '轮次',
width: '1.2rem',
align: 'left',
sortable: false,
},
{
key: 'settings',
title: '开赛设置',
width: '2rem',
align: 'center',
sortable: false,
},
{
key: 'ways',
title: '决赛方式',
width: '1.4rem',
align: 'center',
sortable: false,
},
{
key: 'operate',
title: '操作',
width: '1.6rem',
align: 'center',
sortable: false,
},
];
// 组件属性配置
const componentProps = {
basicColumns,
scheduleColumns,
};
return componentProps;
}
const DEMO_DATA = {
columns: getMockData().basicColumns,
};
export default DEMO_DATA;