vue-tournament-bracket
Vue component for rendering single elemination tournament brackets.
Installation and component usage
Install component via:
npm install vue-tournament-bracket
Example:
Third place play-off
Here is the way to represent third place play-off:
Bottom slot
There is slot with whole match props, use it in following way:
May be useful for example for showing tooltips etc.
Game object
Game object requires player1
and player2
objects. You can also add your own and e.g. reuse it in players-extension-bottom
slot.
Following properties are forbidden and are going to be replaced with undefined
:
games
hasParent
See matchProperties
in GamePlayers
for details.
Player object
Player object requires: id
property, winner
is optional, rest is up to you - rendering is customizable via scoped slot.
id
is being used for highlightingwinner
property applies color for player accordingly, can be alsonull
- player's color will be gray
Styling
Apply your custom style by overriding Bracket
component CSS. See BracketNode.vue for all styles being used.
Development
Checkout repository and:
npm install
npm run serve
Then open browser and test your changes using App.vue
main component for development purposes.
See package.json
to discover available commands.
Releasing
npm test
npm run eslint
npm run build
git commit
npm version <version>
git push
npm publish --access=public