19
19
v-model =" localValue"
20
20
class =" textarea-field__input"
21
21
:class =" {
22
- 'textarea-field__no -resize': autoGrow,
23
- 'textarea-field__no -border': noBorder,
22
+ 'textarea-field__input_no -resize': autoGrow,
23
+ 'textarea-field__input_no -border': noBorder,
24
24
}"
25
25
:placeholder =" placeholder"
26
26
:readonly =" props.readonly"
29
29
@input.stop
30
30
></textarea >
31
31
<div
32
- v-if =" !isValid"
33
- class =" textarea-field__error-message "
32
+ v-if =" hint || !isValid"
33
+ class =" textarea-field__hint "
34
34
>
35
- <p >{{ errorMessagesString }}</p >
35
+ <p
36
+ v-if =" !isValid"
37
+ class =" textarea-field__error-message"
38
+ >
39
+ {{ errorMessagesString }}
40
+ </p >
41
+ <p v-else >{{ hint }}</p >
36
42
</div >
37
43
</div >
38
44
</template >
@@ -68,6 +74,10 @@ const props = defineProps({
68
74
type: String ,
69
75
default: ' ' ,
70
76
},
77
+ hint: {
78
+ type: String ,
79
+ default: ' ' ,
80
+ },
71
81
rows: {
72
82
type: [Number , String ],
73
83
default: 5 ,
@@ -141,28 +151,30 @@ watch(localValue, async (newValue) => {
141
151
color : base-text-color ;
142
152
143
153
& _optional label ::after {
144
- content : '(optional )' ;
154
+ content : '(Optional )' ;
145
155
display : inline-block ;
146
156
margin-left : 3px ;
147
157
color : #21 21 21 ;
148
158
text-decoration : none ;
149
159
}
150
160
151
161
& __input {
162
+ box-sizing : border-box ;
152
163
width : 100% ;
153
164
background-color : #FB FB FB ;
154
165
border : 1px solid #D8 D8 D8 ;
155
166
border-radius : 2px ;
156
167
padding : 11px ;
157
- }
168
+ resize : vertical ;
158
169
159
- & __no -resize {
160
- resize : none ;
161
- }
170
+ & _no -resize {
171
+ resize : none ;
172
+ }
162
173
163
- & __no-border {
164
- border : none ;
165
- outline : none ;
174
+ & _no-border {
175
+ border : none ;
176
+ outline : none ;
177
+ }
166
178
}
167
179
168
180
& __label {
@@ -178,16 +190,20 @@ watch(localValue, async (newValue) => {
178
190
outline : 1px solid #47 97 f2 ;
179
191
}
180
192
181
- & __error-message {
193
+ & __hint {
182
194
margin-top : 4px ;
183
195
184
196
p {
185
- color : #FF 6A 6A ;
197
+ color : #70 70 70 ;
186
198
font-size : 12px ;
187
199
font-weight : 400 ;
188
200
line-height : 1.3 ;
189
201
margin : 0 ;
190
202
}
203
+
204
+ .textarea-field__error-message {
205
+ color : #FF 6A 6A ;
206
+ }
191
207
}
192
208
}
193
209
</style >
0 commit comments