feat(components): [tree-select] add instance type and improve test cleanup logic (#22499)

* feat(components): [tree-select] add instance

* chore: update

* chore: update test

Co-authored-by: btea <2356281422@qq.com>

* Update packages/components/tree-select/src/instance.ts

Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com>

---------

Co-authored-by: btea <2356281422@qq.com>
Co-authored-by: Noblet Ouways <91417411+Dsaquel@users.noreply.github.com>
This commit is contained in:
sea
2025-11-28 23:34:57 +08:00
committed by GitHub
parent 8d4d0514e7
commit adf4fbfb6b
6 changed files with 107 additions and 59 deletions

View File

@@ -85,33 +85,33 @@ slider/show-marks
### Attributes
| Name | Description | Type | Default |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| model-value / v-model | binding value | ^[number] / ^[object]`number[]` | 0 |
| min | minimum value | ^[number] | 0 |
| max | maximum value | ^[number] | 100 |
| disabled | whether Slider is disabled | ^[boolean] | false |
| step | step size | ^[number] | 1 |
| show-input | whether to display an input box, works when `range` is false | ^[boolean] | false |
| show-input-controls | whether to display control buttons when `show-input` is true | ^[boolean] | true |
| size | size of the slider wrapper, will not work in vertical mode | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | default |
| input-size | size of the input box, when set `size`, the default is the value of `size` | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | default |
| show-stops | whether to display breakpoints | ^[boolean] | false |
| show-tooltip | whether to display tooltip value | ^[boolean] | true |
| format-tooltip | format to display tooltip value | ^[Function]`(value: number) => number \| string` | — |
| range | whether to select a range | ^[boolean] | false |
| vertical | vertical mode | ^[boolean] | false |
| height | slider height, required in vertical mode | ^[string] | — |
| aria-label ^(a11y) ^(2.7.2) | native `aria-label` attribute | ^[string] | — |
| range-start-label | when `range` is true, screen reader label for the start of the range | ^[string] | — |
| range-end-label | when `range` is true, screen reader label for the end of the range | ^[string] | — |
| format-value-text | format to display the `aria-valuenow` attribute for screen readers | ^[Function]`(value: number) => string` | — |
| tooltip-class | custom class name for the tooltip | ^[string] | — |
| placement | position of Tooltip | ^[enum]`'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end' \| 'left' \| 'left-start' \| 'left-end' \| 'right' \| 'right-start' \| 'right-end'` | top |
| marks | marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style | ^[object]`SliderMarks` | — |
| validate-event | whether to trigger form validation | ^[boolean] | true |
| Name | Description | Type | Default |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| model-value / v-model | binding value | ^[number] / ^[object]`number[]` | 0 |
| min | minimum value | ^[number] | 0 |
| max | maximum value | ^[number] | 100 |
| disabled | whether Slider is disabled | ^[boolean] | false |
| step | step size | ^[number] | 1 |
| show-input | whether to display an input box, works when `range` is false | ^[boolean] | false |
| show-input-controls | whether to display control buttons when `show-input` is true | ^[boolean] | true |
| size | size of the slider wrapper, will not work in vertical mode | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | default |
| input-size | size of the input box, when set `size`, the default is the value of `size` | ^[enum]`'' \| 'large' \| 'default' \| 'small'` | default |
| show-stops | whether to display breakpoints | ^[boolean] | false |
| show-tooltip | whether to display tooltip value | ^[boolean] | true |
| format-tooltip | format to display tooltip value | ^[Function]`(value: number) => number \| string` | — |
| range | whether to select a range | ^[boolean] | false |
| vertical | vertical mode | ^[boolean] | false |
| height | slider height, required in vertical mode | ^[string] | — |
| aria-label ^(a11y) ^(2.7.2) | native `aria-label` attribute | ^[string] | — |
| range-start-label | when `range` is true, screen reader label for the start of the range | ^[string] | — |
| range-end-label | when `range` is true, screen reader label for the end of the range | ^[string] | — |
| format-value-text | format to display the `aria-valuenow` attribute for screen readers | ^[Function]`(value: number) => string` | — |
| tooltip-class | custom class name for the tooltip | ^[string] | — |
| placement | position of Tooltip | ^[enum]`'top' \| 'top-start' \| 'top-end' \| 'bottom' \| 'bottom-start' \| 'bottom-end' \| 'left' \| 'left-start' \| 'left-end' \| 'right' \| 'right-start' \| 'right-end'` | top |
| marks | marks, type of key must be `number` and must in closed interval `[min, max]`, each mark can custom style | ^[object]`SliderMarks` | — |
| validate-event | whether to trigger form validation | ^[boolean] | true |
| persistent ^(2.9.5) | when slider tooltip inactive and `persistent` is `false` , tooltip will be destroyed. `persistent` always be `false` when `show-tooltip ` is `false` | ^[boolean] | true |
| label ^(a11y) ^(deprecated) | native `aria-label` attribute | ^[string] | — |
| label ^(a11y) ^(deprecated) | native `aria-label` attribute | ^[string] | — |
### Events

View File

@@ -186,7 +186,7 @@ tooltip/append-to
| virtual-triggering | Indicates whether virtual triggering is enabled | ^[boolean] | — |
| virtual-ref | Indicates the reference element to which the tooltip is attached | ^[HTMLElement] | — |
| trigger-keys | When you click the mouse to focus on the trigger element, you can define a set of keyboard codes to control the display of tooltip through the keyboard, not valid in controlled mode | ^[Array] | ['Enter','Space'] |
| persistent | when tooltip inactive and `persistent` is `false` , tooltip will be destroyed | ^[boolean] | — |
| persistent | when tooltip inactive and `persistent` is `false` , tooltip will be destroyed | ^[boolean] | — |
| aria-label ^(a11y) | same as `aria-label` | ^[string] | — |
| focus-on-target ^(2.11.2) | when triggering tooltips through hover, whether to focus the trigger element, which improves accessibility | ^[boolean] | false |