A Vue 3 component for creating a customizable 'Wheel of Fortune' style lottery spinner. Current stable version is 2.1.0. It supports both canvas and image rendering modes, with features like weighted prizes, custom styling via slots, verification callbacks, and TypeScript support. Distinguished by its dual rendering approach and simple API. Peer dependency on vue ^3.2.0. Actively maintained with a vue2 branch available.
npm install vue-fortune-wheelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Basic usage of vue-fortune-wheel with canvas mode, demonstrating required imports, prize setup, and rotate end event handling.
For Vue 2 projects, use 'npm install vue-fortune-wheel@1' or switch to Vue 3.
Ensure all prize objects have 'id' as positive integer (e.g., 1, 2, 3).
If using weighted mode, ensure each prize has a 'weight' integer field. Otherwise, set 'useWeight' to false.
Use template ref: <FortuneWheel ref="wheelEl" /> then wheelEl.value.startRotate()
Update to use boolean value for 'verify' prop.
Use template ref: <FortuneWheel ref="wheelEl" /> then access 'wheelEl.value.startRotate()'
Use import 'vue-fortune-wheel/style.css'
Use import FortuneWheel from 'vue-fortune-wheel'