press-next
Version:
Vue3 组件库,支持 Composition API
70 lines (60 loc) • 1.98 kB
text/typescript
export function getMockData() {
// 标签数据接口
interface TagItem {
text: string;
type?: 'default' | 'quantity';
}
// 团队信息接口
interface TeamInfo {
id: string;
name: string;
avatars?: string[];
currentMembers: number;
logo: string;
maxMembers: number;
}
// 带头像列表的团队信息
const teamInfoWithAvatars: TeamInfo = {
id: '1',
avatars: [
'https://image-1251917893.file.myqcloud.com/general-match-components/img/common/avatar/avatar-pic.png',
'https://image-1251917893.file.myqcloud.com/general-match-components/img/common/avatar/avatar-pic.png',
'https://image-1251917893.file.myqcloud.com/general-match-components/img/common/avatar/avatar-pic.png',
'https://image-1251917893.file.myqcloud.com/general-match-components/img/common/avatar/avatar-pic.png',
'https://image-1251917893.file.myqcloud.com/general-match-components/img/common/avatar/avatar-pic.png',
],
name: '陈若名字有八个字最多15个字',
logo: 'https://image-1251917893.file.myqcloud.com/general-match-components/img/common/avatar/avatar-test.png',
currentMembers: 5,
maxMembers: 24,
};
// 简单模式的团队信息
const teamInfoSimple: TeamInfo = {
id: '2',
name: '简单战队',
logo: 'https://image-1251917893.file.myqcloud.com/general-match-components/img/common/avatar/avatar-test.png',
currentMembers: 0,
maxMembers: 0,
};
// 标签配置
const tagItems: TagItem[] = [
{ text: '无要求', type: 'default' },
{ text: '广东深圳', type: 'default' },
];
const tagItemsSimple: TagItem[] = [
{ text: 'ID 1234567890', type: 'default' },
{ text: '3人', type: 'quantity' },
];
// 组件属性配置
const componentProps = {
teamInfoWithAvatars,
teamInfoSimple,
tagItems,
tagItemsSimple,
};
return componentProps;
}
const DEMO_DATA = {
...getMockData(),
};
export default DEMO_DATA;