<template>
   <uni-datetime-picker
		ref="calendarRef"
		v-model="innerValue"
		:type="type"
		@change="confirm"
		:hide-second="hideSecond"
   >
	<text></text>
   </uni-datetime-picker>
</template>

<script>

export default {
	props: {
		value: {
			type: String | Number | Array,
			default: function() {
				return null
			}
		},
		
		//展示格式
		type: {
			type: String,
			default: 'datetimerange'
		},
		hideSecond: {
			type: Boolean,
			default: true
		},
		
	},
	
	watch: {
		value: {
			handler(newVal) {
				this.innerValue = newVal
			}
		},
		innerValue: {
			handler(newVal) {
				this.$emit('input', newVal)
			}
		},
	},
	computed: {
	
	},
    data() {
        return {
		   innerValue: null,
        }
    },
	onReady() {
		
	},
	
    methods: {
		
		show() {
			this.$refs.calendarRef.show()
		},
		
		reset() {
			this.innerValue = null;
		},
		
		confirm(e) {
			this.$emit('confirm',e)
		},
		
	 
    }
}
</script>

<style lang="scss" scoped>
	
</style>
