<input class="baixin-quan-info-box-time" type="text" onfocus="(this.type='date')" placeholder='起始时间' v-model="tnianxian1">

先使其 type 为 text,此时支持 placeholder,当触摸或者聚焦的时候,使用 JS 切换使其触发 datepicker 功能。以上方法在ios系统会出现重复点击2次才能出时间选择器,改进方法如下:

<input :class="'l-d-box-alone-ipt'+(yy_time?' full':'')" v-model="yy_time" onfocus="(this.type='date')" placeholder="select a date" type="date">

css:
input[type="date"].full:before {
color: black;
content: ""!important;
} input[type="date"] {
direction: ltr;
}
input[type="date"]:before {
color: #A9A9A9;
content: attr(placeholder);
}
js:
$("input[type='date']").on("input", function() {
console.log($(this).val().length)
if ($(this).val().length > 0) {
$(this).addClass("full");
} else {
$(this).removeClass("full");
}
});

最新文章

  1. 前端工程师的PS默认工作区
  2. 调用天气预报webservice
  3. ListBox1控件
  4. PostgreSQL Replication之第十章 配置Slony(5)
  5. 《javascript高级程序设计》第四章 Variables,scope,and memory
  6. JSTL的全称:JSP Standard Tag Library, jsp 标准标签库
  7. mysql loop if
  8. HDOJ(HDU) 2113 Secret Number(遍历数字位数的每个数字)
  9. python-打印简单公司员工信息表
  10. TopCoder中插件的用法
  11. oracle_base和oracle_home 的区别
  12. 全文搜索 Contains 与like 的区别
  13. UVA - 10048 Audiophobia Floyd
  14. SQL游标使用及实例
  15. C#代码总结04---通过创建临时表DataTable进行临时编辑删除
  16. 微信跳转之WAP跳转微信公众号关注页面链接weixin://dl/business/?ticket=
  17. Python练手例子(15)
  18. md5之守株待兔
  19. mysql每组前N条
  20. LeetCode题解之Second Minimum Node In a Binary Tree

热门文章

  1. U-boot新手入门,烧写进mini2440
  2. Linux VPS 常用重启命令
  3. VMware Tools按钮变灰色,无法安装的解决方法
  4. java 学习笔记(五) Zookeeper的集群配置和Java测试程序
  5. HDU - 4431 Mahjong (模拟+搜索+哈希+中途相遇)
  6. poj1740 A New Stone Game[博弈]
  7. 关于css阴影和浮动
  8. Iview 在Table组件中添加图片
  9. IPC 进程间通信方式——管道
  10. 初识容器和Docker