mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
Add Date control
This commit is contained in:
parent
966ff39abc
commit
d6989ff2dd
30
src/components/controls/Date.vue
Normal file
30
src/components/controls/Date.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div class="form-group">
|
||||
<label>{{ docfield.label }}</label>
|
||||
<flat-pickr
|
||||
:value="value"
|
||||
class="form-control"
|
||||
@on-change="emitChange"
|
||||
>
|
||||
</flat-pickr>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import flatPickr from 'vue-flatpickr-component';
|
||||
import Data from './Data';
|
||||
|
||||
export default {
|
||||
extends: Data,
|
||||
components: {
|
||||
flatPickr
|
||||
},
|
||||
methods: {
|
||||
emitChange(dates, dateString) {
|
||||
this.$emit('change', dateString);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "flatpickr/dist/flatpickr.css";
|
||||
</style>
|
@ -7,6 +7,7 @@ import Check from './Check';
|
||||
import Code from './Code';
|
||||
import Currency from './Currency';
|
||||
import Data from './Data';
|
||||
import Date from './Date';
|
||||
import Float from './Float';
|
||||
import Link from './Link';
|
||||
import Select from './Select';
|
||||
@ -22,6 +23,7 @@ export default {
|
||||
Code,
|
||||
Currency,
|
||||
Data,
|
||||
Date,
|
||||
Float,
|
||||
Link,
|
||||
Select,
|
||||
|
Loading…
Reference in New Issue
Block a user