我想将视图可选地包装在某些指定的html-markup中。我尝试使用局部函数来做到这一点(我正在使用express-handlebars作为express的视图引擎,并且我有一个节点后端):
layout.hbs:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>Meadowlark Travel</title>
</head>
<body>
{{{body}}}
</body>
</html>
view.hbs:
<span>From the context I am getting this: "{{content}}" and I am wrapping around the following:</span>
{{> {{content}} }} <------ This doesn't seem to work. Is there a workaround for it?
<span>content</span>
上下文在哪里
{partial: "content"}
部分由下式给出:
content.hbs
<p>I am the content</p>
您能帮我吗?我整天坐在这里,试图弄清楚该怎么做:(