登录  /  注册
博主信息
博文 43
粉丝 0
评论 3
访问量 34836
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
uniapp uView2.0 input组件,数字统计showWordLimit去除,改底层input组件添加
Time
原创
982人浏览过

引用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举报处理!
全部评论 文明上网理性发言,请遵守新闻评论服务协议
0条评论
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号

  • 登录PHP中文网,和优秀的人一起学习!
    全站2000+教程免费学