From 0b7089cf74ca19b4b4125525b32dad9372ccf7ea Mon Sep 17 00:00:00 2001 From: Robin Ambrosius Date: Mon, 17 Jul 2023 10:27:05 +0200 Subject: [PATCH] add explanation on how to disable single options --- docs/content/3.forms/3.select.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/content/3.forms/3.select.md b/docs/content/3.forms/3.select.md index 0966a78d24..f171534786 100644 --- a/docs/content/3.forms/3.select.md +++ b/docs/content/3.forms/3.select.md @@ -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 @@ -41,7 +43,8 @@ const countries = [{ value: 'US' }, { name: 'Canada', - value: 'CA' + value: 'CA', + disabled: true }, { name: 'Mexico', value: 'MX' @@ -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.