UNPKG

press-next

Version:

Vue3 组件库,支持 Composition API

80 lines (70 loc) 1.74 kB
// demo-data/index.ts export interface TeamInfo { id: string | number; name: string; avatar?: string; } export interface MatchInfo { id: string | number; title: string; // 比赛标题,如 "16进8 BO3" gameMode: string; // 游戏模式,如 "经典(第三人称)" mapName: string; // 地图名称,如 "度假岛" playerCount: string; // 人数,如 "四人" status: 'not-started' | 'in-progress' | 'finished'; // 比赛状态 statusText: string; // 状态文本,如 "未开始" leftTeam: TeamInfo; rightTeam: TeamInfo; } export interface OperationItem { id: string; name: string; icon: string; action: string; } export function getMockData() { const DEFAULT_AVATAR = 'https://image-1251917893.file.myqcloud.com/tip-project/pubg/pubg-match/teamate-default-avatar.png'; const matchInfo: MatchInfo = { id: 1, title: '16进8 BO3', gameMode: '经典(第三人称)', mapName: '度假岛', playerCount: '四人', status: 'not-started', statusText: '未开始', leftTeam: { id: 1, name: '最强大白兔战队哈哈', avatar: DEFAULT_AVATAR, }, rightTeam: { id: 2, name: '三好杯专业战队', avatar: DEFAULT_AVATAR, }, }; const operations: OperationItem[] = [ { id: 'reset', name: '重置比赛', icon: 'pmg-icon-reset', action: 'reset', }, { id: 'change-score', name: '改判比分', icon: 'pmg-icon-rejudge', action: 'change-score', }, ]; const componentProps = { matchInfo, operations, zIndex: 100, customClass: '', }; return componentProps; } const DEMO_DATA = { ...getMockData(), }; export default DEMO_DATA;