Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hexonthebeach/rank-emoji

Add sports-medal emoji to a list easily
https://github.com/hexonthebeach/rank-emoji

component emoji medal ranking vue

Last synced: 5 days ago
JSON representation

Add sports-medal emoji to a list easily

Awesome Lists containing this project

README

        

# rank-emoji
Vue component for easily adding ranking emoji to a list.

It will add the medal-emoji by default to the first three items in the list

* 🥇
* 🥈
* 🥉

The rest will get a normal unmarked medal by default 🏅

### Properties You can work with
Disable the unmarked medals from showing after the top 3

`v-bind:with-between="false"`

Show the special emoji character for last-place

`v-bind:is-last="true"`

`v-bind:is-last="index == winners.length-1"` (practical example)

Set different Emoji

`v-bind:emojis="{top:['💝','💘','💖'],between:'❤',last:'💔'}"`

To set your own Emoji you can Extend the RankEmoji component, see /src/RankPies.vue for example

## installation
use npm to get this into your app, from the root :

`npm i rank-emoji`

## code example
Add this component in the loop, it will take care of the rest automatically.

```




import RankEmoji from 'rank-emoji';

export default {
...
components:{
... ,
RankEmoji
},
data:function () {
return {
winners: [
{name:'Neil Armstrong'},
{name:'Buzz Aldrin'},
{name:'Pete Conrad'},
{name:'Alan Bean'},
{name:'Alan Shepard'},
{name:'Edgar Mitchell'},
]
}
}
}

```