From 09ee04d39911f169457567c869d732a11387651a Mon Sep 17 00:00:00 2001 From: Mateja Date: Sat, 20 Mar 2021 22:47:33 +0100 Subject: Use Lodash cloneDeep for `reservation.vue` component. --- resources/js/components/reservation.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'resources/js') diff --git a/resources/js/components/reservation.vue b/resources/js/components/reservation.vue index d733c9d..5389e1a 100644 --- a/resources/js/components/reservation.vue +++ b/resources/js/components/reservation.vue @@ -25,15 +25,18 @@ export default { props: [ 'reservationIndex' ], data() { return { - reservation: this.$store.getters.getData[this.reservationIndex] + reservation: {} } }, + mounted() { + this.reservation = _.cloneDeep(this.$store.getters.getData[this.reservationIndex]); + }, methods: { updateRow() { }, restoreRow() { - + this.reservation = _.cloneDeep(this.$store.getters.getData[this.reservationIndex]); }, deleteRow() { -- cgit v1.2.3