需求:首先是給定高度,輸入文本框要自適應這個高度。文本超出高度就會顯示滾動條否則不顯示。
<el-row class="textarea-row">
<el-col :span="3" class="first-row-title">天氣</el-col>
<el-col :span="21" class="multi-rmk-col ">
<el-form-item prop="weather">
<el-input
type="textarea"
v-model="form.weather"
style="height: 100%"
></el-input>
</el-form-item>
</el-col>
</el-row>
.multi-rmk-col >>> .el-form-item__content,
.multi-rmk-col >>> .el-textarea__inner{
height: 100% !important;
}
::-webkit-scrollbar {
width: 6px; /*滾動條寬度*/
height: 6px; /*滾動條高度*/
}
.multi-rmk-col >>>.el-textarea__inner::-webkit-scrollbar-thumb {
background-color: rgba(168, 168, 168,.4);/*滾動條默認顯示的顏色*/
}
.multi-rmk-col >>>.el-textarea__inner::-webkit-scrollbar {
width: 8px;
height: 8px;
background-color: #4a4a4a;/*滾動條背景色顯示的顏色*/
}
參考文章
問題二:
加入這個,@input=“change($event)”
<el-form-item prop="weather">
<el-input
type="textarea"
v-model="form.weather"
style="height: 100%"
resize="none"
@input="change($event)"
></el-input>
</el-form-item>
methods: {
change(){
this.$forceUpdate();
},
參考文獻文章來源:http://www.zghlxwxcb.cn/news/detail-728230.html
參考文獻(問題更全)文章來源地址http://www.zghlxwxcb.cn/news/detail-728230.html
到了這里,關于<el-input> textarea文本域顯示滾動條(超過高度就自動顯示)+ <el-input >不能正常輸入,輸入了也不能刪除的問題的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!