【发布时间】:2016-12-01 23:46:56
【问题描述】:
我正在尝试使用 2 个块创建视图。每个块都有不同的实时数据源。当我在主视图中使用 Jade 的包含时,:
extends ../layout
block content
link(rel='stylesheet', type='text/css', href='/stylesheets/people.css')
include ../store/peopleTemplate.pug
我收到错误
Cannot read property 'people' of undefined.
原因是数据仍在加载中。如果排除该包含,而是在恢复数据的函数中使用
res.render(template, { data:localData });
模板未添加到视图中。
如何将 2 个或更多包含来自不同来源的动态数据的部分视图添加到 1 个视图?谢谢
【问题讨论】:
标签: javascript node.js pug partials