iview/test/routers/date.vue

42 lines
1.4 KiB
Vue
Raw Normal View History

2016-12-12 20:34:28 +08:00
<template>
<div style="margin: 50px">
2016-12-15 20:16:58 +08:00
<br>
<row>
<i-col span="4">
<date-picker style="width:200px" placeholder="请选择日期" :value.sync="value" :options="options" @on-change="change" @on-open-change="change2" :format="format"></date-picker>
</i-col>
<i-col span="4">
<date-picker type="year" style="width:200px" placeholder="请选择日期" :value.sync="value" :options="options"></date-picker>
</i-col>
<i-col span="4">
<date-picker type="month" style="width:200px" placeholder="请选择日期" :value.sync="value" :options="options"></date-picker>
</i-col>
</row>
2016-12-12 20:34:28 +08:00
</div>
</template>
<script>
export default {
data () {
2016-12-14 23:08:57 +08:00
return {
2016-12-15 20:16:58 +08:00
value: new Date(),
2016-12-14 23:08:57 +08:00
// value: '',
options: {
disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7;
// return time && time.valueOf() < Date.now();
}
2016-12-15 20:16:58 +08:00
},
format: 'yyyy/MM/dd'
2016-12-14 23:08:57 +08:00
}
2016-12-12 20:34:28 +08:00
},
computed: {},
2016-12-15 20:16:58 +08:00
methods: {
change (date) {
// console.log(date)
},
change2 (s) {
// console.log(s)
}
}
2016-12-12 20:34:28 +08:00
}
</script>