This commit is contained in:
梁灏 2017-05-11 17:38:05 +08:00
parent 4e23e47c94
commit b9a4026ff7
2 changed files with 3 additions and 23 deletions

View file

@ -1,34 +1,14 @@
<template> <template>
<div> <Date-picker type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker>
{{ val1 }}
<Date-picker type="datetime" placeholder="选择日期和时间" style="width: 200px"></Date-picker>
<Date-picker v-model="val1" type="date" placeholder="选择日期" style="width: 200px"></Date-picker>
<Date-picker type="daterange" placement="bottom-end" placeholder="选择日期" style="width: 200px"></Date-picker>
<div @click="val1 = '2017-03-02'">change</div>
</div>
</template> </template>
<script> <script>
export default { export default {
data () {
return {
val1: ''
}
},
computed: {
ddd () {
const date = new Date(this.val1);
const year = date.getFullYear();
const month = date.getMonth() + 1;
const day = date.getDate();
return `${year}-${month}-${day}`;
}
}
} }
</script> </script>
<!--<template>--> <!--<template>-->
<!--<row>--> <!--<row>-->
<!--<i-col span="12">--> <!--<i-col span="12">-->

View file

@ -324,7 +324,7 @@
if (this[`${direction}CurrentView`] === 'year') { if (this[`${direction}CurrentView`] === 'year') {
this.$refs[`${direction}YearTable`].nextTenYear(); this.$refs[`${direction}YearTable`].nextTenYear();
} else if (this[`${direction}CurrentView`] === 'month') { } else if (this[`${direction}CurrentView`] === 'month') {
this[`${direction}TableYear`]--; this[`${direction}TableYear`]++;
} else { } else {
const date = this.date; const date = this.date;
date.setFullYear(date.getFullYear() + 1); date.setFullYear(date.getFullYear() + 1);