Showing
4 changed files
with
49 additions
and
2 deletions
@@ -81,6 +81,17 @@ const index = (req, res) => { | @@ -81,6 +81,17 @@ const index = (req, res) => { | ||
81 | { | 81 | { |
82 | round: false | 82 | round: false |
83 | } | 83 | } |
84 | + ], | ||
85 | + genders: [ | ||
86 | + { | ||
87 | + name: '男', | ||
88 | + value: '1,3', | ||
89 | + checked: true | ||
90 | + }, | ||
91 | + { | ||
92 | + name: '女', | ||
93 | + value: '2,3' | ||
94 | + } | ||
84 | ] | 95 | ] |
85 | }, | 96 | }, |
86 | helpers: { | 97 | helpers: { |
@@ -50,6 +50,25 @@ | @@ -50,6 +50,25 @@ | ||
50 | <br><br> | 50 | <br><br> |
51 | {{/each}} | 51 | {{/each}} |
52 | 52 | ||
53 | + <p class="title">2.1 选中状态切换</p> | ||
54 | + | ||
55 | + | ||
56 | + {{#each genders}} | ||
57 | + <div class="input-radio" data-value="{{value}}"> | ||
58 | + {{> icon/radio}} | ||
59 | + <label>{{name}}</label> | ||
60 | + </div> | ||
61 | + {{/each}} | ||
62 | + | ||
63 | + {{#each genders}} | ||
64 | + <div class="input-checkbox" data-value="{{value}}"> | ||
65 | + {{> icon/checkbox}} | ||
66 | + <label>{{name}}</label> | ||
67 | + </div> | ||
68 | + {{/each}} | ||
69 | + | ||
70 | + <div class="check-msg"></div> | ||
71 | + | ||
53 | <p class="title">3. 按钮</p> | 72 | <p class="title">3. 按钮</p> |
54 | <span class="btn">普通按钮</span> | 73 | <span class="btn">普通按钮</span> |
55 | <span class="btn disable">不可点按钮</span> | 74 | <span class="btn disable">不可点按钮</span> |
@@ -164,6 +183,7 @@ | @@ -164,6 +183,7 @@ | ||
164 | <span class="btn alert-btn">alert</span> | 183 | <span class="btn alert-btn">alert</span> |
165 | <span class="btn red confirm-btn">confirm</span> | 184 | <span class="btn red confirm-btn">confirm</span> |
166 | <span class="btn white dialog-btn">dialog</span> | 185 | <span class="btn white dialog-btn">dialog</span> |
186 | + | ||
167 | {{/ content}} | 187 | {{/ content}} |
168 | </div> | 188 | </div> |
169 | 189 |
@@ -14,6 +14,7 @@ var change = $('#change'); | @@ -14,6 +14,7 @@ var change = $('#change'); | ||
14 | var show = false; | 14 | var show = false; |
15 | 15 | ||
16 | require('../plugins/tips'); | 16 | require('../plugins/tips'); |
17 | +require('../plugins/check'); | ||
17 | 18 | ||
18 | $('.alert-btn').click(function() { | 19 | $('.alert-btn').click(function() { |
19 | new _alert('购买成功<br>进入 个人中心>我的订单<br>查看门票信息').show(); | 20 | new _alert('购买成功<br>进入 个人中心>我的订单<br>查看门票信息').show(); |
@@ -67,6 +68,21 @@ change.click(function() { | @@ -67,6 +68,21 @@ change.click(function() { | ||
67 | 68 | ||
68 | }); | 69 | }); |
69 | 70 | ||
71 | +// check | ||
72 | +$('.input-radio').check({ | ||
73 | + type: 'radio', | ||
74 | + onChange: function(ele, checked, value) { | ||
75 | + $('.check-msg').html((checked ? '选中' : '取消选中') + ': ' + value); | ||
76 | + } | ||
77 | +}); | ||
78 | + | ||
79 | +$('.input-checkbox').check({ | ||
80 | + type: 'checkbox', | ||
81 | + onChange: function(ele, checked, value) { | ||
82 | + $('.check-msg').html((checked ? '选中' : '取消选中') + ': ' + value); | ||
83 | + } | ||
84 | +}); | ||
85 | + | ||
70 | 86 | ||
71 | $(function() { | 87 | $(function() { |
72 | // 运行此demo | 88 | // 运行此demo |
@@ -8,8 +8,8 @@ var jQuery = require('yoho-jquery'); | @@ -8,8 +8,8 @@ var jQuery = require('yoho-jquery'); | ||
8 | checkedHtml: '' | 8 | checkedHtml: '' |
9 | }, | 9 | }, |
10 | checkbox: { | 10 | checkbox: { |
11 | - uncheckedHtml: '', | ||
12 | - checkedHtml: '' | 11 | + uncheckedHtml: '', |
12 | + checkedHtml: '' | ||
13 | } | 13 | } |
14 | }; | 14 | }; |
15 | 15 |
-
Please register or login to post a comment