优化代码

This commit is contained in:
wangsongsole 2022-08-19 17:36:16 +08:00
parent c8b1ccc1da
commit 2769cd98c2
1 changed files with 1 additions and 1 deletions

View File

@ -101,7 +101,7 @@ export function sortWeeks(weeks) {
//将weeks清空并将排序好的值赋给weeks
const weeksData = []
if (isContinuityNum(_weeks.map((item) => item.id)) && _weeks.length > 1) {
weeksData.push(`${_weeks[0].name}${_weeks[_weeks.length - 1].name}`)
weeksData.push(`${_weeks[0].name}${_weeks.slice(-1)[0].name}`)
} else {
for (var i = 0; i < _weeks.length; i++) {
weeksData.push(_weeks[i].name)