...
|
...
|
@@ -17,7 +17,7 @@ |
|
|
</thead>
|
|
|
<tbody>
|
|
|
<tr v-for="week in calendar">
|
|
|
<td :class="{today: day.date.toDateString() === new Date().toDateString(), selected: day.day === this.currentDay, not: ! day.day || day.day === 32}" v-for="day in week" track-by="$index" v-text="day.day === 32 ? '' : day.day" @click="selectDate(day)"></td>
|
|
|
<td :class="{today: day.date.toDateString() === new Date().toDateString(), selected: day.day === this.currentDay, old: isnot(day,$index)}" v-for="day in week" track-by="$index" v-text="day.day === 32 ? '' : day.day" @click="selectDate(day,$index)"></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
...
|
...
|
@@ -25,7 +25,7 @@ |
|
|
</template>
|
|
|
<script>
|
|
|
export default {
|
|
|
props:["dateTime","mo"],
|
|
|
props:["dateTime","mo","state"],
|
|
|
data(){
|
|
|
return {
|
|
|
// date: new Date(this.dateText),
|
...
|
...
|
@@ -35,6 +35,7 @@ |
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
|
|
|
month() {
|
|
|
return this.months[this.dateTime.month]
|
|
|
},
|
...
|
...
|
@@ -95,8 +96,8 @@ |
|
|
this.currentDay = ""
|
|
|
this.dateTime.month+=1
|
|
|
},
|
|
|
selectDate(value) {
|
|
|
if (! value.day || value.day === 32) {
|
|
|
selectDate(value,index) {
|
|
|
if(this.isnot(value,index)){
|
|
|
return
|
|
|
}
|
|
|
this.dateTime.date=value.day
|
...
|
...
|
@@ -104,6 +105,13 @@ |
|
|
},
|
|
|
tomonth(){
|
|
|
this.mo="month"
|
|
|
},
|
|
|
isnot(day,index){
|
|
|
console.log(this.state);
|
|
|
if(this.state=="week"){
|
|
|
return ! day.day || day.day === 32||index!==0;
|
|
|
}
|
|
|
return ! day.day || day.day === 32;
|
|
|
}
|
|
|
},
|
|
|
ready() {
|
...
|
...
|
|