我是靠谱客的博主 顺利电话,这篇文章主要介绍Vue el-input实现动态显示type为textarea的文字数量、剩余字数,现在分享给大家,希望可以做个参考。

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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部