express用ejs模板传参问题


当我传参的用下面代码,得到的是一堆div什么什么的,但是是字符串
<%= include ('../compontents/everyInfor.html',{ data: data })%>
当我把=号改为-的时候<%- include ('../compontents/everyInfor.html',{ data: data })%>

出现

Could not find the include file "(&#39;../compontents/wap-footer&#39;,{data:data });"

什么问题,转义了,,,怎么搞


bm123
浏览 1001回答 3
3回答

李晓健

你的 include 后面多了一个空格吧
打开App,查看更多内容
随时随地看视频慕课网APP