玉无法读取未定义的属性“长度" [英] Jade Cannot read property 'length' of undefined

查看:51
本文介绍了玉无法读取未定义的属性“长度"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么menuItems 在下面的代码中没有定义?

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)

我收到以下错误:

无法读取未定义的属性长度"

Cannot read property 'length' of undefined

推荐答案

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

有一个错字扩展布局"

这篇关于玉无法读取未定义的属性“长度"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆