We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
2.3.4
https://jsfiddle.net/v0dbnvv0/1/
Vue.set(array, "indexInTheArrayInString", value) is not working as expected compare to Vue.set(array, "indexInTheArrayInNumericForm", value)
Both version working the same i suppose?
Watcher on the value are not triggered even if the value is correctly changed in the model
My currently fixed in my code: export function AdvVueSet(obj, path, value) { if (!isNaN(path)) { path = +path; } Vue.set(obj, path, value); }
The text was updated successfully, but these errors were encountered:
I think maybe there should be an improvement, as we could access and assign array item via string type index. In fact, a[1] is equal to a['1']. Refer http://www.ecma-international.org/ecma-262/5.1/#sec-15.4
a[1]
a['1']
We could check the key, and try to convert it to a number type.
vue/src/core/observer/index.js
Line 192 in 1648adb
Sorry, something went wrong.
Probably just check if the string is an integer because it has to be an index.
Thanks @Peter-WF
fix: improve Vue.set/Vue.delete API to support multi type of array in…
eea0920
…dex (#5973) related #5884
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Version
2.3.4
Reproduction link
https://jsfiddle.net/v0dbnvv0/1/
Steps to reproduce
Vue.set(array, "indexInTheArrayInString", value) is not working as expected compare to Vue.set(array, "indexInTheArrayInNumericForm", value)
What is expected?
Both version working the same i suppose?
What is actually happening?
Watcher on the value are not triggered even if the value is correctly changed in the model
My currently fixed in my code:
export function AdvVueSet(obj, path, value) {
if (!isNaN(path)) {
path = +path;
}
Vue.set(obj, path, value);
}
The text was updated successfully, but these errors were encountered: