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没法调试 ...
随机推荐
- Analysis of endogenous peptides released from osteoarthritic cartilage unravels novel pathogenic markers (解读人:李琼)
文献名:Analysis of endogenous peptides released from osteoarthritic cartilage unravels novel pathogenic ...
- springboot集成axis1.4
1.首先通过axis工具根据wsdl文件生成java代码和wsdd文件 set Axis_Lib=/Users/apple/configuration/axis-1_4/lib //lib文件目录se ...
- wpf xaml CS0426 错误原因
wpf 程序集中 类命名空间名称和类名不能相同,否则在 xaml生成 i.g.cs时,会导致 自动生成代码无法推到处是类型还是命名空间的问题. 触发这个错误的条件是类命名空间 与 类名相同 并 ...
- [SQL]3.26--175+176+177+178+180+181+182
175.组合两个表 题目 Code SELECT FirstName, LastName, City, State FROM Person LEFT JOIN Address --由于需要Person ...
- 关于Web2.0
前言:本来是想写HTML的,发现没什么好写的,就简单写一下Web2.0好了 什么是Web 2.0: "Web 2.0 is the business revolution in the co ...
- [模拟,英语阅读] Codeforces 549D Haar Features
题目:https://codeforces.com/contest/549/problem/D D. Haar Features time limit per test 1 second memory ...
- 北邮oj 97. 二叉排序树
97. 二叉排序树 时间限制 1000 ms 内存限制 65536 KB 题目描述 二叉排序树,也称为二叉查找树.可以是一颗空树,也可以是一颗具有如下特性的非空二叉树: 若左子树非空,则左子树上所有节 ...
- Excel知识点与技巧1
1.工作区:方便两个工作表之间进行对比 2.工作表标签颜色 3.交换两列的次序 4.快速到达边界:即快速到达第一行或最后一行 5.冻结窗格:可以固定某几行或某几列一直存在于窗口,不会随着往下拉或往右拉 ...
- CF 1012C Dp
Welcome to Innopolis city. Throughout the whole year, Innopolis citizens suffer from everlasting cit ...
- 热点 | github近期热点项目汇总
本文是近期Github热点项目的汇总,如果你想了解更多优秀的github项目,请关注我们公众号的github系列文章. 推荐 | 7个你最应该知道的机器学习相关github项目 热点 | 六月Gith ...