input相关
input相关
在ios中输入英文首字母默认大写取消方法
<input autocapitalize="off" autocorrect="off" />
//也可以在form元素上设置
<input type="password" >//始终不会开启自动首字母大写。
浏览器表单自动填充
<input type="text" autocomplete="off" name="userName"/>
<input type="password" autocomplete="new-password" name="password"/>
//普通文本框添加 autocomplete="off",密码输入框添加 autocomplete="new-password"。
//同样也可以在form元素上设置
autocapitalize="words"时,每个单词的开头字母会自动大写。
autocapitalize="characters" 时,每个字母都会大写。
autocapitalize="sentences" 时,每句开头字母会自动大写。
placeholder,提示信息。
可通过input::placeholder设置样式
之前还遇到的,在vue中input显示隐藏聚焦的问题:
1.通过directive自定义组件的方式
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="app">
<input type="text" v-focus v-if='bol'>
<button @click='bol = !bol'>
切换Input框显示和隐藏
</button>
</div>
<script src="./lib/vue.js"></script>
<script>
Vue.directive('focus', {
// 插入到dom的时候执行的钩子函数
// 进行JS中的有关操作
inserted(el) {
el.focus()
}
})
var vm = new Vue({
el: '#app',
data() {
return {
bol: false
}
},
methods: {}
})
</script>
</body>
</html>
2.通过ref直接操作dom元素
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="app">
<input type="text" ref='inputFocus' v-if='bol'>
<button @click='show'>
切换Input框显示和隐藏
</button>
</div>
<script src="./lib/vue.js"></script>
<script>
var vm = new Vue({
el: '#app',
data() {
return {
bol: false
}
},
methods: {
show() {
this.bol = !this.bol
// 在dom更新完毕之后立即执行的回调函数执行的操作 页面显示的dom结构是最新的
this.$nextTick(function () {
this.$refs.inputFocus.focus()
})
}
}
})
</script>
</body>
</html>
完。
input相关的更多相关文章
- CSS:与input相关的一些样式设置问题
input是HTML中非常重要,非常常用而又不可替代的元素,在于其相关的样式设置中有时会遇到其他元素不会发生的问题,今天把我印象中的一些小问题和解决方案记录一下. 1.与同行元素上下居中对齐 关于上下 ...
- ionic angularJS input 相关指令 以及定时器 的使用
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" conte ...
- input相关问题总结
1. 禁止为所有被激活的输入框添加边框 *:focus {outline: none} 2. 禁止为被激活的输入框添加边框,说明:".abc"为输入框对象自定义添加的class类命 ...
- PHP输入流 php://input 相关【转】
为什么xml_rpc服务端读取数据都是通过file_get_contents(‘php://input', ‘r').而不是从$_POST中读取,正是因为xml_rpc数据规格是xml,它的Conte ...
- 16.和input相关的知识点
1.改变input里面placeholder颜色 <input class="pre_name" type="text" placeholder=&quo ...
- js input相关事件(转载)
1.onfocus 当input 获取到焦点时触发. 2.onblur 当input失去焦点时触发,注意:这个事件触发的前提是已经获取了焦点再失去焦点的时候才会触发该事件,用于判断标签为空.3.o ...
- input 相关
1.label 标签 for 属性同 input 标签 id 属性联系之一
- input的type=file触发的相关事件
与input相关的事件运行的过程.添加了一些相关的方法测试了一下.input的type=file的运行流程. 我们书写了mousedown,mouseup,click,input,change,foc ...
- android adb shell input各种妙用
项目中使用一个开发版,预留两个usb接口.类似华硕TinkerBoard. 一个用户连接摄像头,一个用于adb调试.结果就没了鼠标的接口.多次切换鼠标和摄像头插头,非常不方便,带摄像头的app没法调试 ...
随机推荐
- 三万字、91道MySQL面试题。 附PDF
文末领取面试题 高清PDF 数据库基础知识 1. 为什么要使用数据库 数据保存在内存 优点:存取速度快 缺点:数据不能永久保存 数据保存在文件 优点:数据永久保存 缺点:1)速度比内存操作慢,频繁的I ...
- 当程序执行一条查询语句时,MySQL内部到底发生了什么? (说一下 MySQL 执行一条查询语句的内部执行过程?
先来个最基本的总结阐述,希望各位小伙伴认真的读一下,哈哈: 1)客户端(运行程序)先通过连接器连接到MySql服务器. 2)连接器通过数据库权限身份验证后,会先查询数据库缓存是否存在(之前执行过相同条 ...
- 渗透神器cobalt strike在数字杀软环境下的使用
当我们拿到cobalt strike的beacon权限时,使用它如何渗透目标内网.因为我看网上的文章都是在无杀软下写的,这难免有点脱离实战环境,本文主要测试CS的beacon在数字杀软环境下进行常规渗 ...
- 微信开发+百度AI学习:植物识别
直接上代码 服务端代码如下 private static readonly Baidu.Aip.ImageClassify.ImageClassify client = new Baidu.Aip.I ...
- POJ 1182食物链(分集合以及加权两种解法) 种类并查集的经典
题目链接:http://icpc.njust.edu.cn/Problem/Pku/1182/ 题意:给出动物之间的关系,有几种询问方式,问是真话还是假话. 定义三种偏移关系: x->y 偏移量 ...
- [贪心]Codeforces Equal Rectangles
Equal Rectangles time limit per test 2 seconds memory limit per test 256 megabytes input standard in ...
- 自定义上下文菜单,contextmenu事件
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 分享一个超级好用的SM图床
分享一个超级好用的SM图床 大家都知道我是一个喜欢sm Markdown的人,但是Markdown有个很不方便的地方,就是图片的插入,一般用Markdown编辑器(我用的是Typora)直接插入图 ...
- OpenCV-Python 霍夫圈变换 | 三十三
学习目标 在本章中, 我们将学习使用霍夫变换来查找图像中的圆. 我们将看到以下函数:cv.HoughCircles() 理论 圆在数学上表示为(x−xcenter)2(y−ycenter)2=r2(x ...
- HTTP下午茶 - 小白入门书
这本书十分精炼,非常适合零基础的小白. 资源介绍 首先,书籍是免费的! 英文原版书籍,作者是 Launch School,是一家教育网站,可以在线阅读: https://launchschool.co ...