Skip to content

Knockout Wheel ​

Vue 已实现 · 还原验收 0/1 · 上游演示 · 固定版本源码

原设计:Avinit

预览 ​

Final · Atlas 2 – 1 West

用法 ​

vue
<script setup lang="ts">
import { KnockoutWheel, type TournamentRound } from 'beui-vue'
const names = ['Atlas','North','Cedar','Ocean','West','Silver','East','Dawn']
const rounds:TournamentRound[] = []
let playing = [...names]
while (playing.length >= 2) {
  const round:TournamentRound = {name:playing.length===2?'Final':playing.length===4?'Semifinal':'Quarterfinal',matches:[]}
  for (let index=0; index<playing.length; index+=2) {
    round.matches.push({id:`${playing.length}-${index}`,home:{team:{name:playing[index]},score:2},away:{team:{name:playing[index+1]},score:1},winner:'home'})
  }
  rounds.push(round)
  playing = playing.filter((_,index) => index%2 === 0)
}
</script>
<template><KnockoutWheel :rounds="rounds" /></template>

API ​

rounds 按首轮到决赛传入对阵,initialRound 选择最外圈。在节点上聚焦、悬停或点击查看本场比分。

上游变体 ​

还原验收 ​

基于 beUI 的独立 Vue 移植,依 MIT 许可证分发。