WIP В процессе создания BaseInputDate

This commit is contained in:
Daria Golova
2023-03-21 18:16:12 +03:00
parent 6f7a74a95c
commit d3dc2c2284
7 changed files with 96 additions and 23 deletions

View File

@@ -10,6 +10,7 @@
.flex.ml-auto
q-btn.mr-9(
color="primary",
outline,
dense,
padding="4px 22px",
@click="openForm"

View File

@@ -0,0 +1,38 @@
<template lang="pug">
base-input.w-full(v-bind="$props", v-model="value")
.flex.items-center
q-icon(name="app:calendar" class="cursor-pointer" size="18px")
q-popup-proxy(cover transition-show="scale" transition-hide="scale")
q-date(v-model="value")
div(class="row items-center justify-end")
q-btn(v-close-popup label="Close" color="primary" flat)
</template>
<script>
import BaseInput from "@/components/base/BaseInput.vue";
import * as moment from "moment/moment";
export default {
name: "BaseInputDate",
components: { BaseInput },
props: {
modelValue: {
type: Date,
default: () => new Date(),
},
},
emits: ["update:modelValue"],
computed: {
value: {
get() {
return moment(this.modelValue).format("D MMMM YYYY");
},
set(value) {
this.$emit("update:modelValue", value ? new Date(value) : null);
},
},
},
};
</script>
<style lang="sass" scoped></style>