您的位置:首页 >ionic 切换开关操作
发布于2026-08-11 阅读(0)
扫一扫,手机访问
来看这个例子:切换不同开关的 checked 状态后,会显示对应的不同数值,其中 true 表示开启,false 表示关闭。

开关切换
Settings
{{ item.text }}
Notifications
Push Notifications
Newsletter
考虑到 pre 标签会产生冲突,示例里已经将原本的 pre 统一替换成了 div 标签,具体效果可以在"尝试一下"里直接查看。
angular.module('ionicApp', ['ionic'])
.controller('MainCtrl', function($scope) {
$scope.settingsList = [
{ text: "Wireless", checked: true },
{ text: "GPS", checked: false },
{ text: "Bluetooth", 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