conf.vue
4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<template>
<Tabs size="small">
<TabPane label="基础配置">
<Form ref="formValidate" :model="formValidate" :rules="ruleValidate" :label-width="120">
<FormItem label="活动规则" required>
<Input type="textarea" :autosize="{minRows: 2,maxRows: 30}"
placeholder="请输入活动规则" :maxlength="2000"></Input>
</FormItem>
<FormItem label="分享链接" required>
<Input type="text"
placeholder="活动分享链接"></Input>
</FormItem>
<FormItem label="提示文案(上)" required>
<Input type="text"
placeholder="提示文案(上)"></Input>
</FormItem>
<FormItem label="提示文案(下)" required>
<Input type="text"
placeholder="提示文案(下)"></Input>
</FormItem>
<FormItem label="跳转链接(左)" required>
<Input type="text"
placeholder="活动底部链接(左)"></Input>
</FormItem>
<FormItem label="跳转链接(右)" required>
<Input type="text"
placeholder="活动底部链接(右)"></Input>
</FormItem>
<FormItem label="活动最大参与次数" required>
<Input type="text"
placeholder="活动最大参与次数"></Input>
</FormItem>
<FormItem label="每天最大抽奖次数" required>
<Input type="text"
placeholder="每天最大抽奖次数"></Input>
</FormItem>
<FormItem>
<Button type="primary" @click="handleSubmit('formValidate')">保存</Button>
<Button type="warning" @click="handleSubmit('formValidate')">预览</Button>
</FormItem>
</Form>
</TabPane>
<TabPane label="奖品配置">标签二的内容</TabPane>
</Tabs>
</template>
<script>
export default {
data () {
return {
formValidate: {
name: '',
mail: '',
city: '',
gender: '',
interest: [],
date: '',
time: '',
desc: ''
},
ruleValidate: {
name: [
{ required: true, message: 'The name cannot be empty', trigger: 'blur' }
],
mail: [
{ required: true, message: 'Mailbox cannot be empty', trigger: 'blur' },
{ type: 'email', message: 'Incorrect email format', trigger: 'blur' }
],
city: [
{ required: true, message: 'Please select the city', trigger: 'change' }
],
gender: [
{ required: true, message: 'Please select gender', trigger: 'change' }
],
interest: [
{ required: true, type: 'array', min: 1, message: 'Choose at least one hobby', trigger: 'change' },
{ type: 'array', max: 2, message: 'Choose two hobbies at best', trigger: 'change' }
],
date: [
{ required: true, type: 'date', message: 'Please select the date', trigger: 'change' }
],
time: [
{ required: true, type: 'string', message: 'Please select time', trigger: 'change' }
],
desc: [
{ required: true, message: 'Please enter a personal introduction', trigger: 'blur' },
{ type: 'string', min: 20, message: 'Introduce no less than 20 words', trigger: 'blur' }
]
}
}
},
methods: {
handleSubmit (name) {
this.$refs[name].validate((valid) => {
if (valid) {
this.$Message.success('Success!');
} else {
this.$Message.error('Fail!');
}
})
},
handleReset (name) {
this.$refs[name].resetFields();
}
}
}
</script>
<style lang="scss">
.ivu-form-item {
margin-bottom: 10px;
}
</style>