<template>
  <view>
    <u-input v-model="value" type="select" :border="true" :disabled="!config.writable" @click="show = true" />
    <!-- <u-select v-model="show" :list="options" @confirm="confirm"></u-select> -->
    <u-calendar v-model="show" mode="date" @change="change"></u-calendar>
  </view>
</template>

<script>
  export default {
    name: 'DATE',
    props: ['config', 'onChange'],
    data() {
      return {
        value: '',
        show: false
      }
    },
    created() {
      this.value = this.config.value || ''
    },
    methods: {
      change(obj) {
        this.value = obj.result
        // this.value = new Date(obj.result).getTime()
      }
    }
  }
</script>

<style></style>
