-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
93 lines (81 loc) · 2.08 KB
/
App.vue
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
<template>
<a-locale-provider :locale="zh_CN">
<div id="app">
<div>
<a-form :form="form">
<a-form-item label="加了placeholder" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input placeholder="请输入用户账号" v-decorator="[ 'username', validatorRules.username]" />
</a-form-item>
<a-form-item label="加了prefix,suffix" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input type="password" placeholder="请输入登录密码" v-decorator="[ 'password', validatorRules.password]">
<a-icon slot="prefix" type="user" />
<a-tooltip slot="suffix" title="Extra information">
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
</a-tooltip>
</a-input>
当加了prefix,从上面个Input按tab键切换下来需要按两次,
加了suffix从这个Input按tab键切换到下个input需要按两次
</a-form-item>
<a-form-item label="Note" :label-col="{ span: 5 }" :wrapper-col="{ span: 12 }">
<a-input v-decorator="['note', { rules: [{ required: true, message: 'Please input your note!' }] }]" />
</a-form-item>
</a-form>
</div>
</div>
</a-locale-provider>
</template>
<script>
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default {
name: 'app',
data() {
return {
zh_CN,
labelCol: {
xs: {
span: 24
},
sm: {
span: 5
}
},
wrapperCol: {
xs: {
span: 24
},
sm: {
span: 16
}
},
form: this.$form.createForm(this),
validatorRules: {
username: {
rules: [{
required: true,
message: '请输入用户账号!'
}, {
validator: this.validateUsername,
}]
},
password: {
rules: [{
required: true,
message: '请输入密码!'
}]
}
}
}
},
components: {}
}
</script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>