Git Product home page Git Product logo

Comments (4)

kazupon avatar kazupon commented on May 21, 2024

I tried to reproduce this issue.
https://jsfiddle.net/kazupon/y1qtk2tq/16/

I'll try to improve this issue.

from vue-i18n.

saumets avatar saumets commented on May 21, 2024

Nice example! It is basically demonstrating what we are seeing as well, and when this error occurs it kills all Vue reactivity (in your example, if you try and switch back to 'en' from 'ja' the content does not update locale change).

I find it very odd though. Where in your example are you mutating state outside of the mutation handler? Does mutating state in the plugin count as mutating state outside mutation handlers?

In our example we are NOT using Vuex to change language at all. As you'll see in my original post above we are changing language in the router using the beforeEach hook.

We are very confused why this error only appears in strict: true mode and when we switch to french, and go to the next route. Any ideas?

Thanks for trying to reproduce!

from vue-i18n.

kazupon avatar kazupon commented on May 21, 2024

I find it very odd though. Where in your example are you mutating state outside of the mutation handler? Does mutating state in the plugin count as mutating state outside mutation handlers?

The cause of vuex mutation error is bacause force updating with watcher.update in Vue instance.
This error occur in vue 1.0.x.
See the below implementation code:
https://github.com/kazupon/vue-i18n/blob/dev/src/override.js#L6-L8

by the way, In Vue 2.0, it does not occur.
http://jsfiddle.net/kazupon/k2z77mv7/7/

We are very confused why this error only appears in strict: true mode and when we switch to french, and go to the next route. Any ideas?

I think you can avoid with using $store.state.
see the jsfiddle example:
http://jsfiddle.net/kazupon/gva8x8ct/2/

$t or $tc can pass the lang.

from vue-i18n.

kazupon avatar kazupon commented on May 21, 2024

release v6.0.0
https://github.com/kazupon/vue-i18n/releases/tag/v6.0.0

from vue-i18n.

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.