【问题标题】:Cannot read the property of undefined error in jade无法读取玉中未定义错误的属性
【发布时间】:2015-06-05 16:24:44
【问题描述】:

这是我的简单玉脚本。

ul - each user in users li #{user.username}.

我会得到无法读取未定义错误的属性用户名。

【问题讨论】:

  • 你也可以显示代码吗?
  • 用户名或用户看起来未定义。将它们记录到控制台以查看哪个有问题。
  • 我会在控制台中得到正确的键值

标签: javascript node.js pug


【解决方案1】:

在我看来,格式是错误的,所以它不会正确解释脚本,应该看起来更像

ul
  each user in users
    li #{user.username}      

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-10-15
    • 2021-12-31
    • 2022-10-05
    • 2022-07-06
    • 2017-08-12
    • 2018-04-29
    相关资源
    最近更新 更多