Vue el-input实现动态显示type为textarea的

2019-12-18  本文已影响0人  Marissa_z

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;

上一篇 下一篇

猜你喜欢

热点阅读