|
5 | 5 | <form @submit="formSubmit" @reset="formReset"> |
6 | 6 | <view class="uni-form-item uni-column"> |
7 | 7 | <view class="title">switch</view> |
8 | | - <switch name="switch" /> |
| 8 | + <view> |
| 9 | + <switch name="switch" /> |
| 10 | + </view> |
9 | 11 | </view> |
10 | 12 | <view class="uni-form-item uni-column"> |
11 | 13 | <view class="title">radio</view> |
12 | 14 | <radio-group name="radio"> |
13 | | - <label><radio value="radio1" />选项一</label> |
14 | | - <label><radio value="radio2" />选项二</label> |
| 15 | + <label> |
| 16 | + <radio value="radio1" />选项一 |
| 17 | + </label> |
| 18 | + <label> |
| 19 | + <radio value="radio2" />选项二 |
| 20 | + </label> |
15 | 21 | </radio-group> |
16 | 22 | </view> |
17 | 23 | <view class="uni-form-item uni-column"> |
18 | 24 | <view class="title">checkbox</view> |
19 | 25 | <checkbox-group name="checkbox"> |
20 | | - <label><checkbox value="checkbox1" />选项一</label> |
21 | | - <label><checkbox value="checkbox2" />选项二</label> |
| 26 | + <label> |
| 27 | + <checkbox value="checkbox1" />选项一 |
| 28 | + </label> |
| 29 | + <label> |
| 30 | + <checkbox value="checkbox2" />选项二 |
| 31 | + </label> |
22 | 32 | </checkbox-group> |
23 | 33 | </view> |
24 | 34 | <view class="uni-form-item uni-column"> |
|
47 | 57 | } |
48 | 58 | }, |
49 | 59 | methods: { |
50 | | - pickerConfirm: function (e) { |
| 60 | + pickerConfirm: function(e) { |
51 | 61 | this.pickerHidden = true |
52 | 62 | this.chosen = e.target.value |
53 | 63 | }, |
54 | | - pickerCancel: function (e) { |
| 64 | + pickerCancel: function(e) { |
55 | 65 | this.pickerHidden = true |
56 | 66 | }, |
57 | | - pickerShow: function (e) { |
| 67 | + pickerShow: function(e) { |
58 | 68 | this.pickerHidden = false |
59 | 69 | }, |
60 | | - formSubmit: function (e) { |
| 70 | + formSubmit: function(e) { |
61 | 71 | console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value)) |
62 | 72 | }, |
63 | | - formReset: function (e) { |
64 | | - console.log("清空数据") |
| 73 | + formReset: function(e) { |
| 74 | + console.log('清空数据') |
65 | 75 | this.chosen = '' |
66 | 76 | } |
67 | 77 | } |
68 | 78 | } |
69 | 79 | </script> |
70 | 80 |
|
71 | 81 | <style> |
72 | | - .title{padding:10px 0 !important;} |
73 | | -</style> |
| 82 | + .uni-form-item .title { |
| 83 | + padding: 20upx 0; |
| 84 | + } |
| 85 | +</style> |
0 commit comments