Skip to content

Commit 4a45c99

Browse files
committed
优化基础表单
1 parent ca46568 commit 4a45c99

File tree

2 files changed

+64
-5
lines changed

2 files changed

+64
-5
lines changed

src/components/page/BaseForm.vue

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@
2525
</el-col>
2626
<el-col class="line" :span="2">-</el-col>
2727
<el-col :span="11">
28-
<el-time-picker type="fixed-time" placeholder="选择时间" v-model="form.date2" style="width: 100%;"></el-time-picker>
28+
<el-time-picker placeholder="选择时间" v-model="form.date2" style="width: 100%;"></el-time-picker>
2929
</el-col>
3030
</el-form-item>
31+
<el-form-item label="城市级联">
32+
<el-cascader :options="options" v-model="form.options"></el-cascader>
33+
</el-form-item>
3134
<el-form-item label="选择开关">
32-
<el-switch on-text="" off-text="" v-model="form.delivery"></el-switch>
35+
<el-switch v-model="form.delivery"></el-switch>
3336
</el-form-item>
3437
<el-form-item label="多选框">
3538
<el-checkbox-group v-model="form.type">
@@ -46,10 +49,10 @@
4649
</el-radio-group>
4750
</el-form-item>
4851
<el-form-item label="文本框">
49-
<el-input type="textarea" v-model="form.desc"></el-input>
52+
<el-input type="textarea" rows="5" v-model="form.desc"></el-input>
5053
</el-form-item>
5154
<el-form-item>
52-
<el-button type="primary" @click="onSubmit">提交</el-button>
55+
<el-button type="primary" @click="onSubmit">表单提交</el-button>
5356
<el-button>取消</el-button>
5457
</el-form-item>
5558
</el-form>
@@ -63,6 +66,58 @@
6366
export default {
6467
data: function(){
6568
return {
69+
options:[
70+
{
71+
value: 'guangdong',
72+
label: '广东省',
73+
children: [
74+
{
75+
value: 'guangzhou',
76+
label: '广州市',
77+
children: [
78+
{
79+
value: 'tianhe',
80+
label: '天河区'
81+
},
82+
{
83+
value: 'haizhu',
84+
label: '海珠区'
85+
}
86+
]
87+
},
88+
{
89+
value: 'dongguan',
90+
label: '东莞市',
91+
children: [
92+
{
93+
value: 'changan',
94+
label: '长安镇'
95+
},
96+
{
97+
value: 'humen',
98+
label: '虎门镇'
99+
}
100+
]
101+
}
102+
]
103+
},
104+
{
105+
value: 'hunan',
106+
label: '湖南省',
107+
children: [
108+
{
109+
value: 'changsha',
110+
label: '长沙市',
111+
children: [
112+
{
113+
value: 'yuelu',
114+
label: '岳麓区'
115+
}
116+
]
117+
}
118+
]
119+
}
120+
],
66121
form: {
67122
name: '',
68123
region: '',
@@ -71,7 +126,8 @@
71126
delivery: true,
72127
type: ['步步高'],
73128
resource: '小天才',
74-
desc: ''
129+
desc: '',
130+
options: []
75131
}
76132
}
77133
},

static/css/main.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ a{text-decoration: none}
6464
.el-time-panel__content::after, .el-time-panel__content::before {
6565
margin-top: -7px;
6666
}
67+
.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){
68+
padding-bottom: 0;
69+
}
6770
/*Readme*/
6871
.ms-doc .el-checkbox__input.is-disabled+.el-checkbox__label{
6972
color: #333;

0 commit comments

Comments
 (0)