WIP Настроила inputDate на редактировании клиента

This commit is contained in:
Daria Golova
2022-12-28 14:17:54 +03:00
parent 7a1bfd45c4
commit 5ae3373e3d
3 changed files with 36 additions and 16 deletions

View File

@@ -0,0 +1,40 @@
<template lang="pug">
.flex.box-border.px-4.items-center.w-full.text-sm(
:style="{ minWidth : width + 'px', maxWidth : width + 'px' }"
)
span(v-if="!isOpenChange") {{ birthday }}
base-input-date.input.h-10(
v-if="isOpenChange",
@click.stop,
v-model="value.age"
)
</template>
<script>
import BaseInputDate from "@/components/base/BaseInputDate";
import * as moment from "moment/moment";
export default {
name: "TableCellBodyBirthday",
components: { BaseInputDate },
props: {
value: Object,
width: Number,
isOpenChange: Boolean,
},
computed: {
birthday() {
return this.value.age
? moment(this.value.age)
.format("YYYY-MM-DD")
.split("-")
.reverse()
.join(".")
: "";
},
},
};
</script>
<style lang="sass" scoped>
.input
background-color: var(--default-white)
</style>