<textarea class="site" maxlength="50" @input="descInput" v-model="desc" placeholder="最多输入50个字" ></textarea>
<span class="xianzhi">{{remnant}}/50</span>

data(){
 return{
 remnant: 200
 }
}
 
methods:{
 descInput(){
 var txtVal = this.desc.length;
 this.remnant = 200 - txtVal;
 }
}
Logo

前往低代码交流专区

更多推荐