当前位置:网站首页>El input text field word limit, beyond which the display turns red and input is prohibited
El input text field word limit, beyond which the display turns red and input is prohibited
2022-07-01 22:52:00 【1024_ Byte】
Effect display 
Code :
<el-form-item label=" Description of maintenance points :" prop="remark" :rules="[{ required: true, message: ' Can't be empty ' }]">
<el-input
type="textarea"
@input="timeEffectInput" // Input event ( Deal with restrictions here )
maxlength="200" // Maximum word limit
resize="none" // Controls whether it can be scaled by the user
show-word-limit // Whether to display input word count
:rows="3" // Adaptive content height , Can pass in objects , Such as ,{ minRows: 2, maxRows: 6 }
style="width: 92%"
v-model="dialogForm.remark"
placeholder=" Please enter the description of maintenance points !"
></el-input>
</el-form-item>
timeEffectInput() {
const length = this.dialogForm.remark.length // First get the text length of the current input text field
if (length >= 200) {
// When the length exceeds 200
// Get the text field count statistics and set the font to red
this.$el.querySelector('.el-input__count').style = 'color:red !important'
// Prevent subsequent input overflow interception 0-200 The characters of
this.dialogForm.remark = this.dialogForm.remark.substr(0, 200)
} else {
// If it does not exceed, it will be set to the original font color
this.$el.querySelector('.el-input__count').style = 'color:#909399 !important'
}
},
边栏推荐
- Tourism Management System
- QT uses ffmpeg4 to convert the qimage of ARGB to yuv422p
- 功能测试报告的编写
- Pytorch nn.functional.unfold()的简单理解与用法
- Selection of all-optical technology in the park - Part 2
- 2020-ViT ICLR
- Learn MySQL from scratch - database and data table operations
- 使用 Three.js 实现'雪糕'地球,让地球也凉爽一夏
- MySQL stored procedure
- Understanding of transactions in MySQL
猜你喜欢
![[jetcache] how to use jetcache](/img/fa/5b3abe53bb7e9db6af2dbb1cb76a31.png)
[jetcache] how to use jetcache

Cutefishos system~

Learn MySQL from scratch - database and data table operations

【JetCache】JetCache的使用方法与步骤

转--拿来即用:分享一个检查内存泄漏的小工具

转--深入LUA脚本语言,让你彻底明白调试原理

SAP ui5 application development tutorial 104 - multi select support for SAP ui5 table controls and how to use code to select multiple table row items at a time

MySQL MHA high availability configuration and failover

The median salary of TSMC's global employees is about 460000, and the CEO is about 8.99 million; Apple raised the price of iPhone in Japan; VIM 9.0 release | geek headlines

map容器
随机推荐
Yolov5.5 call local camera
【无标题】
SAP 智能机器人流程自动化(iRPA)解决方案分享
使用 Three.js 实现'雪糕'地球,让地球也凉爽一夏
Explain kubernetes network model in detail
Kubernetes create service access pod
Sogou wechat app reverse (II) so layer
Appium自动化测试基础 — APPium安装(一)
【c语言】malloc函数详解[通俗易懂]
数字货币:影响深远的创新
Hide the creation and use of users
Ffmpeg learning notes
Wechat open platform scanning code login [easy to understand]
Use three JS realize the 'ice cream' earth, and let the earth cool for a summer
pytorch训练自己网络后可视化特征图谱的代码
LC669. 修剪二叉搜索树
Cloud Vulnerability Global Database
Delete AWS bound credit card account
MySQL中对于事务的理解
下班前几分钟,我弄清了v-model与.sync的区别