4
我有2個模板:如何編寫鐵路路由器嵌套模板?
1)mainLayout.html
- >必須由所有頁面使用的總體佈局。 (如網頁標題,導航欄,頁腳)
Router.configure({
layoutTemplate: 'mainLayout'
})
<template name="mainLayout">
{{> header}}
<div class="container-fluid">
{{> yield}}
</div>
</template>
2)specialLayout.html
- 這是繼承主的layout.html但額外的模板(如側/標籤菜單)
我應該如何定義>自定義佈局specialLayout
?請注意,specialLayout
應具有在mainLayout
中定義的標題,導航欄和頁腳。
如果我有路線X想要使用specialLayout
,我該怎麼寫呢?