//作者:郅慧芳
//来源:CSDN
//原文:https://blog.csdn.net/qq_24612793/article/details/81283500
<div class="applyInput cb mt3">
<textarea placeholder="请输入" maxlength="100" @input="descInput" v-model="desc" />
<span class="numberV">{{txtVal}}/100</span>
</div>
<script>
export default {
name: 'applyAgent',
data () {
return {
txtVal: 0,
desc:""
}
},
methods: {
descInput(){
this.txtVal = this.desc.length;
}
}
}
</script>
效果图:
txtlength.png
网友评论