2022-12-09 20:01:05 +08:00

38 lines
822 B
Vue

<template>
<TMagicTimePicker
v-model="model[name]"
:value-format="config.valueFormat || 'HH:mm:ss'"
:format="config.format || 'HH:mm:ss'"
:size="size"
:placeholder="config.placeholder"
:disabled="disabled"
@change="changeHandler"
></TMagicTimePicker>
</template>
<script lang="ts" setup name="MFormTime">
import { TMagicTimePicker } from '@tmagic/design';
import { TimeConfig } from '../schema';
import { useAddField } from '../utils/useAddField';
const props = defineProps<{
config: TimeConfig;
model: any;
initValues?: any;
values?: any;
name: string;
prop: string;
disabled?: boolean;
size?: 'large' | 'default' | 'small';
}>();
const emit = defineEmits(['change']);
useAddField(props.prop);
const changeHandler = (v: string) => {
emit('change', v);
};
</script>