Browse Source

dokonceno

master
Harazim 4 years ago
parent
commit
048d063597
  1. 6
      src/App.vue
  2. 9
      src/components/SeatPicker.vue

6
src/App.vue

@ -53,7 +53,7 @@
</select>
</p>
<Seat-picker :seats="seats" :classType="classType" :personCount= "personCount" />
<Seat-picker v-model= "chosenSeats" :seats= "seats" :classType= "classType" :personCount= "personCount" />
</form>
</div>
@ -119,8 +119,8 @@ export default {
return {
travelType: "",
travelTypes: [
{ value: "R", text: "TwoWay" },
{ value: "O", text: "OneWay" },
{ value: "R", text: "Obousměrná" },
{ value: "O", text: "Jednosměrná" },
],
personCount: 1,
classType: "",

9
src/components/SeatPicker.vue

@ -18,23 +18,26 @@
<script>
export default {
propS: ["seats", "classType", "personCount", ],
propS: ["seats", "classType", "personCount", "Value" ],
data: function() {
return {
chosenSeats: [],
chosenSeats: this.Value,
}
},
methods: {
addSeatClick: function(seat) {
if (this.chosenSeats.length < this.personCount) {
this.chosenSeats.push(seat);
this.$emit("input", this.chosenSeats);
}
else {
alert("Všichni cestující již sedí!");
}
},
},
watch: function(Value){
this.chosenSeats = Value;
}
}
</script>

Loading…
Cancel
Save