Error in render: "TypeError: Cannot read property 'month' of undefined"По сути она не должна быть пустой.
<template>
<div class="tabs">
<button
v-for="tab in tabs"
:key="tab.name"
@click="currentTab = tab"
>{{ tab.label }}</button>
<div>
<div>{{ account[currentTab.name].month }} руб за месяц</div>
<div>{{ account[currentTab.name].weekend }} руб за неделю</div>
<div>{{ account[currentTab.name].today }} руб за день</div>
</div>
</div>
</template>
<script>
let tabs = [
{
name: "spending",
label: "Расходы"
},
{
name: "income",
label: "Доходы"
}
];
export default {
name: "Tabs",
props: ["account"],
data(){
return {
currentTab: tabs[0],
tabs: tabs
}
},
}
</script>
beforeUpdate: function () {
console.log(this.$props.account)
}
module.exports = {
runtimeCompiler: true
};
Property or method "account" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See