<%= EJS %>
高效的嵌入式 JavaScript 模板引擎。
快速編譯與繪製輸出
簡潔的模板標籤:<% %>
所有的語法都用<% %>包裹
if\else基本語法
<% if (user) { %>
<h2><%= user.name %></h2>
<% } %>
include用於引入ejs定義的組件
<ul>
<% users.forEach(function(user){ %>
<%- include('user/show', {user: user}); %>
<% }); %>
</ul>
<body>
<%- include("./header.ejs") %>
<h1><%=title%></h1>
<%- include("./footer.ejs") %>
</body>
結合nodejs,本質就是服務端渲染,vue、react所謂的服務端渲染也是借鑑ejs模式的微創新