ionic 切换开关操作
作者:SunnyJourney
时间:2026-08-11
来源:正软商城
浏览:4
来看这个例子:切换不同开关的 checked 状态后,会显示对应的不同数值,其中 true 表示开启,false 表示关闭。 HTML 代码 开关切换 Settings {{ item.text }} Notifications Push Notifications Newsletter 考虑到 p
本文目录
来看这个例子:切换不同开关的 checked 状态后,会显示对应的不同数值,其中 true 表示开启,false 表示关闭。

HTML 代码
开关切换
Settings
{{ item.text }}
Notifications
Push Notifications
Newsletter
考虑到 pre 标签会产生冲突,示例里已经将原本的 pre 统一替换成了 div 标签,具体效果可以在"尝试一下"里直接查看。
Ja vaScript 代码
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;
}
效果如下所示:
作者最新文章
俄罗斯Yandex官网入口及外贸查询工具
2026-11-16 17:53
Yandex官网入口及网页搜索使用方法
2026-11-10 18:27
免注册Word转PDF在哪里?Word转PDF手机电脑都能用
2026-11-08 15:29
xshell如何使用密钥连接服务器
2026-11-05 21:38
动漫共和国资源入口及正版地址分享
2026-11-04 12:05
上一篇:
ionic 手势事件
下一篇:
ionic 单选框操作
热门文章
更多
精品专题
更多
Mac软件
更多
火山引擎 网页版
Windows/ macOS/ Linux
火山引擎是字节跳动旗下企业级云与AI服务平台。聚焦大模型核心能力,依托字节自研豆包多模态大模型,凭借火山方舟一站式平台,提供模型精调、推理部署、智能应用搭建等全链路服务,结合高性能AI算力,助力各行业快速落地大模型数字化与智能化应用。
















