mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
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:
@@ -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 |
|
||||
|
||||
@@ -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(() => (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<el-select
|
||||
ref="select"
|
||||
:name="name"
|
||||
:model-value="value"
|
||||
:disabled="_disabled"
|
||||
:clearable="clearable"
|
||||
|
||||
Reference in New Issue
Block a user