Answer the question
In order to leave comments, you need to log in
Pug gives "Cannot read property 'length' of undefined" error, how to solve the problem?
There is an array on the main page:
-
let catalogItems = [
{
'link': '#',
'imgSrc': '123',
'name': 'Hello”'
},
{
'link': '#',
'imgSrc': '123',
'name': 'Hello”'
},
]
.catalog__inner
h1.heading.page__heading= catalogTitle
.grid__wrap
each item in catalogItems
.grid__item
a(href=item.link).catalog__item-preview
.catalog__item-img
img(src="../img/"+ item.imgSrc +".jpg" alt=item.name)
span.catalog__item-more Подробнее
span.catalog__item-name #{item.name}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question