mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
38 lines
822 B
Vue
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>
|