Wydaje mi sie, że źle przekazuje props z parent do grandchild. Czy ktoś proszę mógłby na to zerknąć i mnie oświecić co robię nie tak?
parent:
<template>
<Information :loan="detailsLoan" :applicationData="loan" />
</div>
</div>
</template>
<script>
import Information from "@/scenes/ClientZone/components/Information.vue";
export default {
components: {
Information,
},
methods: {
},
data: function() {
return {
loan: {},
repaid: false,
detailsLoan: { data: {}, schedule: {}, sum: {} },
confirmed: 0
};
},
};
</script>
child:
<template lang="pug">
Repayment(:loan="loan" :status="status" :appData="loan")
</template>
<script>
import Repayment from "@/scenes/ClientZone/components/Repayment.vue";
export default {
name: "Information",
components: {
Repayment
},
data() {
return {};
},
computed: {
},
props: {
loan: { type: Object, required: true },
applicationData: { type: Object, required: true }
}
};
</script>
grandchild
<template lang="pug">
.amount
span R$ {{repaymentValue}}
</template>
<script>
export default {
name: "Repayment",
data() {
return {};
},
props: {
loan: { type: Object, required: true },
status: { type: Number, required: true },
appData: { type: Object, required: true } //=>ten props nie działa
},
methods: {
isActive() {
return (
parseFloat(this.loan.data.s_amount) +
parseFloat(this.loan.data.l_late_fee)
);
},
isVeryfication() {
return "blablabla";
}
},
mounted() {},
computed: {
repaymentValue() {
console.log(this.appData.confirmed);
if (this.appData.confirmed == 1) {
return isActive();
} else if (this.appData.confirmed == 0) {
return isVeryfication();
}
}
}
};
</script>
chodzi mi dokładnie o repaymentValue(). mam tam console.log i on jest undefined. Domyslam sie, że chodzi o źle przekazanego propsa, ale nie wiem jak to naprawić? Może ktos coś mógłby zasugerować?