用哈巴狗(玉)打印数组数据

时间:2017-08-23 13:28:23

标签: pug

我有一个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}无效,因为

  

无法读取属性'作者'未定义的

如何访问该数据?

0 个答案:

没有答案