我有一个JSON对象,我想要用pug解析。例如,对象如下所示:
{
"name": "testname",
"type": "news",
"meta": {
"author" : "authorname",
"time": "2017-08-23T06:37:43.505Z"
},
"content": "lorum ipsum...."
}
我可以直接在对象中使用数据,如名称和类型,默认代码为:#{news.name}
。但是meta中的数据没有。 #{news.meta.author}
无效,因为
无法读取属性'作者'未定义的
如何访问该数据?