Ionic(ionicframework)一款接近原生的Html5移动App开发框架 创建精彩的应用 从这里开始 -ion-reorder-button
漂亮的界面 追求性能 专注原生 免费开源
-
ionic/ionic3
JavaScript 扩展 - Headers/Footers(页眉页脚) 1
- Content(内容) 2
- Scroll(滚动) 3
- Tabs(选项卡) 4
- Side Menus(侧栏菜单) 5
- Navigation(导航) 6
- Lists(列表) 7
- Form Inputs(表单) 8
- Slide Box(滑动框) 9
- Modal(模型) 10
- Action Sheet(操作表) 11
- Popup(弹出窗口) 12
- Loading(加载) 13
- Platform(平台) 14
- Gesture(手势) 15
- Backdrop(背景) 16
- Utility(工具) 17
- Keyboard(键盘) 18
ion-reorder-button
隶属于ionItem
用法
<ion-list ng-controller="MyCtrl">
<ion-item ng-repeat="item in items">
项
<ion-reorder-button class="ion-navicon"
on-reorder="moveItem(item, $fromIndex, $toIndex)">
</ion-reorder>
</ion-item>
</ion-list>
function MyCtrl($scope) {
$scope.items = [1, 2, 3, 4];
$scope.moveItem = function(item, fromIndex, toIndex) {
//把该项移动到数组中
$scope.items.splice(fromIndex, 1);
$scope.items.splice(toIndex, 0, item);
};
}
API
属性 | 类型 | 详情 |
---|---|---|
on-reorder
(可选)
|
表达式
|
当一项被重新排序时调用表达式。给定参数:$fromIndex, $toIndex。 |