Git Product home page Git Product logo

Comments (9)

neves avatar neves commented on July 25, 2024

Can you share the line of code that is throwing that error?
I'm not sure that's vue-the-mask related.

from vue-the-mask.

luismiguelprs avatar luismiguelprs commented on July 25, 2024

Here is the complete console warning that I received.

[Vue warn]: Error in callback for watcher "function () { return this._data.$$state }": "Error: [vuex] Do not mutate vuex store state outside mutation handlers."

(found in )
warn @ vue.esm.js?65d7:479
handleError @ vue.esm.js?65d7:562
run @ vue.esm.js?65d7:2974
update @ vue.esm.js?65d7:2946
notify @ vue.esm.js?65d7:778
mutator @ vue.esm.js?65d7:833
r @ vue-the-mask.js?3d13:1
t.a @ vue-the-mask.js?3d13:1
t.a @ vue-the-mask.js?3d13:1
callHook$1 @ vue.esm.js?65d7:5750
_update @ vue.esm.js?65d7:5682
updateDirectives @ vue.esm.js?65d7:5656
patchVnode @ vue.esm.js?65d7:5440
patch @ vue.esm.js?65d7:5575
Vue._update @ vue.esm.js?65d7:2424
updateComponent @ vue.esm.js?65d7:2538
get @ vue.esm.js?65d7:2881
run @ vue.esm.js?65d7:2958
flushSchedulerQueue @ vue.esm.js?65d7:2724
(anonymous) @ vue.esm.js?65d7:701
nextTickHandler @ vue.esm.js?65d7:648
vue.esm.js?65d7:566 Error: [vuex] Do not mutate vuex store state outside mutation handlers.
at assert (vuex.esm.js?edaa:96)
at Vue$3.store._vm.$watch.deep (vuex.esm.js?edaa:637)
at Watcher.run (vue.esm.js?65d7:2972)
at Watcher.update (vue.esm.js?65d7:2946)
at Dep.notify (vue.esm.js?65d7:778)
at Array.mutator (vue.esm.js?65d7:833)
at r (vue-the-mask.js?3d13:1)
at t.a (vue-the-mask.js?3d13:1)
at t.a (vue-the-mask.js?3d13:1)
at callHook$1 (vue.esm.js?65d7:5750)

from vue-the-mask.

neves avatar neves commented on July 25, 2024

Which line in your code that if you comment the error stops?

from vue-the-mask.

luismiguelprs avatar luismiguelprs commented on July 25, 2024

Aparently, the bug occour when the mask comes from a vuex state....
Ex:

`
< template>
< the-mask type="text" v-model="message" :mask="setup.mask" />
< /template>

< script>
import {TheMask} from 'vue-the-mask'
export default {
props: {
setup: Object
},
data: function () {
return {
message: null
}
},
components: {
TheMask
}
}
< /script>
`

My setup comes from vuex.

from vue-the-mask.

neves avatar neves commented on July 25, 2024

Are you using v-model with the-mask and a data from Vuex?

from vue-the-mask.

luismiguelprs avatar luismiguelprs commented on July 25, 2024

Yes. Sorry if that is not a good pratice. I'm starting with Vue this week rsrrsrsrs

from vue-the-mask.

neves avatar neves commented on July 25, 2024

Yes, that's a rule of thumb for Vuex.
Happy coding!

from vue-the-mask.

luismiguelprs avatar luismiguelprs commented on July 25, 2024

Sorry... I guess that I misunderstood your question... my v-model (message) isn't from vuex, just my prop (setup).

from vue-the-mask.

luismiguelprs avatar luismiguelprs commented on July 25, 2024

I think the warning just happen when the mask is from vuex and is an array.

from vue-the-mask.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.