iview/test/routers/date.vue

37 lines
1 KiB
Vue
Raw Normal View History

2016-12-12 20:34:28 +08:00
<template>
2016-12-23 09:12:34 +08:00
<date-picker readonly confirm format="MM/dd/yy" :open="open" :value="value3" @on-change="handleChange" type="date" @on-open-change="c" @on-clear="clear" @on-ok="ok">
2016-12-22 15:08:05 +08:00
<a href="javascript:void(0)" @click="handleClick">
<Icon type="ios-calendar-outline"></Icon>
<template v-if="value3 === ''">选择日期</template>
<template v-else>{{ value3 }}</template>
</a>
</date-picker>
2016-12-12 20:34:28 +08:00
</template>
<script>
export default {
data () {
2016-12-14 23:08:57 +08:00
return {
2016-12-22 15:08:05 +08:00
open: false,
value3: ''
2016-12-14 23:08:57 +08:00
}
2016-12-12 20:34:28 +08:00
},
2016-12-15 20:16:58 +08:00
methods: {
2016-12-22 15:08:05 +08:00
handleClick () {
this.open = !this.open;
2016-12-15 20:16:58 +08:00
},
2016-12-22 15:08:05 +08:00
handleChange (date) {
this.value3 = date;
2016-12-16 14:15:11 +08:00
},
2016-12-22 15:08:05 +08:00
c (s) {
console.log(s)
},
clear (s) {
console.log(s)
},
ok (s) {
console.log(s)
2016-12-15 20:16:58 +08:00
}
}
2016-12-12 20:34:28 +08:00
}
2016-12-22 15:08:05 +08:00
</script>