ionic中复选按钮
作者:本站编辑 发布时间:2015-11-24 来源:本站原创
点击数:
复选框通常用来在一组列表中选中部分成员:
和开关一样,复选按钮也是基于HTML的checkbox input实现的。使用如下的HTML模板声明复选按钮:
<any class="item-input"> <any class="checkbox"> <input type="checkbox"> </any></any>
你也许已经猜到,复选按钮的配色方案样式为:.checkbox-{color}。
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height">
<link rel="stylesheet" type="text/css" href="ionic.min.css">
</head>
<body>
<div class="bar bar-header bar-positive">
<button class="button">Edit</button>
<h1 class="title">Tasks</h1>
<button class="button icon ion-ios-plus-empty"></button>
</div>
<div class="scroll-content has-header">
<ul class="list">
<li class="item item-checkbox item-button-right">
<label class="checkbox">
<input type="checkbox">
</label>
<h2>Shopping</h2>
<p>Due tommorow</p>
<a class="button button-clear icon ion-ios-arrow-right"></a>
</li>
<li class="item item-checkbox item-button-right">
<label class="checkbox">
<input type="checkbox" checked>
</label>
<h2>Moving house checklist</h2>
<a class="button button-clear icon ion-ios-arrow-right"></a>
</li>
<li class="item item-checkbox item-button-right">
<label class="checkbox">
<input type="checkbox">
</label>
<h2>Holiday destinations</h2>
<a class="button button-clear icon ion-ios-arrow-right"></a>
</li>
<li class="item item-checkbox item-button-right">
<label class="checkbox">
<input type="checkbox">
</label>
<h2>App ideas</h2>
<a class="button button-clear icon ion-ios-arrow-right"></a>
</li>
</ul>
</div>
<div class="bar bar-footer bar-positive">
<div class="button-bar">
<a class="button">All</a>
<a class="button">Done</a>
<a class="button">Completed</a>
</div>
</div>
</body>
</html>