JonathanDn / vue-stars-rating

A highly dynamic vue stars rating component, similar to google play stars rating
103 stars 18 forks source link

Bind config Object directoly to v-bind - better performance & default values #2

Open JonathanDn opened 5 years ago

JonathanDn commented 5 years ago

When binding it directly to v-bind, performance would be better, And I would be able to declarre default values in the props rather than have to set them during mount/created.

To sum up this refactor will grant:

  1. Better Performance - a more flatten mapping of the binded props compared to a Watch Deep mapping that is more resource consumable for vue virtual DOM
  2. Easyness of Usage - Access to default values, types and more on each binded prop without need to declare and use setters
  3. Readability & Cleanness of code - Less code in the template & more readible.

Example: Instead of this: <selector v-bind:configData=configData">

Write this

And declare each prop object in the props of the selector component

JonathanDn commented 5 years ago