Skip to content

Plinko ​

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

原设计:Avinit

预览 ​

Plinko

Drop a ball to start.

用法 ​

vue
<script setup lang="ts">
import { ref } from 'vue'
import { Plinko, plinkoSlots } from 'beui-vue'

const slots = plinkoSlots(8, { center: 1, edge: 20 })
const landed = ref('Drop a ball to start.')
function land(slot: number, value: string | number) { landed.value = `Slot ${slot + 1} · ${value}×` }
</script>

<template><div><Plinko :slots="slots" :max-balls="4" @land="land" /><p>{{ landed }}</p></div></template>

API ​

rows 生成钉阵,slots 可覆盖各落点值。maxBalls 控制同时运行的球数,@land 接收从零开始的落点和显示值。plinkoSlots 生成对称数列,减少动态效果时直接显示结果。

还原验收 ​

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