vue-rate-it icon indicating copy to clipboard operation
vue-rate-it copied to clipboard

Vuejs warns about the direct mutation of the rating property

Open yakubenko opened this issue 6 years ago • 1 comments

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. screenshot from 2018-09-12 11-25-23

yakubenko avatar Sep 12 '18 06:09 yakubenko

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.

https://forum.vuejs.org/t/vue-warn-attrs-is-readonly/18053

yakubenko avatar Sep 12 '18 07:09 yakubenko