Vue中实现input输入框字数限制
<el-col :xs="18" :sm="18" :lg="18"><el-inputv-model="Form.description"placeholder="请输入内容"type="textarea"maxlength="100"@input="descInput">&l...
·
<el-col :xs="18" :sm="18" :lg="18">
<el-input
v-model="Form.description"
placeholder="请输入内容"
type="textarea"
maxlength="100"
@input="descInput"
></el-input>
<span class="gray"> 字数限制:{{ enter }}/100</span>
</el-col>
data() {
return {
enter: 0,
}
}
descInput() {
var txtVal = this.Form.description.length;
this.enter = txtVal;
},
更多推荐
已为社区贡献8条内容
所有评论(0)