<template>
    <div :class="`${prefix}-date-picker__quick`">
        <p v-for="item in quickOptions"
           :key="item.title"
           :class="`${prefix}-date-picker__quick-item`"
           @click="handleQuick(item)">{{item.title}}</p>
    </div>
</template>

<script>
import pickerMixins from './mixins';
import { prefix, prefixMixins } from 'jdd-design/utils';
export default {
    name: `${prefix}-date-picker-quick-bar`,
    mixins: [prefixMixins, pickerMixins],
    props: {
        quickOptions: Array
    },
    methods: {
        handleQuick(item) {
            let time = item.getter.apply(this);
            time = time.map(m => {
                return this.fixTime(m);
            });
            this.$emit('quick', time);
        }
    }
};
</script>
