<%= 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模式的微创新