Package Exports
- vue-set-value
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-set-value) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue-set-value
Create nested values and any intermediaries on vue reactive objects using dot notation (
'a.b.c') paths.
This project is only fork of great package set-value made by Jon Schlinkert
Install
Install with npm:
$ npm install --save vue-set-valueUsage
var vueDeepSet = require('vue-set-value');
vueDeepSet(object, prop, value);Params
object{object}: The object to setvalueonprop{string}: The property to set. Dot-notation may be used.value{any}: The value to set onobject[prop]
Examples
Updates and returns the given object:
vueDeepSet(target, 'a.b.c', 'd');
console.log(target);
//=> { a: { b: { c: 'd' } } }Escaping
Escaping with backslashes
Prevent set-value from splitting on a dot by prefixing it with backslashes:
console.log(vueDeepSet(target, 'a\\.b.c', 'd'));
//=> { 'a.b': { c: 'd' } }
console.log(vueDeepSet(target, 'a\\.b\\.c', 'd'));
//=> { 'a.b.c': 'd' }License
Copyright © 2018, Yaroslav Dobzhanskij. Copyright © 2018, Jon Schlinkert. Released under the MIT License.