You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
vue & vue-i18n version
8.18.2
Steps to reproduce
i think ,the function
watchI18nData
do not work correct.because the code is
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
What is actually happening?
The text was updated successfully, but these errors were encountered: