press-next
Version:
Vue3 组件库,支持 Composition API
83 lines (73 loc) • 1.8 kB
text/typescript
/**
* 重置比赛弹窗组件的模拟数据
*/
// 比赛组接口
interface MatchGroup {
title: string;
desc: string;
}
// 插槽使用示例接口
interface SlotExample {
name: string;
description: string;
usage: string;
}
// 比赛组模拟数据
const MATCH_GROUPS: MatchGroup[] = [
{ title: '第一局第 1 组', desc: '8支队伍' },
{ title: '第一局第 2 组', desc: '6支队伍' },
{ title: '第一局第 3 组', desc: '4支队伍' },
{ title: '第一局第 4 组', desc: '2支队伍' },
];
// 插槽使用示例数据
const SLOT_EXAMPLES: SlotExample[] = [
{
name: 'match-groups-card',
description: '自定义整个比赛组卡片区域',
usage: '可以完全自定义比赛组的展示样式和交互逻辑',
},
{
name: 'all-checked-btn',
description: '自定义全选按钮',
usage: '可以自定义全选按钮的样式和文字',
},
{
name: 'confirm-btn',
description: '自定义确认按钮',
usage: '可以自定义确认按钮的样式和文字',
},
];
/**
* 获取重置比赛弹窗的模拟数据
* @returns {Object} 包含组件所需的测试数据
*/
export function getMockData() {
return {
// 比赛组数据
matchGroups: [...MATCH_GROUPS],
// 插槽示例数据
slotExamples: [...SLOT_EXAMPLES],
};
}
/**
* 获取比赛组数据
* @returns {MatchGroup[]} 比赛组列表
*/
export function getMatchGroups(): MatchGroup[] {
return [...MATCH_GROUPS];
}
/**
* 获取插槽示例数据
* @returns {SlotExample[]} 插槽示例列表
*/
export function getSlotExamples(): SlotExample[] {
return [...SLOT_EXAMPLES];
}
// 导出类型
export type { MatchGroup, SlotExample };
// 导出默认数据
export default {
getMockData,
getMatchGroups,
getSlotExamples,
};