我的意思是,您无法阅读不确定哈巴狗Cannot read property 'length' of undefined pug
的'length'属性我在index.js中添加了该代码,然后运行npm i和npm start,以便在本地显示未定义的'call'属性
我尝试安装nodemon是因为我需要停止运行npm i和npm star的项目,我还删除了该项目,并像以前一样在不读取该属性的问题之前重新下载了该项目。
换句话说,在代码中添加他们的建议,现在我得到了无法读取属性的错误,没有我的帮助
JS
app.get('/about', (req, res)=>{
var partners =[
{ "name":"Calvin Froedge", "image": "calvin-linkedin.jpg" },
{ "name": "Joel Arberman", "image": "joel-linkedin.jpg" },
{"name":"Kirt Barker", "image": "Kirt Barker" }
];
let lang = getLang(req, res, ['about']);
res.render('about', {
"partners": partners,
"lang": lang
});
});
pug
extends layout
block content
.subhead
h2= about.title
.content.about
for item in about.team
div.team
h3
span= item[0]
small= item[1]
p= item[2]
each partner in partners
li.swiper-slide
img(src=partner.image, alt=partner.name)