1、<el-form-item label="备注" prop="memo" style="display:block">
<el-input
type="textarea"
v-model="updateDiseaseForm.memo"
class="wh462"
placeholder="描述当前疾病史备注情况"
maxlength="128" @input="descInput"></el-input>
<span class="numberV" style="position: absolute; right: 10px;bottom: 0;">{{txtVal}}/128</span>
</el-form-item>
2、methods:{
descInput(){
this.txtVal = this.updateDiseaseForm.memo.length;
},
}
3、在编辑框内显示从后台带回的字数,在带回值时进行如下赋值:
this.txtVal = this.updateDiseaseForm.memo.length;
最后
以上就是顺利电话最近收集整理的关于Vue el-input实现动态显示type为textarea的文字数量、剩余字数的全部内容,更多相关Vue内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复