Created
August 8, 2018 01:21
-
-
Save Jantho1990/7533a321992d140f52397feaa8066b33 to your computer and use it in GitHub Desktop.
StarRating Vue -- 8d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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