0👍
U nead something like this:
in vuex:
state: {
idList: [23,54,66]
},
in component and in created() method:
var idList = this.$store.state.idList;
idList.forEach(el => {
this.newData.push({
id: el,
url: '',
key: ''
});
});
and in component:
<v-checkbox
class="stream-targets"
v-for="(target,index) in newData"
:key="index"
v-model="locationTarget"
:value="target"
>
<template v-slot:label>
<!-- <span class="check-text" >{{target.id}}</span> -->
<v-text-field placeholder="URL" v-model='target.url'></v-text-field>
<v-text-field placeholder="Key" v-model='target.key'></v-text-field>
</template>
</v-checkbox>
- [Vuejs]-Vue Computed Not Updating
- [Vuejs]-How to push new values into array when checkbox is checked and remove when unchecked using Vue.js?
Source:stackexchange.com