优化下这段代码 let activeTabKey = optionactiveTabKey thisrolesPowerthisroledailyTabsList0keyifthisrole === 总经理 activeTabKey = 0
// 优化后的代码 let activeTabKey = option.activeTabKey || this.rolesPower[this.role].dailyTabsList[0].key; if (this.role === '总经理') { activeTabKey = this.rolesPower[this.role].dailyTabsList[0].key; }
原文地址: https://www.cveoy.top/t/topic/bija 著作权归作者所有。请勿转载和采集!