vue-rate-it
vue-rate-it copied to clipboard
Vuejs warns about the direct mutation of the rating property
Hello! Thank you for the great component. I'm currently trying to integrate it in my project. Here is the piece of code that I'm using.
<fa-rating
:glyph="star"
:spacing="3"
inactive-color="#d8cdc0"
active-color="#e07706"
:increment="0.5"
:fixed-points="2"
v-model="rating">
</fa-rating>
Unfortunately, I receive warnings and errors when I use v-model
I get no errors when I use :rating
, but in both cases, I do not get any events fired.
I attach a screenshot. Please, have a look.
After some investigation, I managed to get it working. In my own components, I include Vuejs using this statement import Vue from 'vue/dist/vue.esm';
So, I explicitly tell Webpack to use the vue.esm
build. After looking in the source code of the vue-rate-it
I saw that it uses import Vue from 'vue';
, hence I had to add an alias for the Vuejs in my webpack.conf.js.
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
}
After doing so everything started working as expected. This forum thread helped me with the issue.