File tree Expand file tree Collapse file tree 2 files changed +14
-16
lines changed
src/uni_modules/wot-design-uni/components/wd-textarea Expand file tree Collapse file tree 2 files changed +14
-16
lines changed Original file line number Diff line number Diff line change 135135
136136 @include e (suffix ) {
137137 flex-shrink : 0 ;
138- margin-left : $-textarea-icon-margin ;
139138 line-height : initial ;
140139 }
141140
144143 padding : 0 ;
145144 font-size : 0 ;
146145 background : $-textarea-bg ;
146+ padding-right : 24px ;
147+ box-sizing : border-box ;
147148
148149 @include when (show- limit) {
149150 padding-bottom : 36px ;
150151 }
152+
153+ @include when (suffix ) {
154+ padding-right : calc ($-textarea-icon-size + 8px );
155+ }
151156 }
152157
153158
167172 & ::-webkit-input-placeholder {
168173 color : $-input-placeholder-color ;
169174 }
170-
171- @include when (suffix ) {
172- padding-right : calc ($-textarea-icon-size + 8px );
173- }
174175 }
175176
176177 @include e (suffix ) {
177178 position : absolute ;
179+ z-index : 1 ;
178180 right : 0 ;
179181 top : 0 ;
180182 bottom : 0 ;
185187 font-size : $-textarea-icon-size ;
186188 color : $-textarea-icon-color ;
187189 background : $-textarea-bg ;
188- // vertical-align: middle;
189- // line-height: $-cell-line-height;
190190 }
191191
192192 @include edeep (clear ) {
312312 display : none ;
313313 }
314314
315-
316- .wd-textarea__inner {
317- padding-right : 24px ;
318- }
319-
320315 .wd-textarea__suffix {
321316 right : 0 ;
322317 }
Original file line number Diff line number Diff line change 11<template >
2- <view :class =" rootClass" :style =" customStyle" @click = " handleClick " >
2+ <view :class =" rootClass" :style =" customStyle" >
33 <view v-if =" label || useLabelSlot" :class =" labelClass" :style =" labelStyle" >
44 <view v-if =" prefixIcon || usePrefixSlot" class =" wd-textarea__prefix" >
55 <wd-icon v-if =" prefixIcon && !usePrefixSlot" custom-class =" wd-textarea__icon" :name =" prefixIcon" @click =" onClickPrefixIcon" />
1212 </view >
1313
1414 <!-- 文本域 -->
15- <view :class =" `wd-textarea__value ${customTextareaContainerClass} ${showWordCount ? 'is-show-limit' : ''}`" >
15+ <view :class =" `wd-textarea__value ${showClear ? 'is-suffix' : ''} ${ customTextareaContainerClass} ${showWordCount ? 'is-show-limit' : ''}`" >
1616 <textarea
17- :class =" `wd-textarea__inner ${showClear ? 'is-suffix' : ''} ${ customTextareaClass}`"
17+ :class =" `wd-textarea__inner ${customTextareaClass}`"
1818 v-model =" inputValue"
1919 :show-count =" false"
2020 :placeholder =" placeholder || translate('placeholder')"
@@ -212,12 +212,15 @@ function clear() {
212212 .then (() => requestAnimationFrame ())
213213 .then (() => requestAnimationFrame ())
214214 .then (() => {
215- isFocus .value = true
216215 emit (' change' , {
217216 value: ' '
218217 })
219218 emit (' update:modelValue' , inputValue .value )
220219 emit (' clear' )
220+
221+ requestAnimationFrame ().then (() => {
222+ isFocus .value = true
223+ })
221224 })
222225}
223226// 失去焦点时会先后触发change、blur,未输入内容但失焦不触发 change 只触发 blur
You can’t perform that action at this time.
0 commit comments