mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
Time field added
This commit is contained in:
parent
77964cae23
commit
58dc8bb94d
@ -22,6 +22,7 @@ import Password from './Password';
|
||||
import Select from './Select';
|
||||
import Table from './Table';
|
||||
import Text from './Text';
|
||||
import Time from './Time'
|
||||
|
||||
export default {
|
||||
props: ['docfield', 'value', 'onlyInput'],
|
||||
@ -43,6 +44,7 @@ export default {
|
||||
Select,
|
||||
Table,
|
||||
Text,
|
||||
Time,
|
||||
}[this.docfield.fieldtype];
|
||||
}
|
||||
}
|
||||
|
46
ui/components/controls/Time.vue
Normal file
46
ui/components/controls/Time.vue
Normal file
@ -0,0 +1,46 @@
|
||||
<template>
|
||||
<div class="form-group" v-if="!onlyInput">
|
||||
<label>{{ docfield.label }}</label>
|
||||
<flat-pickr
|
||||
:value="value"
|
||||
:config="config"
|
||||
class="form-control"
|
||||
@on-change="emitChange"
|
||||
>
|
||||
</flat-pickr>
|
||||
</div>
|
||||
<flat-pickr
|
||||
v-else
|
||||
:value="value"
|
||||
:config="config"
|
||||
class="form-control"
|
||||
@on-change="emitChange"
|
||||
>
|
||||
</flat-pickr>
|
||||
</template>
|
||||
<script>
|
||||
import flatPickr from 'vue-flatpickr-component';
|
||||
import Data from './Data';
|
||||
export default {
|
||||
extends: Data,
|
||||
data(){
|
||||
return{
|
||||
config:{
|
||||
enableTime: true,
|
||||
noCalendar: true
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
flatPickr
|
||||
},
|
||||
methods: {
|
||||
emitChange(times, timeString) {
|
||||
this.$emit('change', timeString);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "flatpickr/dist/flatpickr.css";
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user