Created
August 7, 2018 23:36
-
-
Save Jantho1990/238f8a9037262fcfafff0f0b1e2b0978 to your computer and use it in GitHub Desktop.
StarRating Vue -- 8c
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 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