feat(components): [time-select] add name prop (#23633)

* fix(components): [time-select] duplicate end time with format

* docs: add name version

* test: add test case
This commit is contained in:
snowbitx
2026-02-09 09:23:21 +08:00
committed by GitHub
parent 0c8b492dab
commit d359c5f4a3
3 changed files with 8 additions and 1 deletions

View File

@@ -60,7 +60,7 @@ time-select/time-range
| include-end-time ^(2.9.3) | whether `end` is included in options | ^[boolean] | false |
| size | size of Input | ^[enum]`'large' \| 'default' \| 'small'` | default |
| placeholder | placeholder in non-range mode | ^[string] | — |
| name | same as `name` in native input | ^[string] | — |
| name ^(2.13.3) | same as `name` in native input | ^[string] | — |
| effect | Tooltip theme, built-in theme: `dark` / `light` | ^[string] / ^[enum]`'dark' \| 'light'` | light |
| prefix-icon | custom prefix icon component | ^[string] / ^[Component] | Clock |
| clear-icon | custom clear icon component | ^[string] / ^[Component] | CircleClose |

View File

@@ -243,6 +243,12 @@ describe('TimeSelect', () => {
expect(option?.textContent).toBe('01:00 PM')
})
it('should pass name to inner input', () => {
const wrapper = mount(() => <TimeSelect name="timeSelectName" />)
const input = wrapper.find('input')
expect(input.attributes('name')).toBe('timeSelectName')
})
describe('form item accessibility integration', () => {
it('automatic id attachment', async () => {
const wrapper = mount(() => (

View File

@@ -1,6 +1,7 @@
<template>
<el-select
ref="select"
:name="name"
:model-value="value"
:disabled="_disabled"
:clearable="clearable"