【发布时间】:2014-07-03 12:54:22
【问题描述】:
大家好,我在标题和侧边菜单滚动方面遇到了一些问题。
虽然我已经从这个 sn-p 中取出它,但我已经尝试将 class/attr has-header 放在几乎所有可能的组合中:
<ion-side-menus>
<ion-side-menu-content>
<ion-header-bar class="bar-dark">
<button class="button icon ion-arrow-left-a" ng-click='back()'></button>
<h1 class="title">Ionic Shopping Checkout</h1>
<button class='button icon ion-bag' ng-click='toggleRightSideMenu()'></button>
</ion-header-bar>
<ion-purchase></ion-purchase> // custom directive
<ion-purchase-footer></ion-purchase-footer> // custom directive
</ion-side-menu-content>
<ion-side-menu side="right">
<ion-cart has-header='true' ng-controller='CartController'></ion-cart> // custom directive
</ion-side-menu>
</ion-side-menus>
此外,我在侧边菜单中的 ng-repeat 项目没有滚动,即使我将它们嵌套在 ion-scroll 元素中也是如此。这可能是一个完全不相关的问题,但是我很好奇是否有人也遇到过这个问题。
提前感谢所有帮助!
【问题讨论】:
-
has-header属性已从最新的 ionic 版本中删除。你能告诉我们你的侧边菜单代码吗? -
@Riron 很抱歉它被切断了。所以 has-header 已被删除,它被替换为什么?只是上课?
-
来自 ionic 博客:
The has-header, has-footer, and has-tabs attributes have been removed. Ionic now will automatically reposition and resize the content depending on what surrounding widgets are present。您的 ion-cart 指令包含ng-repeat? Maybie 有关此指令的更多详细信息会有所帮助 -
@Riron 问题似乎真的出在 ion-side-menu-content 上。 ion-purchase 指令只是一堆输入字段。然而由于某种原因,它不会检测到标题。
-
您需要将所有内容放在
ion-content指令中:ion-purchase和ion-purchase-footer在内容中,ion-cart在侧边菜单中
标签: javascript angularjs ionic-framework