1
1
<style >
2
- .sign-form {
3
- width : 600px ;
4
- margin : auto ;
5
- }
6
2
.title {
7
3
padding : 10px 0 ;
8
4
font-size : 30px ;
13
9
<div >
14
10
<div class =" title" >注册</div >
15
11
<el-form
16
- :model =" ruleForm "
12
+ :model =" signForm "
17
13
status-icon
18
14
:rules =" rules"
19
- ref =" ruleForm "
15
+ ref =" signForm "
20
16
label-width =" 100px"
21
17
class =" sign-form"
22
18
>
23
19
<el-form-item label =" 注册邮箱" prop =" email" >
24
- <el-input v-model =" ruleForm .email" ></el-input >
20
+ <el-input v-model =" signForm .email" ></el-input >
25
21
</el-form-item >
26
22
<el-form-item label =" 登录密码" prop =" pass" >
27
- <el-input type =" password" v-model =" ruleForm .pass" autocomplete =" off" ></el-input >
23
+ <el-input type =" password" v-model =" signForm .pass" autocomplete =" off" ></el-input >
28
24
</el-form-item >
29
25
<el-form-item label =" 确认密码" prop =" checkPass" >
30
- <el-input type =" password" v-model =" ruleForm .checkPass" autocomplete =" off" ></el-input >
26
+ <el-input type =" password" v-model =" signForm .checkPass" autocomplete =" off" ></el-input >
31
27
</el-form-item >
32
28
<el-form-item label-width =" 0px" >
33
- <el-button type =" primary" @click =" submitForm('ruleForm ')" >注册</el-button >
29
+ <el-button type =" primary" @click =" submitForm('signForm ')" >注册</el-button >
34
30
</el-form-item >
35
31
</el-form >
36
32
</div >
@@ -53,24 +49,24 @@ export default {
53
49
if (value === " " ) {
54
50
callback (new Error (" 请输入密码" ));
55
51
} else {
56
- if (this .ruleForm .checkPass !== " " ) {
57
- this .$refs .ruleForm .validateField (" checkPass" );
52
+ if (this .signForm .checkPass !== " " ) {
53
+ this .$refs .signForm .validateField (" checkPass" );
58
54
}
59
55
callback ();
60
56
}
61
57
};
62
58
var validatePass2 = (rule , value , callback ) => {
63
59
if (value === " " ) {
64
60
callback (new Error (" 请再次输入密码" ));
65
- } else if (value !== this .ruleForm .pass ) {
61
+ } else if (value !== this .signForm .pass ) {
66
62
callback (new Error (" 两次输入密码不一致!" ));
67
63
} else {
68
64
callback ();
69
65
}
70
66
};
71
67
72
68
return {
73
- ruleForm : {
69
+ signForm : {
74
70
email: " " ,
75
71
pass: " " ,
76
72
checkPass: " "
@@ -95,8 +91,10 @@ export default {
95
91
});
96
92
},
97
93
sign () {
94
+ console .log (" signService" , signService);
95
+
98
96
return signService
99
- .sign ()
97
+ .sign (this . signForm )
100
98
.then (() => {
101
99
//
102
100
})
0 commit comments