如何使用佈局,部分與如下所示的句柄模板?使用佈局,部分與手柄模板
我看過partial文檔,但仍無法弄清楚我想實現的目標。
default.html中
的默認佈局重新用於該網站的不同意見。 {{{content}}}
被用作將呈現主要內容的佔位符。
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
</head>
<body>
<p>This is the top of the body content in the default.html file</p>
{{{content}}}
<p>This is the bottom of the body content in the default.html file</p>
</body>
</html>
的index.html
{{#> default}}
{{ include header }}
<p>This is some other content</p>
{{ include footer }}
了header.html
<h1>This is a header</h1>
footer.html
<p>This is a footer</p>
輸出
<!DOCTYPE html>
<html>
<head>
<title>Using Layout, Partials with Handlebars Template</title>
</head>
<body>
<p>This is the top of the body content in the default.html file</p>
<h1>This is a header</h1>
<p>This is some other content</p>
<p>This is a footer</p>
<p>This is the bottom of the body content in the default.html file</p>
</body>
</html>
檢查文檔partials.html –
@AndreyEtumyan。我更新了我的問題。 – Ishan