359780
学习node.js学习指南,书中用的是ejs,我用的是jade。 书中有段ejs:
<div id="container" class="container">
<% if (success) { %>
<div class="alert alert-success">
<%= success %>
</div>
<% } %>
<% if (error) { %>
<div class="alert alert-error">
<%= error %>
</div>
<% } %>
<%- body %>
<hr />
<footer>
<p><a href="http://www.byvoid.com/" target="_blank">BYVoid</a> 2012</p>
</footer>
</div>
我需要把它转成jade的写法,我是这么写的:
#container.container
- if (success)
.alert.alert-success #{success}
- if (error)
.alert.alert-error #{error}
block body
hr
footer
p
a(href="http://www.byvoid.com", target="_blank") BYVoid
运行的效果不对,试了很多种写法,都没成功,求问该怎么改。