[Vue warn]: Error when evaluating expression "topic.meta.createAt != topic.meta.updateAt": TypeError: Cannot read property 'createAt' of undefined (found in component: <v-article>)
[Vue warn]: Error when evaluating expression "topic.meta.createAt": TypeError: Cannot read property 'createAt' of undefined (found in component: <v-article>)
This is the error message. Below is my code part.
<h1>{{ topic.title }}</h1>
<p class="info">
<a v-for="tag in topic.tag" v-link="{name: 'tab', params: {tab: tag, page: 1}}" class="tag">
{{ tag | convertTag}}
</a>
<a class="name"><strong>radical</strong></a>
<span class="ask">{{ topic.meta.createAt | timeToNow }} 发布</span>
<span v-if="topic.meta.createAt != topic.meta.updateAt" class="update">{{ topic.meta.updateAt | timeToNow }} 更新</span>
</p>
This is a component topic that is obtained through my getters. It requests data from mongodb through actions. Everything seems to be normal. . .
convertTag and timeToNow are both filters written by me
In this case, you should first determine that the topic.meta object exists and get its attributes, so that no error is reported.
The reason for the error is that you get its attributes without getting the meta data
topic.meta = undefined.