Skip to content

Commit

Permalink
docs(Select): disable single select options (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
rambii committed Jul 17, 2023
1 parent 4afdd3b commit 914cb03
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/content/3.forms/3.select.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ const country = ref(countries[0])
```
::

When using objects, you can configure which field will be used for display through the `option-attribute` prop that defaults to `label` and which field will be used for comparison through the `value-attribute` prop that defaults to `value`.
When using objects, you can configure which field will be used for display through the `option-attribute` prop that defaults to `label` and which field will be used for comparison through the `value-attribute` prop that defaults to `value`.

Adding a `disabled` key to the objects will control the disabled state of the option.

::component-example
#default
Expand All @@ -41,7 +43,8 @@ const countries = [{
value: 'US'
}, {
name: 'Canada',
value: 'CA'
value: 'CA',
disabled: true
}, {
name: 'Mexico',
value: 'MX'
Expand Down Expand Up @@ -191,6 +194,8 @@ props:
---
::

Add a `disabled` key with a truthy value to the `options` array of object to disable a single option.

### Loading

Use the `loading` prop to show a loading icon and disable the Input.
Expand Down

0 comments on commit 914cb03

Please sign in to comment.