javascript - Meteor JS Jade 模板无法按预期工作

标签 javascript html node.js meteor pug

我试过这个包 https://github.com/matteodem/meteor-easy-search/使用此示例代码轻松搜索

<template name="searchBox">
    {{> esInput index="players" placeholder="Search..." }}

    <ul>
        {{#esEach index="players"}}
           <li>Name of the player: {{name}}</li>
        {{/esEach}}
    </ul>
 </template>

并将其转化为 Jade

template(name="searchBox")
  +esInput index="players" placeholder="Search..." 
  ul
    esEach index="players"
      li Name of the player: {{name}}

如果我使用 html 格式搜索有效,但当我使用 jade 格式时没有错误,但搜索不会显示。我是否正确地将 html 转换为 jade?知道为什么 jade 不起作用吗?

最佳答案

esEach 应该是 +esEach。现在至少有 30 个字符。

关于javascript - Meteor JS Jade 模板无法按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28897839/

相关文章:

Javascript 导致选择输入卡住

html - Windows 8.1 平铺背景和图像设置不正确

javascript - 什么是通用 JavaScript?

json - Node JS Joi 验证 - 如何返回 JSON 响应而不是字符串?

几次调用后,Javascript 函数将无法正常工作

php - 如何判断是单击鼠标还是按下键盘

javascript - 如何制作整页的JS和CSS菜单

node.js - Node.js 可以在服务器上启动脚本吗?

javascript - 数据表下拉菜单问题

javascript - 如何通过PHP在新窗口中打开外部链接?