Skip to content

Instantly share code, notes, and snippets.

@Jantho1990
Created August 8, 2018 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jantho1990/7533a321992d140f52397feaa8066b33 to your computer and use it in GitHub Desktop.
Save Jantho1990/7533a321992d140f52397feaa8066b33 to your computer and use it in GitHub Desktop.
StarRating Vue -- 8d
<template>
<div id="app">
<img src="./assets/logo.png">
<star-rating
:rating="rating"
/>
<rating-inputs
:rating="rating"
@rating-update="handleRatingUpdate"
/>
</div>
</template>
<script>
// ...
export default {
// ...
data () {
return {
rating: 5
}
},
methods: {
handleRatingUpdate (data) {
let {
rating
} = data
this.rating = rating
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment