# MatchMessageCompetition AI 办赛赛制选择组件
用于 AI 办赛场景下的赛制选择功能,支持多种赛制类型展示和选择。
# 引入
import PressMatchMessageCompetition from "press-next/press-match-message-competition/press-match-message-competition";
# 代码演示
# 基础用法
<template>
<PressMatchMessageCompetition
:competition-formats="competitionFormats"
@format-click="handleFormatClick"
/>
</template>
<script setup>
const competitionFormats = [
{
id: 1,
name: "单淘汰赛",
description: "败者直接淘汰,胜者晋级下一轮",
},
{
id: 2,
name: "双淘汰赛",
description: "败者有一次复活机会,更公平的赛制",
},
{
id: 3,
name: "循环赛",
description: "所有队伍互相对战,积分排名",
},
];
const handleFormatClick = (format) => {
console.log("选择的赛制:", format);
};
</script>
# API
# Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| competition-formats | 赛制列表 | CompetitionFormat[] | [] |
# Events
| 事件名 | 说明 | 参数 |
|---|---|---|
| format-click | 点击赛制选项 | format: CompetitionFormat |
# CompetitionFormat 类型
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| id | 唯一标识 | string | number | - |
| name | 赛制名称 | string | - |
| description | 赛制描述 | string | - |
| icon | 图标地址 | string | - |