2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-24 05:40:35 +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> <template>
<div class="calendar"> <div class="calendar">
<div class="calendar-header"> <div class="calendar-header" v-if="currentPanel === 'time'">
<a v-if="currentPanel === 'time'" @click="currentPanel = 'date'">{{now.toLocaleDateString()}}</a> <a @click="currentPanel = 'date'">{{now.toLocaleDateString()}}</a>
<template v-else> </div>
<a class="calendar__prev-icon" @click="changeYear(-1)">&laquo;</a> <div class="calendar-header" v-else>
<a v-show="currentPanel === 'date'" class="calendar__prev-icon" @click="changeMonth(-1)">&lsaquo;</a> <a class="calendar__prev-icon" @click="changeYear(-1)">&laquo;</a>
<a class="calendar__next-icon" @click="changeYear(1)">&raquo;</a> <a v-show="currentPanel === 'date'" class="calendar__prev-icon" @click="changeMonth(-1)">&lsaquo;</a>
<a v-show="currentPanel === 'date'" class="calendar__next-icon" @click="changeMonth(1)">&rsaquo;</a> <a class="calendar__next-icon" @click="changeYear(1)">&raquo;</a>
<a @click="showMonths">{{months[currentMonth]}}</a> <a v-show="currentPanel === 'date'" class="calendar__next-icon" @click="changeMonth(1)">&rsaquo;</a>
<a @click="showYears">{{currentYear}}</a> <a @click="showMonths">{{months[currentMonth]}}</a>
</template> <a @click="showYears">{{currentYear}}</a>
</div> </div>
<div class="calendar-content"> <div class="calendar-content">
<table class="calendar-table" v-show="currentPanel === 'date'"> <table class="calendar-table" v-show="currentPanel === 'date'">
+8 -8
View File
@@ -19,13 +19,13 @@
:style="position" :style="position"
ref="calendar" ref="calendar"
v-show="showPopup"> v-show="showPopup">
<template v-if="!range">
<calendar-panel <calendar-panel
v-model="currentValue" v-if="!range"
@select="selectDate" v-model="currentValue"
:show="showPopup"></calendar-panel> @select="selectDate"
</template> :show="showPopup"></calendar-panel>
<template v-else> <div v-else style="overflow:hidden" >
<div class="datepicker-top" v-if="ranges.length"> <div class="datepicker-top" v-if="ranges.length">
<span v-for="range in ranges" @click="selectRange(range)">{{range.text}}</span> <span v-for="range in ranges" @click="selectRange(range)">{{range.text}}</span>
</div> </div>
@@ -39,7 +39,7 @@
:start-at="currentValue[0]" :start-at="currentValue[0]"
@select="selectDate" @select="selectDate"
:show="showPopup"></calendar-panel> :show="showPopup"></calendar-panel>
</template> </div>
<div class="datepicker-footer" v-if="confirm"> <div class="datepicker-footer" v-if="confirm">
<button type="button" class="datepicker-btn datepicker-btn-confirm" @click="confirmDate"> {{ confirmText }}</button> <button type="button" class="datepicker-btn datepicker-btn-confirm" @click="confirmDate"> {{ confirmText }}</button>
</div> </div>
+1 -1
View File
@@ -2,7 +2,7 @@
"name": "vue2-datepicker", "name": "vue2-datepicker",
"description": "A Datepicker Component For Vue2", "description": "A Datepicker Component For Vue2",
"main": "datepicker/index.vue", "main": "datepicker/index.vue",
"version": "1.6.2", "version": "1.6.3",
"scripts": { "scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot", "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules" "build": "cross-env NODE_ENV=production webpack --progress --hide-modules"