The element text field prohibits manual stretching, two methods, textarea


1. style mode

html

<el-input
	v-model="content"
	:rows="3"
	class="r_n"
	type="textarea"
	maxlength="40"
	placeholder=""
	style="height: 100%;"
/>

css

stylelabel definitionlang="scss" scoped

::v-deep .r_n {
     
     
    .el-textarea__inner {
     
     
        resize: none;
    }
}

Element's built-in prohibition stretching method

none: Compact Stretch
both: Both (both vertical and horizontal)
horizontal: Horizontal (horizontal stretch)
vertica: Vertical (vertical stretch)

<el-input
	v-model="content"
	:rows="3"
	resize="none"
	type="textarea"
	maxlength="40"
	placeholder=""
	style="height: 100%;"
/>

suggestion

It is recommended to use styles to prohibit stretching. When the text field is in the state of prohibiting input, using the elementbuilt-in prohibition of stretching will affect resizethe display. resizeIn the state where input is prohibited in the text field, use the built-in prohibit stretching function to display only one line, while the style prohibits stretching can be resizedisplayed according to the set value.

Je suppose que tu aimes

Origine blog.csdn.net/weixin_51157081/article/details/132351850
conseillé
Classement