Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchI18nData don't work correct #929

Closed
celinezhi opened this issue Jul 2, 2020 · 2 comments
Closed

watchI18nData don't work correct #929

celinezhi opened this issue Jul 2, 2020 · 2 comments
Labels
Status: Need More Info Lacks enough info to make progress

Comments

@celinezhi
Copy link

vue & vue-i18n version

8.18.2

Steps to reproduce

i think ,the function watchI18nData do not work correct.
because the code is

 watchI18nData (): Function {
    const self = this
    return this._vm.$watch('$data', () => {
      let i = self._dataListeners.length
      while (i--) {
        Vue.nextTick(() => {
          self._dataListeners[i] && self._dataListeners[i].$forceUpdate()
        })
      }
    }, { deep: true })
  }

in the code , it use the while statement. the variable i is declared outside the loop.
And all the update function is in Vue.nextTick. so they executed after the next DOM update cycle.
so when they executed, all the i is -1.

What is Expected?

expected use for .
or i misunderstand how the function working

for (let i = this._dataListeners.length; i > -1; i -= 1) {
        Vue.nextTick(() => {
          console.log(i, '_dataListeners--------------')
          this._dataListeners[i] && this._dataListeners[i].$forceUpdate();
        });
      }

What is actually happening?

@exoego
Copy link
Collaborator

exoego commented Aug 5, 2020

I am sorry, but it is unclear for me how this issue is related to vue-i18n.
Could you explain what is a reason you think this is an issue in vue-i18n.

@exoego exoego added the Status: Need More Info Lacks enough info to make progress label Aug 5, 2020
@kazupon
Copy link
Owner

kazupon commented Nov 21, 2020

close due to in-acitivty

@kazupon kazupon closed this as completed Nov 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Need More Info Lacks enough info to make progress
Projects
None yet
Development

No branches or pull requests

3 participants