Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 相当于;“玉石块”;在车把上_Node.js_Handlebars.js_Pug - Fatal编程技术网

Node.js 相当于;“玉石块”;在车把上

Node.js 相当于;“玉石块”;在车把上,node.js,handlebars.js,pug,Node.js,Handlebars.js,Pug,把手是否具有与之等效的功能? 我知道它有分部,但我不知道如何用分部来模仿jade的块功能 下面是我试图用jade实现的一个示例: 主模板: // layout.jade doctype 5 html head title= title link(rel='stylesheet', href='/stylesheets/style.css') block head body header block header block content footer

把手是否具有与之等效的功能? 我知道它有分部,但我不知道如何用分部来模仿jade的块功能

下面是我试图用jade实现的一个示例:
主模板:

// layout.jade
doctype 5
html
head
  title= title
  link(rel='stylesheet', href='/stylesheets/style.css')
  block head

body
  header
    block header

  block content

  footer
    block footer

  block scripts
// camera.jade
extends layout

block head
  link(rel='stylesheet', href='/stylesheets/camera.css')

block header
  h1 Camera

block content
  section#secScreen
    video#vdoScreen
    aside#asdControls
      nav
        a(href='/') Back
        a(href='') Refresh
        a(href='/gallery') Gallery

block scripts
  script(src='/javascripts/camera.js')
其他模板:

// layout.jade
doctype 5
html
head
  title= title
  link(rel='stylesheet', href='/stylesheets/style.css')
  block head

body
  header
    block header

  block content

  footer
    block footer

  block scripts
// camera.jade
extends layout

block head
  link(rel='stylesheet', href='/stylesheets/camera.css')

block header
  h1 Camera

block content
  section#secScreen
    video#vdoScreen
    aside#asdControls
      nav
        a(href='/') Back
        a(href='') Refresh
        a(href='/gallery') Gallery

block scripts
  script(src='/javascripts/camera.js')
我发现这个名为的模块似乎将此功能添加到了把手上。
这似乎是一个不错的模块,但我想知道是否有其他方法可以在不安装另一个依赖项的情况下完成我正在尝试的工作?

目前还没有,这就是我为什么要这样做的原因。如果您不喜欢管理多个插件,那么在优秀的集合中有一个衍生的layouts helper,它有100多个其他helper