Closed haoxl3 closed 3 years ago
initData() { return { allTabs: [ { "parent": "胃癌", "isOpen": false, "children": [ { "icd_name": "胃恶性肿瘤", "icd_code": "C15.900" }, { "icd_name": "胃良性肿瘤", "icd_code": "C16.900" } ] }, { "parent": "肺炎", "isOpen": false, "children": [ { "icd_name": "新冠性肺炎", "icd_code": "C16.910" } ] } ] } }, openTabHandle({item, index, pIndex}) { // item = {icd_name: '胃恶性肿瘤', icd_code: 'C15.900'} // index = 0; pIndex = 0; item.showReason = !item.showReason this.data.splice('allTabs[pIndex].children', [index, 1, item]); console.log(this.data.get('allTabs'); }
如上代码所示,在openTabHandle方法中修改allTabs.children里面的属性,打印出数据确实变化了,但视图却没更新,使用深克隆重新给allTabs赋值视图同样不刷新。请问如何让视图刷新?
hello,请问怎么解决的呢,层级深不更新怎么解决呢?
如上代码所示,在openTabHandle方法中修改allTabs.children里面的属性,打印出数据确实变化了,但视图却没更新,使用深克隆重新给allTabs赋值视图同样不刷新。请问如何让视图刷新?