博客列表 >uniapp uView2.0 input组件,数字统计showWordLimit去除,改底层input组件添加

uniapp uView2.0 input组件,数字统计showWordLimit去除,改底层input组件添加

Time
Time原创
2023年03月01日 19:20:39736浏览

引用input组件添加数字统计showWordLimit=”true”

  1. <u--input type="text" maxlength="10" placeholder="请填写具体诊断" border="none" @change="change"
  2. placeholderStyle="color:#CCCCCC;font-size: 28rpx;height: 40rpx;font-weight: 500;line-height: 33rpx;" showWordLimit="true"></u--input>

文件uni-modules/components/u-input/u-input.vue添加修改代码

  1. //在input标签后添加:
  2. <text
  3. class="u-input__showWordLimit"
  4. :style="{
  5. 'background-color': disabled ? 'transparent' : '#fff',
  6. }"
  7. v-if="showWordLimit"
  8. >{{ innerValue.length }}/{{ maxlength }}</text>
  9. //style里.u-input下添加
  10. &__showWordLimit {
  11. position: absolute;
  12. right: 5px;
  13. bottom: 2px;
  14. font-size: 12px;
  15. color: $u-tips-color;
  16. background-color: #ffffff;
  17. padding: 1px 4px;
  18. }
声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议