2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00

Simplify template

This commit is contained in:
Faris Ansari 2018-07-12 21:17:59 +05:30 committed by GitHub
parent d102d14448
commit fff4c07e5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="form-group" v-if="!onlyInput"> <div :class="{ 'form-group': !onlyInput }">
<label>{{ docfield.label }}</label> <label v-if="!onlyInput">{{ docfield.label }}</label>
<flat-pickr <flat-pickr
:value="value" :value="value"
:config="config" :config="config"
@ -9,27 +9,20 @@
> >
</flat-pickr> </flat-pickr>
</div> </div>
<flat-pickr
v-else
:value="value"
:config="config"
class="form-control"
@on-change="emitChange"
>
</flat-pickr>
</template> </template>
<script> <script>
import flatPickr from 'vue-flatpickr-component'; import flatPickr from 'vue-flatpickr-component';
import Data from './Data'; import Data from './Data';
export default { export default {
extends: Data, extends: Data,
data(){ data() {
return{ return {
config:{ config: {
enableTime: true, enableTime: true,
noCalendar: true noCalendar: true
} }
} };
}, },
components: { components: {
flatPickr flatPickr
@ -43,4 +36,4 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "flatpickr/dist/flatpickr.css"; @import "flatpickr/dist/flatpickr.css";
</style> </style>