You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/slots.md
+14-4Lines changed: 14 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,25 @@ If you are not familiar with Vue's slots, you can read more about them [here](ht
12
12
13
13
## option
14
14
15
-
**Type**: `slotProps: { option: Option }`
15
+
**Type**:
16
+
17
+
```ts
18
+
slotProps: {
19
+
option: Option;
20
+
index: number;
21
+
isFocused: boolean;
22
+
isSelected: boolean;
23
+
isDisabled: boolean;
24
+
}
25
+
```
16
26
17
-
Customize the rendered template of an option inside the menu. You can use the slot props to retrieve the current menu option that will be rendered.
27
+
Customize the rendered template of an option inside the menu. You can use the slot props to retrieve the current menu option that will be rendered in order to have more context and flexbility.
18
28
19
29
```vue
20
30
<template>
21
31
<VueSelect v-model="option" :options="options">
22
-
<template #option="{ option }">
23
-
{{ option.label }} - {{ option.value }}
32
+
<template #option="{ option, index }">
33
+
{{ option.label }} - {{ option.value }} (#{{ index }})
0 commit comments