问题
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