如何为流星路线添加特定的侧边栏?
How to add a specific sidebar to meteor route?
例如我有一个管理区域,我想显示一个用于管理导航的特定侧边栏
<body>
{{#if adminRoute}}
{{> sidebarAdminNav }}
{{> yeld }}
{{else}}
{{> yeld }}
{{/if}
</body>
我猜你要找的是嵌套视图。 This answer 给出了迄今为止我使用过的最佳选项。这不是 "angular ui-router" 理想,但它可以完成工作。在您的布局中:
{{#if layout.renderSidebar}}
{{> sidebarAdminNav }}
{{/if}}
{{> yield }}
并且在每个(不幸的是)你的管理路由中:
data: function() {
return {
layout: {renderSidebar: true},
...
};
}
一些软件包可用于 meteor 中的侧边栏。
https://atmospherejs.com/jelena/meteor-sidebar-transitions
https://github.com/awatson1978/semantic-ui-sidebar
例如我有一个管理区域,我想显示一个用于管理导航的特定侧边栏
<body>
{{#if adminRoute}}
{{> sidebarAdminNav }}
{{> yeld }}
{{else}}
{{> yeld }}
{{/if}
</body>
我猜你要找的是嵌套视图。 This answer 给出了迄今为止我使用过的最佳选项。这不是 "angular ui-router" 理想,但它可以完成工作。在您的布局中:
{{#if layout.renderSidebar}}
{{> sidebarAdminNav }}
{{/if}}
{{> yield }}
并且在每个(不幸的是)你的管理路由中:
data: function() {
return {
layout: {renderSidebar: true},
...
};
}
一些软件包可用于 meteor 中的侧边栏。
https://atmospherejs.com/jelena/meteor-sidebar-transitions
https://github.com/awatson1978/semantic-ui-sidebar