当前位置:网站首页>Adaptive length input box
Adaptive length input box
2022-07-22 14:30:00 【yibucuo】
to span Label settings contenteditable by true, You can edit it
<span
class="mn-input"
v-html="ipt17"
@blur="blurf($event, 'ipt17', 64)"
contenteditable = true
>
</span>
// watch Monitor data changes
watch:{
ipt17(newone, oldone) {
this.cIpt2("ipt17", newone, oldone);
},
}
methods:{
chkstrlen2(str, max) {
var strlen = 0;
for (var i = 0; i < str.length; i++) {
if (!/[a-z|A-Z|0-9]/.test(str[i])) strlen += 2;
else strlen++;
if (strlen > max) {
return str.slice(0, i);
}
}
},
blurf(e, key, max) {
this.chkstrlen2(e.target.innerText, max);
this[key] = e.target.innerText;
if (this[key] == "") {
this[key] = " ";
}
},
}
.mn-input {
padding: 0 22px;
outline: none;
border-bottom: 1px solid #000;
font-weight: 640;
font-size: 18px;
word-break: break-all;
}
边栏推荐
- 5. ZABBIX create a custom key
- Tas (file d'attente prioritaire)
- 08. Use of octave language - control statements, drawing lines and other commands
- OA project introduction & Conference release
- 2. ZABBIX concept
- Scheduling context of Kube scheduler
- Test cases of common functions
- 每日刷题记录 (三十)
- What is the Zen of software testing? How to use it?
- 年薪30W,软件测试人的成长之路,你在哪个阶段?
猜你喜欢
【多线程】实现线程到底只有一种方式还是四种方式
Conception d'un système de consommation de supermarchés sans pilote basé sur stm32
Which Hong Kong cloud server or physical server is more prone to downtime?
51单片机外设篇:按键
Cache and redirection in HTTP practice
Special analysis of China's third-party payment market in 2022
Mysql索引分類及其使用實例
Redis data structure analysis (I)
微服务架构 | 服务注册发现中心/配置中心/消息总线 - [nacos] TBC...
51 MCU peripherals: LED dot matrix
随机推荐
rexroth力士乐柱塞泵A15VSO
微服务架构 | 服务注册发现中心/配置中心/消息总线 - [nacos] TBC...
Controllable text generation series-a survey of controllable text generation using transformer based pre trained
【大型电商项目开发】线程池-异步(CompletableFuture)-48
08. Use of octave language - control statements, drawing lines and other commands
Chapter 3 processing data
微信打开时支持消息通知横幅引热议;Google和甲骨文的云服务因英国高温天气而下线;谷歌发布开源开发语言Carbon|极客头条
丘成桐大学生数学竞赛数学物理
Seven schemes of Web real-time message push
字节跳动测试岗,前面都过了,最后一面HR天坑...跟我说这话
[shutter component] expanded detailed explanation
5. ZABBIX create a custom key
The way of practice: what is a callback function (after listening to a callback function for so long, what is a callback function in the end)
【多线程】并行和并发的区别
ByteDance test post, the front has passed, and the last HR sinkhole Tell me that
51单片机外设篇:按键
Ardunio开发——水泵操作过程
Find the prime number within 100, find the divisor, and find the maximum common divisor of the two numbers
kube-scheduler的调度上下文
Web自动化-——selenium