Currently, I am working on creating a star-rating component using Vue.js. The issue I am facing is that when I click on the stars, they fade out before displaying the final result. You can find the JSFiddle link below:
https://jsfiddle.net/L6L34ybr/5/
This behavior differs from the effect showcased in the code I mostly copied from:
http://codepen.io/nouveller/pen/qOxKBJ
I suspect that the issue may be related to the rating
property.
Currently, I have inline bound the class like so:
:class="{selected: ((value >= rating && value != null))}
.
However, I would prefer to bind it with an object using something like
:class="selected: someFunction(rating)"
, and then define the someFunction(rating)
in the computed property or another location outside of the html. Is there a way to achieve this?