This is going to be short and sweet. I have built the simplest possible rating editor in Vue 3 composition API an this is how I’ve done it.
A couple of details worth noting:
- Each star is a clickable button
- The star is an emoji
- Because the emoji comes with color, we apply a class
grayto apply a
grayscalefilter when value is less than the current star
- Upon a star button click, we update the
modelValueto the corresponding value which renders the stars again
That’s it. Have fun!