I am currently working on a component that needs to append a property to an array. Here is the initial array structure:
[
{
date: "17/11/2020",
dateTime: false,
hour: "00",
minute: "00",
},
];
The component features a button:
<b-button
class="p-0"
variant="success"
@click="addTime(array)"
>
+ Add more times
</b-button>
My goal is to have each click on the button add a "time" property in the following format:
[
{
date: "17/11/2020",
dateTime: false,
hour: "00",
minute: "00",
time: [
{
defaultDateStart: "08:00",
defaultDateEnd: "00:00"
},
{
defaultDateStart: "08:00",
defaultDateEnd: "00:00"
},
//etc....
],
},
];
Is this achievable? I've attempted to use .push() in the click method without success...