2018-07-04 16:52:18 +00:00
|
|
|
<template>
|
2018-07-12 15:47:59 +00:00
|
|
|
<div :class="{ 'form-group': !onlyInput }">
|
|
|
|
<label v-if="!onlyInput">{{ docfield.label }}</label>
|
2018-07-04 16:52:18 +00:00
|
|
|
<flat-pickr
|
|
|
|
:value="value"
|
|
|
|
:config="config"
|
|
|
|
class="form-control"
|
|
|
|
@on-change="emitChange"
|
|
|
|
>
|
|
|
|
</flat-pickr>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import flatPickr from 'vue-flatpickr-component';
|
|
|
|
import Data from './Data';
|
2018-07-12 15:47:59 +00:00
|
|
|
|
2018-07-04 16:52:18 +00:00
|
|
|
export default {
|
|
|
|
extends: Data,
|
2018-07-12 15:47:59 +00:00
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
config: {
|
2018-07-04 16:52:18 +00:00
|
|
|
enableTime: true,
|
|
|
|
noCalendar: true
|
|
|
|
}
|
2018-07-12 15:47:59 +00:00
|
|
|
};
|
2018-07-04 16:52:18 +00:00
|
|
|
},
|
|
|
|
components: {
|
|
|
|
flatPickr
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
emitChange(times, timeString) {
|
|
|
|
this.$emit('change', timeString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
|
|
@import "flatpickr/dist/flatpickr.css";
|
2018-07-12 15:47:59 +00:00
|
|
|
</style>
|