如何在 6 个数组之间移动对象 Vue



我像Trello一样拖放。有 6 个带有对象(卡片(的数组。我需要通过单击卡中的弹出窗口在数组之间移动此卡,在此弹出窗口中,我必须选择应将此卡移动到哪个数组(bord(。

queued: [ // array
{
project: 'AI development',
client: 'Tesla',
fixed: false,
price: 5000,
id: 1
},
{
project: 'Blockchain integration',
client: 'BWM',
fixed: false,
price: 2500,
id: 112
},
{
project: 'Chatbot',
client: 'T-Mobile',
fixed: false,
price: 6500,
id: 13
}
]
planningArr : [ // array
{
project: 'Landing page',
client: 'Amazon',
fixed: false,
price: 1000,
id: 14
},
{
project: 'Website',
client: 'Google',
fixed: false,
price: 2000,
id: 100
},
{
project: 'Website',
client: 'Google',
fixed: false,
price: 500,
id: 1121
}
],
designArr: [ // array
{
project: 'Logo design',
client: 'Symu.com',
fixed: false,
price: 2000,
id: 19
}
]

在这里,我只展示了三个数组。我想我必须使用拼接和推送,但我不知道应该以哪种方式使用这些方法。

1(要从数组中删除,假设您要删除带有AI development的卡

var card = {
project: 'AI development',
client: 'Tesla',
fixed: false,
price: 5000,
id: 1
}
queued.splice(queued.indexOf(card),1);

2(要将其添加到数组中,假设在planningArr

planningArr.push(card)

最新更新