2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-10 21:12:26 +03:00
This commit is contained in:
mxie
2017-11-29 21:34:50 +08:00
parent 44479c3b6e
commit 47a33f17d7
3 changed files with 19 additions and 19 deletions
+10 -10
View File
@@ -1,15 +1,15 @@
<template>
<div class="calendar">
<div class="calendar-header">
<a v-if="currentPanel === 'time'" @click="currentPanel = 'date'">{{now.toLocaleDateString()}}</a>
<template v-else>
<a class="calendar__prev-icon" @click="changeYear(-1)">&laquo;</a>
<a v-show="currentPanel === 'date'" class="calendar__prev-icon" @click="changeMonth(-1)">&lsaquo;</a>
<a class="calendar__next-icon" @click="changeYear(1)">&raquo;</a>
<a v-show="currentPanel === 'date'" class="calendar__next-icon" @click="changeMonth(1)">&rsaquo;</a>
<a @click="showMonths">{{months[currentMonth]}}</a>
<a @click="showYears">{{currentYear}}</a>
</template>
<div class="calendar-header" v-if="currentPanel === 'time'">
<a @click="currentPanel = 'date'">{{now.toLocaleDateString()}}</a>
</div>
<div class="calendar-header" v-else>
<a class="calendar__prev-icon" @click="changeYear(-1)">&laquo;</a>
<a v-show="currentPanel === 'date'" class="calendar__prev-icon" @click="changeMonth(-1)">&lsaquo;</a>
<a class="calendar__next-icon" @click="changeYear(1)">&raquo;</a>
<a v-show="currentPanel === 'date'" class="calendar__next-icon" @click="changeMonth(1)">&rsaquo;</a>
<a @click="showMonths">{{months[currentMonth]}}</a>
<a @click="showYears">{{currentYear}}</a>
</div>
<div class="calendar-content">
<table class="calendar-table" v-show="currentPanel === 'date'">
+8 -8
View File
@@ -19,13 +19,13 @@
:style="position"
ref="calendar"
v-show="showPopup">
<template v-if="!range">
<calendar-panel
v-model="currentValue"
@select="selectDate"
:show="showPopup"></calendar-panel>
</template>
<template v-else>
<calendar-panel
v-if="!range"
v-model="currentValue"
@select="selectDate"
:show="showPopup"></calendar-panel>
<div v-else style="overflow:hidden" >
<div class="datepicker-top" v-if="ranges.length">
<span v-for="range in ranges" @click="selectRange(range)">{{range.text}}</span>
</div>
@@ -39,7 +39,7 @@
:start-at="currentValue[0]"
@select="selectDate"
:show="showPopup"></calendar-panel>
</template>
</div>
<div class="datepicker-footer" v-if="confirm">
<button type="button" class="datepicker-btn datepicker-btn-confirm" @click="confirmDate"> {{ confirmText }}</button>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "vue2-datepicker",
"description": "A Datepicker Component For Vue2",
"main": "datepicker/index.vue",
"version": "1.6.2",
"version": "1.6.3",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"