您的位置:首页 >ionic 复选框
发布于2026-08-11 阅读(0)
扫一扫,手机访问
说白了,ionic 里的复选框(checkbox)和普通 HTML 复选框在用法上差别并不大,下面这个示例主要展示的,就是 ionic 复选框 ion-checkbox 的实际应用方式。

复选框标签
这个示例里的逻辑很直接:会根据复选框当前是否被选中来更新 checked 的值。checked 为 true,表示已选中;为 false,则表示未选中。
复选框
{{ item.text }}
Notifications
Push Notifications
Newsletter
angular.module('starter', ['ionic'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.controller( 'actionsheetCtl',['$scope',function($scope){
$scope.devList = [
{ text: "HTML5", checked: true },
{ text: "CSS3", checked: false },
{ text: "Ja vaScript", checked: false }
];
$scope.pushNotificationChange = function() {
console.log('Push Notification Change', $scope.pushNotification.checked);
};
$scope.pushNotification = { checked: true };
$scope.emailNotification = 'Subscribed';
}])
css 代码:
body {
cursor: url('http://www.runoob.com/try/demo_source/finger.png'), auto;
}
效果如下所示:
上一篇:ionic 单选框操作
下一篇:ionic 下拉刷新
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
售后无忧
立即购买>office旗舰店
正版软件
正版软件
正版软件
正版软件
正版软件
1
2
3
4
5
6
7
8
9