Authored by 姜枫

添加check demo

... ... @@ -81,6 +81,17 @@ const index = (req, res) => {
{
round: false
}
],
genders: [
{
name: '男',
value: '1,3',
checked: true
},
{
name: '女',
value: '2,3'
}
]
},
helpers: {
... ...
... ... @@ -50,6 +50,25 @@
<br><br>
{{/each}}
<p class="title">2.1 选中状态切换</p>
{{#each genders}}
<div class="input-radio" data-value="{{value}}">
{{> icon/radio}}
<label>{{name}}</label>
</div>
{{/each}}
{{#each genders}}
<div class="input-checkbox" data-value="{{value}}">
{{> icon/checkbox}}
<label>{{name}}</label>
</div>
{{/each}}
<div class="check-msg"></div>
<p class="title">3. 按钮</p>
<span class="btn">普通按钮</span>
<span class="btn disable">不可点按钮</span>
... ... @@ -164,6 +183,7 @@
<span class="btn alert-btn">alert</span>
<span class="btn red confirm-btn">confirm</span>
<span class="btn white dialog-btn">dialog</span>
{{/ content}}
</div>
... ...
... ... @@ -14,6 +14,7 @@ var change = $('#change');
var show = false;
require('../plugins/tips');
require('../plugins/check');
$('.alert-btn').click(function() {
new _alert('购买成功<br>进入 个人中心>我的订单<br>查看门票信息').show();
... ... @@ -67,6 +68,21 @@ change.click(function() {
});
// check
$('.input-radio').check({
type: 'radio',
onChange: function(ele, checked, value) {
$('.check-msg').html((checked ? '选中' : '取消选中') + ': ' + value);
}
});
$('.input-checkbox').check({
type: 'checkbox',
onChange: function(ele, checked, value) {
$('.check-msg').html((checked ? '选中' : '取消选中') + ': ' + value);
}
});
$(function() {
// 运行此demo
... ...
... ... @@ -8,8 +8,8 @@ var jQuery = require('yoho-jquery');
checkedHtml: '&#xe603;'
},
checkbox: {
uncheckedHtml: '&#xe604;',
checkedHtml: '&#xe603;'
uncheckedHtml: '&#xe601;',
checkedHtml: '&#xe602;'
}
};
... ...