【发布时间】:2018-07-09 04:17:14
【问题描述】:
我想将
card1对象移动到数组中cards的第二个位置。
卡1
lanes: [{
cards: [{
id: card1,
title: 'Write a cool JS library',
listId: "lane1"
},
{
id: card2,
title: 'Make it generic enough',
listId: "lane1"
}
],
id: "lane1",
label: "2/2",
title: "title.."
},
{
cards: [
{
id: card3,
title: 'Write README',
listId: "lane2"
}
],
id: "lane2",
label: "0/0",
title: "Something title.."
}
]
卡片 2
lanes: [{
cards: [{
id: card1,
title: 'Write a cool JS library',
listId: "lane1"
},
{
id: card2,
title: 'Make it generic enough',
listId: "lane1"
}
],
id: "lane1",
label: "2/2",
title: "title.."
},
{
cards: [
{
id: card3,
title: 'Write README',
listId: "lane2"
}
],
id: "lane2",
label: "0/0",
title: "Something title.."
}
]
【问题讨论】:
标签: javascript arrays json sorting object