Skip to content

Instantly share code, notes, and snippets.

@Jantho1990
Created August 7, 2018 23:36
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/238f8a9037262fcfafff0f0b1e2b0978 to your computer and use it in GitHub Desktop.
Save Jantho1990/238f8a9037262fcfafff0f0b1e2b0978 to your computer and use it in GitHub Desktop.
StarRating Vue -- 8c
<template>
<div class="rating-inputs">
<label for="rating">Rating</label>
<input
name="rating"
type="number"
v-model="rating_"
v-on:input="handleRating"
/>
</div>
</template>
<script>
export default {
// ...
methods: {
handleRating () {
let {
rating_
} = this
this.$emit('rating-update', {
rating: Number(rating_)
})
}
},
// ...
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment