2018-07-14 07:16:40 +00:00
|
|
|
<template>
|
|
|
|
<div :class="{'form-group': !onlyInput}">
|
|
|
|
<label v-if="!onlyInput">{{ docfield.label }}</label>
|
2019-08-14 07:48:04 +00:00
|
|
|
<flat-pickr
|
|
|
|
class="form-control"
|
|
|
|
:class="getFormControlSize()"
|
|
|
|
:placeholder="docfield.placeholder"
|
|
|
|
:value="value"
|
|
|
|
:config="config"
|
|
|
|
@on-change="emitChange"
|
|
|
|
></flat-pickr>
|
2018-07-14 07:16:40 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import flatPickr from 'vue-flatpickr-component';
|
|
|
|
import Data from './Data';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
extends: Data,
|
|
|
|
props: ['config'],
|
|
|
|
components: {
|
|
|
|
flatPickr
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
emitChange(dates, dateString) {
|
|
|
|
this.$emit('change', dateString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss">
|
2019-07-18 10:41:15 +00:00
|
|
|
@import '~flatpickr/dist/flatpickr.css';
|
2019-08-14 07:48:04 +00:00
|
|
|
.flat-pickr-input {
|
|
|
|
background-color: #fff;
|
|
|
|
}
|
2018-07-14 07:16:40 +00:00
|
|
|
</style>
|