forked from mengyxu/noob-components
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
656 B
28 lines
656 B
<template> |
|
<slot v-if="slot" :display="display" /> |
|
<template v-else>{{ display }}</template> |
|
</template> |
|
<script setup lang="ts"> |
|
import { |
|
useTimestampDisplay, |
|
type TimestampDisplayConfig, |
|
type TimestampDisplayType, |
|
} from "../../../plugs/composables"; |
|
|
|
interface Props extends TimestampDisplayConfig { |
|
value: string | number; |
|
type?: TimestampDisplayType; |
|
slot?: boolean; |
|
} |
|
|
|
const props = defineProps<Props>(); |
|
|
|
const { display } = useTimestampDisplay(() => ({ |
|
value: props.value, |
|
valueFormat: props.valueFormat, |
|
valueTz: props.valueTz, |
|
displayFormat: props.displayFormat, |
|
locale: props.locale, |
|
type: props.type, |
|
})); |
|
</script>
|
|
|