本文介绍了ejs中<%=,<%和<%-之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
正如我在标题中所写.在Ejs中,<%=
,<%
和<%-
有什么区别?例如,我看到了此代码<% include ../partials/header.ejs %>
,然后有此代码<%= title %>
.我还在某处看到了<%-
,但是在任何地方都找不到代码示例.那有什么区别呢?我什么时候使用哪个?
As I wrote in the title. In Ejs what's the difference between <%=
, <%
and <%-
? for example I saw this code <% include ../partials/header.ejs %>
, and then there is this code <%= title %>
. I also saw <%-
somewhere but cannot find a code example anywhere. So what's the difference? When do I use which?
我找到了,但这是针对ruby on rails
<%%>之间的差异.和<%=%>在RoR中
I found this but it's for ruby on rails
Difference between <% %> and <%= %> in RoR
推荐答案
以下内容来自 ejs文档(标记部分):
The following is from ejs docs (tag section):
在此处
这篇关于ejs中<%=,<%和<%-之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!