(target, sourceKey, key)
| 4839 | // 设置 监听 观察者, 该函数是可以让 对象中的三级key 直接冒泡到1级key中 |
| 4840 | //比如 name 只能在Odata.data.name 获取到数据,执行 proxy(Odata,'data','name')之后可以Odata.name 获取值 |
| 4841 | function proxy(target, sourceKey, key) { |
| 4842 | sharedPropertyDefinition.get = function proxyGetter() { //设置get函数 |
| 4843 | return this[sourceKey][key] |
| 4844 | }; |
| 4845 | sharedPropertyDefinition.set = function proxySetter(val) {//设置set函数 |
| 4846 | this[sourceKey][key] = val; |
| 4847 | }; |
| 4848 | Object.defineProperty(target, key, sharedPropertyDefinition); //设置监听观察者 |
| 4849 | } |
| 4850 | |
| 4851 | //初始化状态 |
| 4852 | function initState(vm) { |
no outgoing calls
no test coverage detected