1.0.1 • Published 7 years ago

vue-favorite v1.0.1

Weekly downloads
11
License
-
Repository
github
Last release
7 years ago

vue-favorite

A Vue favorite/like/recommend component.

Note: vue-favorite uses font-awesome by default and you will be required to pull it in your templates.

Installation

npm install vue-favorite

Usage

import Vue from 'vue'
import Favorite from 'vue-favorite'

new Vue({
  el: '#app',
  components: { Favorite }
})

Browser Usage

<script src="path/to/vue/vue.min.js"></script>
<script src="path/to/vue-avatar/dist/vue-favorite.js"></script>

new Vue({
  el: '#app',
  components: { Favorite }
})

After that, you can use it in your templates:

<favorite
    :post=1
    :favorited=false
></favorite>

Props

NameRequiredTypeDecsription
postYNumberID of the post
favoritedYBooleandetermine whether the post has been marked as favorite

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build