Jade Cannot read property 'length' of undefined

牧云@^-^@ 提交于 2019-12-23 12:32:28

问题


Why menuItems is undefined in the following code?

- var menuItems = ["Main","Contacts","About"]
mixin showItems(items)
    ul
        each item in items
            li: a(href="#") #{item}
extend layout
block content
    +showItems(menuItems)

I get the following error:

Cannot read property 'length' of undefined


回答1:


- var menuItems = ["Main","Contacts","About"]
mixin showItems(items)
    ul
        each item in items
            li: a(href="#") #{item}
extends layout
block content
    +showItems(menuItems)

There is a Typo 'extends layout'



来源:https://stackoverflow.com/questions/34283251/jade-cannot-read-property-length-of-undefined

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!