rank-emoji

Ranking with Emoji Medals
629
Install
npm install rank-emoji
Latest Version:1.0.0
Vue:2
License:MIT
Last Updated:Mar 4, 2021
Links: GitHub  ·  npm
Maintainer: hexonthebeach

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.

<template>
  <div>
    <div v-for="(winner, index) in winners"
         v-bind:key="index"
    >

      <rank-emoji v-bind:rank="index"></rank-emoji>

      <span v-text="winner.name"></span>
    </div>
  </div>
</template>

<script>
    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'},
                ]
            }
        }
    }
</script>

Related Packages

nuxt-emoji

An Emoji component for your Nuxt 3 project.

7,980 33
vuemoji-picker

Vue 2 and 3 lightweight emoji picker.

124,448 72
@zaichaopan/emoji-picker

An elegant emoji picker built with Vue.

6,947
@imndx/v-emoji-picker-vue3

Base on joaoeudes7's V-Emoji-Picker , add sticker supportοΌŒε’žεŠ εŠ¨ζ€θ‘¨ζƒ…ζ”―ζŒγ€‚

3,357 1

Version History

Version Released Vue License
1.0.0 ^2.6.10 MIT