基于vue3.0和element-plus的组件库
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.
|
|
|
|
<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>
|