I have a array who contain ID's when I click on it, id's are pushed to a array. I can add a value for the selected id's (time). each line have his own field 'time'
at the end I need to create a array with all all these value like : [[id,time],[id,time],[id,time]]
I made a Js fiddle
<link href='https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' rel="stylesheet" type="text/css">
<div id="app">
<v-app>
<v-card>
<div v-for= "(obj, index) in object">
<v-chip
@click="add(obj)"
>
{{obj.id}}
</v-chip>
</div>
</v-card>
<v-divider></v-divider>
<v-card>
<div v-for= "(obj, index) in arrayOfSelection">
<v-chip >
{{obj.id}}
</v-chip>
<v-text-field type="number"></v-text-field>
</div>
</v-card>
<v-btn>Submit</v-btn>
{{finalArray}}
</v-app>
</div>
Vue.use(Vuetify);
var vm = new Vue({
el: "#app",
methods: {
// #1 method to add line
// # method to console an object like { time:intensity, time:intensity, time:intensity,... } so for example { 10:50, 20:80, 50:40, ....}
},
data() {
return {
object:[
{ id: 123456},
{ id: 741258},
{ id: 789654},
],
array: [],
arrayOfSelection: [],
finalArray:[]
}
},
methods: {
add(obj) {
this.arrayOfSelection.push({
id: obj.id,
})
},
submit() {
this.finalArray.push('something')
}
}
})
thanks for your help