Files
workspace/code/g3soft-libs/docs/examples/date/manual-input.vue
T
2026-10-08 22:38:34 +08:00

20 lines
838 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
// 手输容错:非法输入不会污染绑定值(红框 1.5 秒后回填已提交值)
// 光标停在年/月/日/时/分段上按 ↑↓ 可以微调该段
import { ref } from 'vue'
import { G3DatePicker, G3Space } from '@g3soft/ui'
const date = ref('2026-10-08 09:30')
</script>
<template>
<G3Space direction="vertical" :size="12" style="display: flex; width: 300px">
<G3DatePicker v-model="date" format="YYYY-MM-DD HH:mm" placeholder="试试手输 2026-13-45 看效果" />
<p style="margin: 0; font-size: 12px; color: #6b7280; line-height: 1.7">
支持的输入:<code>2026-10-08</code>、<code>2026/10/08</code>、<code>2026年10月8日</code>、
<code>2026-10-08 09:30</code>。部分输入(如只写 <code>2026-10</code>)会被补全。
</p>
</G3Space>
</template>