import { ref, computed } from 'vue' import { Field as VantField, Popup as VanPopup, Picker as VanPicker } from 'vant' import { useFormInput } from '../../../hooks/form-input' import { formInputProps } from '../../form-input-props' import { nextTime, compareTime } from './utils' export default { props: formInputProps, setup (props, context) { const { emitModelValue, placeholder, width } = useFormInput(props, context) const start = computed(() => { return props.config?.start ?? '08:00' }) const end = computed(() => { return props.config?.end ?? '20:00' }) const step = computed(() => { return props.config?.step ?? '00:30' }) // picker中的列表值 const columns = computed(() => { const result = [] if (start.value && end.value && step.value) { let current = start.value while (!compareTime(current, end.value)) { result.push(current) current = nextTime(current, step.value) } } return result }) const show = ref(false) const openPopup = () => { show.value = true } const confirm = (val) => { emitModelValue(val) show.value = false } const cancel = () => { show.value = false } return () =>
} }