当前位置: 首页 > news >正文

uniapp使用easyinput文本框显示输入的字数和限制的字数

uniapp使用easyinput文本框显示输入的字数和限制的字数

先上效果图:
在这里插入图片描述
整体代码如下:

<template><view class="nameInfoContent"><uni-easyinput class="uni-mt-5" suffixIcon="checkmarkempty" v-model="memberName" placeholder="请输入新昵称"maxlength="24" @iconClick="submit" @input="handleInput"></uni-easyinput><view class="wordsNum"><view class="tipLips">支持2-24位中英文数字,符号-和_</view><view class="juedui">{{ inputValueLength ? inputValueLength : 0  }}/24 </view></view></view>
</template><script>export default {data() {return {memberName: '',inputValueLength: ''}},methods: {handleInput(e) {this.inputValueLength = parseInt(e.length);}}}
</script><style lang="scss" scoped>.nameInfoContent {position: relative;padding: 32rpx;min-height: calc(100vh - 152rpx);.wordsNum {display: flex;justify-content: space-between;margin-top: 24rpx;.tipLips,.juedui {font-size: 24rpx;color: #999999;}}}
</style>

Live life to the fullest by drawing on your strengths.

http://www.lryc.cn/news/469315.html

相关文章:

  • 蓝牙技术的多种模式详解
  • 攻防世界-流量分析WP
  • 打印爱心型
  • WASM 使用说明23事(RUST实现)
  • Visual studio 下载安装
  • jEasyUI 创建自定义视图
  • SpringMVC6-SpringMVC的视图
  • echarts给Y轴的不同轴线设置不同的颜色的样式
  • 从0到1构建 UniApp + Vue3 + TypeScript 移动端跨平台开源脚手架
  • 论文笔记:LaDe: The First Comprehensive Last-mile Delivery Dataset from Industry
  • 无用的知识又增加了-静态二值贝叶斯滤波
  • cesium相机(camera)控制
  • Java 反射
  • 【目标检测01】真实框、预测框、锚框和交并比IoU
  • 青少年编程能力等级测评CPA C++五级试卷(2)
  • SATA数据线
  • 《云原生安全攻防》-- K8s攻击案例:权限维持的攻击手法
  • 回溯算法-Java【力扣】【算法学习day.14】
  • 从本地到云端:跨用户请求问题的完美解决方案
  • leetcode day4 409+5
  • 英语语法学习框架(考研)
  • 基于neo4j的学术论文关系管理系统
  • C#中的委托、匿名方法、Lambda、Action和Func
  • IDEA关联Tomcat——最新版本IDEA 2024
  • 【如何获取股票数据18】Python、Java等多种主流语言实例演示获取股票行情api接口之沪深A股解禁限售数据获取实例演示及接口API说明文档
  • NVR小程序接入平台/设备EasyNVR多品牌NVR管理工具/设备的多维拓展与灵活应用
  • GPT-4o 和 GPT-4 Turbo 模型之间的对比
  • gin入门教程(10):实现jwt认证
  • Python 基础语法 - 数据类型
  • 自托管无代码数据库Undb