Skip to content

Commit 0cda53c

Browse files
authored
之前form里的button的form-type写错了,写成了formType,已经修正了
1 parent b9c050a commit 0cda53c

1 file changed

Lines changed: 14 additions & 23 deletions

File tree

‎pages/component/form/form.vue‎

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<view>
3-
<page-head :title="title"></page-head>
3+
<page-head title="form"></page-head>
44
<view class="uni-padding-wrap uni-common-mt">
55
<form @submit="formSubmit" @reset="formReset">
66
<view class="uni-form-item uni-column">
@@ -13,21 +13,21 @@
1313
<view class="title">radio</view>
1414
<radio-group name="radio">
1515
<label>
16-
<radio value="radio1" />选项一
16+
<radio value="radio1" /><text>选项一</text>
1717
</label>
1818
<label>
19-
<radio value="radio2" />选项二
19+
<radio value="radio2" /><text>选项二</text>
2020
</label>
2121
</radio-group>
2222
</view>
2323
<view class="uni-form-item uni-column">
2424
<view class="title">checkbox</view>
2525
<checkbox-group name="checkbox">
2626
<label>
27-
<checkbox value="checkbox1" />选项一
27+
<checkbox value="checkbox1" /><text>选项一</text>
2828
</label>
2929
<label>
30-
<checkbox value="checkbox2" />选项二
30+
<checkbox value="checkbox2" /><text>选项二</text>
3131
</label>
3232
</checkbox-group>
3333
</view>
@@ -40,8 +40,8 @@
4040
<input class="uni-input" name="input" placeholder="这是一个输入框" />
4141
</view>
4242
<view class="uni-btn-v">
43-
<button formType="submit">Submit</button>
44-
<button type="default" formType="reset">Reset</button>
43+
<button form-type="submit">Submit</button>
44+
<button type="default" form-type="reset">Reset</button>
4545
</view>
4646
</form>
4747
</view>
@@ -51,35 +51,26 @@
5151
export default {
5252
data() {
5353
return {
54-
title: 'form',
55-
pickerHidden: true,
56-
chosen: ''
5754
}
5855
},
5956
methods: {
60-
pickerConfirm: function(e) {
61-
this.pickerHidden = true
62-
this.chosen = e.target.value
63-
},
64-
pickerCancel: function(e) {
65-
this.pickerHidden = true
66-
},
67-
pickerShow: function(e) {
68-
this.pickerHidden = false
69-
},
7057
formSubmit: function(e) {
7158
console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
59+
var formdata = e.detail.value
60+
uni.showModal({
61+
content: '表单数据内容:' + JSON.stringify(formdata),
62+
showCancel: false
63+
});
7264
},
7365
formReset: function(e) {
7466
console.log('清空数据')
75-
this.chosen = ''
7667
}
7768
}
7869
}
7970
</script>
8071

8172
<style>
8273
.uni-form-item .title {
83-
padding: 20upx 0;
74+
padding: 20rpx 0;
8475
}
85-
</style>
76+
</style>

0 commit comments

Comments
 (0)