|
|
<style>
|
|
|
.datepicker{
|
|
|
padding: 10px;
|
|
|
}
|
|
|
.datepicker.vue-show{
|
|
|
display:block;
|
|
|
}
|
...
|
...
|
@@ -7,13 +10,15 @@ |
|
|
}
|
|
|
.calendar-button{
|
|
|
float:right;
|
|
|
margin: 5px 5px 0;
|
|
|
}
|
|
|
.calendar-time{
|
|
|
text-align:center;
|
|
|
margin: 5px 0;
|
|
|
}
|
|
|
</style>
|
|
|
<template>
|
|
|
<input type="text" @click="showCalendar" v-model="value" placeholder="请输入日期" class="form-control">
|
|
|
<input type="text" @click="showCalendar" v-model="value" placeholder="{{placeholder}}" class="form-control">
|
|
|
<div @click.stop="" @touchstart.stop="" class="datepicker datepicker-dropdown dropdown-menu vue-show" v-show="show" :style="{'left':x+'px','top':y+'px'}" transition="calendar" transition-mode="out-in">
|
|
|
<div class="datepicker-days vue-show-imo">
|
|
|
<table class=" table-condensed">
|
...
|
...
|
@@ -81,6 +86,10 @@ module.exports = { |
|
|
twoWay: true,
|
|
|
default:""
|
|
|
},
|
|
|
placeholder: {
|
|
|
type: String,
|
|
|
default:"请输入日期"
|
|
|
},
|
|
|
x: {
|
|
|
type: Number,
|
|
|
default:0
|
...
|
...
|
@@ -360,7 +369,7 @@ module.exports = { |
|
|
var that=this;
|
|
|
that.show=true;
|
|
|
that.x=e.target.offsetLeft;
|
|
|
that.y=e.target.offsetTop+e.target.offsetHeight+8;
|
|
|
that.y=e.target.offsetTop+e.target.offsetHeight+0;
|
|
|
var bindHide=function(e){
|
|
|
e.stopPropagation();
|
|
|
that.show=false;
|
...
|
...
|
|