我正在使用sails hook sails-hook-flash
因此使用EJS的例子是
<% flash.get('success').forEach(function (message) { %>
<div class="alert alert-success">
<%= message %>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
有人可以帮助我看看如何用把手做到这一点吗?
答案 0 :(得分:1)
你去吧
{{ #each flash.get('success') }}
<div class="alert alert-success">
{{this}}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
{{ /each }}