|
9 | 9 | <a-input size="large" type="text" placeholder="邮箱"></a-input> |
10 | 10 | </a-form-item> |
11 | 11 |
|
12 | | - <a-popover placement="right" trigger="click" :visible="state.passwordLevelChecked"> |
| 12 | + <a-popover placement="rightTop" trigger="click" :visible="state.passwordLevelChecked"> |
13 | 13 | <template slot="content"> |
14 | 14 | <div :style="{ width: '240px' }" > |
15 | 15 | <div :class="['user-register', passwordLevelClass]">强度:<span>{{ passwordLevelName }}</span></div> |
|
36 | 36 |
|
37 | 37 | <a-form-item |
38 | 38 | fieldDecoratorId="mobile" |
39 | | - :fieldDecoratorOptions="{rules: [{ required: true, message: '手机号' }], validateTrigger: 'blur'}"> |
40 | | - |
| 39 | + :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入正确的手机号', pattern: /^1[3456789]\d{9}$/ }, { validator: this.handlePhoneCheck } ], validateTrigger: ['change', 'blur'] }"> |
| 40 | + <!-- |
41 | 41 | <a-input-group size="large" compact> |
42 | 42 | <a-select style="width: 20%" size="large" defaultValue="+86"> |
43 | 43 | <a-select-option value="+86">+86</a-select-option> |
44 | 44 | <a-select-option value="+87">+87</a-select-option> |
45 | 45 | </a-select> |
46 | | - <a-input style="width: 80%" placeholder="11 位手机号"></a-input> |
| 46 | + <a-input style="width: 80%" size="large" placeholder="11 位手机号"></a-input> |
47 | 47 | </a-input-group> |
| 48 | + --> |
| 49 | + <a-input size="large" placeholder="11 位手机号"> |
| 50 | + <a-select slot="addonBefore" size="large" defaultValue="+86"> |
| 51 | + <a-select-option value="+86">+86</a-select-option> |
| 52 | + <a-select-option value="+87">+87</a-select-option> |
| 53 | + </a-select> |
| 54 | + </a-input> |
48 | 55 | </a-form-item> |
49 | 56 |
|
50 | 57 | <a-row :gutter="16"> |
|
180 | 187 | callback() |
181 | 188 | }, |
182 | 189 |
|
| 190 | + handlePhoneCheck (rule, value, callback) { |
| 191 | + console.log('rule:', rule) |
| 192 | + console.log('value', value) |
| 193 | + console.log('callback', callback) |
| 194 | +
|
| 195 | + callback() |
| 196 | + }, |
| 197 | +
|
183 | 198 | handlePasswordInputClick () { |
184 | 199 | if (!this.isMobile) { |
185 | 200 | this.state.passwordLevelChecked = true |
|
0 commit comments