首先去下载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>