【发布时间】:2019-06-12 11:27:47
【问题描述】:
mounted() {
// threads is a constant file
this.thread = threads.find(t => t.id === this.$route.params.id)
},
data() {
return {
thread: null
}
},
head: {
title: this.thread.title,
meta: [
{
hid: 'description',
name: 'description',
content: this.thread.body
}
]
},
基本上,我有一个 json“线程”的常量文件,我想使用它的属性来设置标题 - 标题/描述。
我收到此错误:
无法读取未定义的属性“线程”
【问题讨论】: