update Input textarea

This commit is contained in:
梁灏 2019-09-14 12:32:07 +08:00
parent 4c01b87937
commit 4ffcc60bf0
2 changed files with 35 additions and 30 deletions

View file

@ -43,34 +43,36 @@
</div> </div>
<span class="ivu-input-prefix" v-else-if="showPrefix"><slot name="prefix"><i class="ivu-icon" :class="['ivu-icon-' + prefix]" v-if="prefix"></i></slot></span> <span class="ivu-input-prefix" v-else-if="showPrefix"><slot name="prefix"><i class="ivu-icon" :class="['ivu-icon-' + prefix]" v-if="prefix"></i></slot></span>
</template> </template>
<textarea <template v-else>
v-else <textarea
:id="elementId" :id="elementId"
:wrap="wrap" :wrap="wrap"
:autocomplete="autocomplete" :autocomplete="autocomplete"
:spellcheck="spellcheck" :spellcheck="spellcheck"
ref="textarea" ref="textarea"
:class="textareaClasses" :class="textareaClasses"
:style="textareaStyles" :style="textareaStyles"
:placeholder="placeholder" :placeholder="placeholder"
:disabled="disabled" :disabled="disabled"
:rows="rows" :rows="rows"
:maxlength="maxlength" :maxlength="maxlength"
:readonly="readonly" :readonly="readonly"
:name="name" :name="name"
:value="currentValue" :value="currentValue"
:autofocus="autofocus" :autofocus="autofocus"
@keyup.enter="handleEnter" @keyup.enter="handleEnter"
@keyup="handleKeyup" @keyup="handleKeyup"
@keypress="handleKeypress" @keypress="handleKeypress"
@keydown="handleKeydown" @keydown="handleKeydown"
@focus="handleFocus" @focus="handleFocus"
@blur="handleBlur" @blur="handleBlur"
@compositionstart="handleComposition" @compositionstart="handleComposition"
@compositionupdate="handleComposition" @compositionupdate="handleComposition"
@compositionend="handleComposition" @compositionend="handleComposition"
@input="handleInput"> @input="handleInput">
</textarea> </textarea>
<span class="ivu-input-word-count" v-if="showWordLimit">{{ textLength }}/{{ upperLimit }}</span>
</template>
</div> </div>
</template> </template>
<script> <script>
@ -215,7 +217,7 @@
`${prefixCls}-wrapper`, `${prefixCls}-wrapper`,
{ {
[`${prefixCls}-wrapper-${this.size}`]: !!this.size, [`${prefixCls}-wrapper-${this.size}`]: !!this.size,
[`${prefixCls}-type`]: this.type, [`${prefixCls}-type-${this.type}`]: this.type,
[`${prefixCls}-group`]: this.prepend || this.append || (this.search && this.enterButton), [`${prefixCls}-group`]: this.prepend || this.append || (this.search && this.enterButton),
[`${prefixCls}-group-${this.size}`]: (this.prepend || this.append || (this.search && this.enterButton)) && !!this.size, [`${prefixCls}-group-${this.size}`]: (this.prepend || this.append || (this.search && this.enterButton)) && !!this.size,
[`${prefixCls}-group-with-prepend`]: this.prepend, [`${prefixCls}-group-with-prepend`]: this.prepend,

View file

@ -179,7 +179,10 @@
color: @subsidiary-color; color: @subsidiary-color;
font-size: @font-size-small; font-size: @font-size-small;
} }
&-type-textarea &-word-count{
align-items: flex-end;
top: auto;
}
} }
.@{input-prefix-cls}-group{ .@{input-prefix-cls}-group{