Expect END descriptor with depth 0 but g
报错信息:
Expect END descriptor with depth 0 but get another
Expect START descriptor with depth 2 but get another
对应的报错代码:
toChangeTab: function (e){ var _this = this ; var tabIndex = e.currentTarget.dataset.index; var tabs = _this.data.render.tabs; tabs.forEach( function (value,index){ tabs[index].isSelected = tabIndex === index; } ); if (tabs[tabIndex].tab_type != 'service' ) { _this.setData({ 'render.opacity' : 1.0, }) } else { var opacityWelfareTab = _this.data.render.opacityWelfareTab _this.setData({ 'render.opacity' : opacityWelfareTab, }) } _this.setData({ 'render.tabs' : tabs, 'render.selectedTab' : tabs[tabIndex], }) }, |
更改后的代码:
toChangeTab: function (e){ var _this = this ; var tabIndex = e.currentTarget.dataset.index; var tabs = _this.data.render.tabs; tabs.forEach( function (value,index){ tabs[index].isSelected = tabIndex === index; } ); if (tabs[tabIndex].tab_type != 'service' ) { _this.setData({ 'render.opacity' : 1.0, 'render.tabs' : tabs, 'render.selectedTab' : tabs[tabIndex] }) } else { var opacityWelfareTab = _this.data.render.opacityWelfareTab _this.setData({ 'render.opacity' : opacityWelfareTab, 'render.tabs' : tabs, 'render.selectedTab' : tabs[tabIndex] }) } }, |
实在不知道为什么这样改就对了。。。。。。
求解。