【发布时间】:2016-06-18 04:31:51
【问题描述】:
!= 在下面的玉代码中如何工作.. != messages()
extends layout
block content
.spacer
.container
.row
.col-lg-8.col-lg-offset-2.col-md-10.col-md-offset-1
a(class='btn btn-tiny btn-primary' href='/manage/categories/add') Create Category
h1= title
small
a(href='/manage/articles') Manage Articles
!= messages()
table(class='table table-striped')
tr
th Category Title
th
each category, i in categories
tr
td #{category.title}
td
a(class="btn btn-tiny btn-default" href="/manage/categories/edit/#{category._id}") Edit
app.js
app.use(require('connect-flash')());
app.use(function (req, res, next) {
res.locals.messages = require('express-messages')(req, res);
next();
});
【问题讨论】:
-
这似乎是一种无需父标签即可输出内容的方式。
-
部分记录了here(“未转义的缓冲代码”)。
标签: javascript node.js pug