function getValueBySubValue(prevVal, path, value) { var tmp = value; if (path) { if (prevVal === undefined) { tmp = {}; } else { tmp = util.clone(prevVal); } setValueByPath(tmp, path, value); } return tmp; }
addAttr: function (name, attrConfig, override) { var self = this, attrs = self.getAttrs(), attr, // shadow clone cfg = util.merge(attrConfig); if (cfg.value && typeof cfg.value === 'object') { cfg.value = util.clone(cfg.value); console.log('please use valueFn instead of value for ' + name + ' attribute', 'warn'); } if ((attr = attrs[name])) { util.mix(attr, cfg, override); } else { attrs[name] = cfg; } return self; },