Merhabalar Vue'de biraz yardımınıza ihtiyacım var tam olarak çıkamadım işin içinden
selectedDates: [],
time: {},
times: [
{
value: "09:00",
text: "09:00 - 09:30",
},
{
value: "09:30",
text: "09:30 - 10:00",
},
{
value: "10:00",
text: "10:00 - 10:30",
},
{
value: "10:30",
text: "10:30 - 11:00",
},
{
value: "11:00",
text: "11:00 - 11:30",
},
{
value: "11:30",
text: "11:30 - 12:00",
},
{
value: "12:00",
text: "12:00 - 12:30",
},
{
value: "12:30",
text: "12:30 - 13:00",
},
{
value: "13:00",
text: "13:00 - 13:30",
},
{
value: "13:30",
text: "13:30 - 14:00",
},
{
value: "14:00",
text: "14:00 - 14:30",
},
{
value: "14:30",
text: "14:30 - 15:00",
},
{
value: "15:00",
text: "15:00 - 15:30",
},
{
value: "15:30",
text: "15:30 - 16:00",
},
{
value: "16:00",
text: "16:00 - 16:30",
},
{
value: "16:30",
text: "16:30 - 17:00",
},
],
İndex
el-button.all(type="warning", @click="acceptAllDate") Tüm Saatleri Seç
.col-12.col-xs-12
.row.mt-2
.col-12.col-sm-12.col-md-6.col-lg-3.col-xl-3(
v-for="(item, index) in selectedDates",
:key="index"
)
p(style="margin-bottom: 0px; margin-top: 10px") {{ index + 1 }}. Seçim
el-button(:key="index", type="primary") {{ item.date | formatDate }} - {{ item.text }}
el-button(
type="danger",
circle,
size="mini",
style="margin-left: 5px !important",
@click="selectedDates.splice(index, 1)"
) X
Verilerim bunlar ekranda seçilen veriye göre tarih ve saat ekrana yazılıyor fakat ben hepsini seç dediğim de burada ki tüm saatler ekrana yazılmasını yapmak istiyorum.
Butona basıldığın da bütün saat verilerini eklemem gerekiyor.
methods: {
acceptAllDate()
{
this.selectedDates.push({
date: this.date,
time: this.time.value,
text: this.time.text,
});
}
Ekrana veriyi gönderen komutum bu seçilen tarihe göre