Skip to content

Version 2.0.0

Compare
Choose a tag to compare
@craigh411 craigh411 released this 01 Nov 16:25
· 22 commits to master since this release

Release Notes

This version includes some breaking changes for the fa-rating component, so the major version has been bumped. It is strongly recommended that users upgrade to this version as it has a greatly reduced file size

What's New

  • The font-awesome port has been separated from the main bundle reducing file size from 700kB to 19kB (Fixes #9 )
  • Font awesome glyphs have been placed in to individual files which can now been imported from vue-rate-it/glyphs using the font-awesome glyph name (excluding preceding 'fa'):
import ThumbsUp from 'vue-rate-it/glyphs/thumbs-up'
  • You are now required to register the font awesome glyphs you want to use directly on the fa-rating component
<template>
  <fa-rating :glyphs="thumbsUp"></fa-rating>
</template>

<script type="text/javascript">
  import {FaRating} from 'vue-rate-it'
  import ThumbsUp from 'vue-rate-it/glyphs/thumbs-up'

  export default {
    components: {
      FaRating
    },
    created() {
       this.thumbsUp = ThumbsUp
    },
    data(){
      return {
        thumbsUp: ''
      }
    }  
  }
</script>
  • The fa-rating CDN exposes glyphs via VueRate.Glyphs['glyph-name'], so if you are using the CDN you will need to register the glyph like so:
new Vue({
    el: '#app',
    created() {
       this.thumbsUp = VueRateIt.Glyphs['thumbs-up']
    },
    data(){
      return {
        thumbsUp: ''
      }
    }  
});

The CDN still includes the entire port of font-awesome glyphs and is over 700kB is size. It is strongly recommended you so not use it for production purposes.