- Joined
- Jan 26, 2023
- Messages
- 1
- Reaction score
- 0
Hello
I ran into a problem because I checked that the value If it matches, return the toggle switch as checked (true), otherwise return the toggle switch as false.
as attached image
But the button is duplicated. How should I fix it?
image >> https://sv1.picz.in.th/images/2023/01/25/LSpikk.png
This my code
<div class="col-12" v-for="sch in schedule_artist" :key="sch.sch_id">
....
<div v-for="b in follows" :key="b.follow_artist_Id">
<div v-if="b.sch_id == sch.sch_id">
<label class="switch ms-3" >
<input type="checkbox" @click="createSW(sch.sch_id)" checked>
<div class="slider round"></div>
</label>
</div>
</div>
<label class="switch ms-3" >
<input type="checkbox" @click="createSW(sch.sch_id)" checked>
<div class="slider round"></div>
</label>
</div>
My script
export default {
data() {
return {
schedule_artist: [],
follows: [],
};
....
},
I ran into a problem because I checked that the value If it matches, return the toggle switch as checked (true), otherwise return the toggle switch as false.
as attached image
But the button is duplicated. How should I fix it?
image >> https://sv1.picz.in.th/images/2023/01/25/LSpikk.png
This my code
<div class="col-12" v-for="sch in schedule_artist" :key="sch.sch_id">
....
<div v-for="b in follows" :key="b.follow_artist_Id">
<div v-if="b.sch_id == sch.sch_id">
<label class="switch ms-3" >
<input type="checkbox" @click="createSW(sch.sch_id)" checked>
<div class="slider round"></div>
</label>
</div>
</div>
<label class="switch ms-3" >
<input type="checkbox" @click="createSW(sch.sch_id)" checked>
<div class="slider round"></div>
</label>
</div>
My script
export default {
data() {
return {
schedule_artist: [],
follows: [],
};
....
},