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没法调试 ...
随机推荐
- 微信小程序开发中的http请求总结
在微信小程序进行网络通信,只能和指定的域名进行通信,微信小程序包括四种类型的网络请求. 普通HTTPS请求(wx.request) 上传文件(wx.uploadFile) 下载文件(wx.downlo ...
- 保姆级教程!手把手教你使用Longhorn管理云原生分布式SQL数据库!
作者简介 Jimmy Guerrero,在开发者关系团队和开源社区拥有20多年的经验.他目前领导YugabyteDB的社区和市场团队. 本文来自Rancher Labs Longhorn是Kubern ...
- Journal of Proteome Research | Single-Shot Capillary Zone Electrophoresis−Tandem Mass Spectrometry Produces over 4400 Phosphopeptide Identifications from a 220 ng Sample (分享人:赵伟宁)
Title: Single-Shot Capillary Zone Electrophoresis−Tandem Mass Spectrometry Produces over 4400 Phosph ...
- [剑指offer]25.合并两个排序的链表(迭代+递归)
25.合并两个排序的链表 题目 输入两个递增排序的链表,合并这两个链表并使新链表中的节点仍然是递增排序的. 示例1: 输入:1->2->4, 1->3->4 输出:1-> ...
- 《前端之路》- TypeScript (四) class 中各类属性、方法,抽象类、多态
目录 一.TypeScript 中的类 二.TypeScript 中类的继承 三.TypeScript 中公共,私有与受保护的修饰符 3-1.属性的 public 3-2.属性的 private 3- ...
- [bash]http serevr部署wordpress
#!/bin/bash # echo "close selinux…" sed -i 's/Enforcing/disabled/' /etc/sysconfig/selinux ...
- 第十七周Java实验作业
实验十七 线程同步控制 实验时间 2018-12-10 1.实验目的与要求 (1) 掌握线程同步的概念及实现技术: 多线程并发运行不确定性问题解决方案:引入线程同步机制,使得另一线程使用该方法,就只 ...
- VirtualBox 版本 6.1.2 r135662, ubuntu18 配置共享文件夹、openssh-server
续上章安装完ubuntu18. 输入账号密码,登录成功. 但是使用ssh工具,却登录失败. 1.安装openssh-server sudo apt install openssh-server 2.检 ...
- 收藏 | 15 个你非了解不可的 Linux 特殊字符,妈妈再也不用担心我看不懂这些符号了!
不知道大家接触 Linux 系统有多久了,可曾了解过 Linux 中有哪些特殊的字符呢?其实啊,那些特殊字符都大有用处呢,今天的文章就给大家简单地科普一下 Linux 中你需要了解的 15 个特殊字符 ...
- jupyter notebook 中同时添加Python2和3,在conda下配置R语言运行的环境
1.第一步,安装Python2的环境 首先,在安装anaconda的时候先选择一个Python安装,我先安装的是Python3 然后,在anaconda Prompt下创建Python2环境 现在,还 ...