遇到的問題:
laydate時間組件在火狐瀏覽器下有多時間輸入框時只能給第一個輸入框賦值的問題(safari下也有同樣問題);
解決方法:
給laydate綁定id;
解前代碼:
<span style="color: #008080;">1</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="startTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入开始时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">2</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span> <span style="color: #008080;">3</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">4</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">5</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="endTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入结束时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">6</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span>
解決後代碼:
<span style="color: #008080;">1</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="startTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入开始时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">2</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({elem: '#startTime', istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span> <span style="color: #008080;">3</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">4</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">br</span><span style="color: #0000ff;">></span> <span style="color: #008080;">5</span> <span style="color: #0000ff;"><</span><span style="color: #800000;">input </span><span style="color: #ff0000;">id</span><span style="color: #0000ff;">="endTime"</span><span style="color: #ff0000;"> placeholder</span><span style="color: #0000ff;">="请输入结束时间"</span><span style="color: #ff0000;"> class</span><span style="color: #0000ff;">="laydate-icon"</span> <span style="color: #008080;">6</span> <span style="color: #ff0000;"> onClick</span><span style="color: #0000ff;">="laydate({elem: '#endTime', istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"</span><span style="color: #0000ff;">></span>
如上,在第2,6行增加id綁定, 問題解決;
<span style="font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5;"> </span>