1. 程式人生 > >vue中時間控件綁定多個輸入框

vue中時間控件綁定多個輸入框

vue inpu cli base pre format static click value

首先去下載laydate時間控件,引入到相應的模板中


<input type="text" val-required="" value="" date-laydate="" id="estab_dateA" class="initial_date laydate-icon" @click="dateBlock(‘#estab_dateA‘)"> <input type="text" val-required="" value="" date-laydate="" id="estab_dateB" class="initial_date laydate-icon" @click
="dateBlock(‘#estab_dateB‘)"> <script>
     import ‘./../../scripts/base/laydate.js‘;
//綁定時間控件 dateBlock(str){ let $scope = this; laydate({ elem:str,//綁定的元素 type:date, format:
YYYYMMDD,//時間格式20171219 position: static,//位置 istoday: true, //是否顯示今天 done: (value) => { $scope.estabTime = value } }); }, </script>

<style>
  @import "./../../styles/need/laydate.css";
</style>

vue中時間控件綁定多個輸入框