WIP Настроила inputDate на редактировании клиента
This commit is contained in:
40
src/pages/clients/components/cells/TableCellBodyBirthday.vue
Normal file
40
src/pages/clients/components/cells/TableCellBodyBirthday.vue
Normal 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>
|
||||
Reference in New Issue
Block a user