@@ -7,13 +7,16 @@ Slots can be used to change the look and feel of the UI, or to simply swap out t
7
7
8
8
### ` selected-option `
9
9
10
- #### Scope:
10
+ #### Scope:
11
11
12
12
- ` option {Object} ` - A selected option
13
13
14
14
``` html
15
- <slot name =" selected-option" v-bind =" (typeof option === 'object')?option:{[label]: option}" >
16
- {{ getOptionLabel(option) }}
15
+ <slot
16
+ name =" selected-option"
17
+ v-bind =" (typeof option === 'object')?option:{[label]: option}"
18
+ >
19
+ {{ getOptionLabel(option) }}
17
20
</slot >
18
21
```
19
22
@@ -27,45 +30,89 @@ Slots can be used to change the look and feel of the UI, or to simply swap out t
27
30
- ` multiple {Boolean} ` - If the component supports the selection of multiple values
28
31
29
32
``` html
30
- <slot v-for =" option in valueAsArray" name =" selected-option-container"
31
- :option =" (typeof option === 'object')?option:{[label]: option}" :deselect =" deselect" :multiple =" multiple" :disabled =" disabled" >
32
- <span class =" selected-tag" v-bind:key =" option.index" >
33
- <slot name =" selected-option" v-bind =" (typeof option === 'object')?option:{[label]: option}" >
34
- {{ getOptionLabel(option) }}
35
- </slot >
36
- <button v-if =" multiple" :disabled =" disabled" @click =" deselect(option)" type =" button" class =" close" aria-label =" Remove option" >
37
- <span aria-hidden =" true" >× ; </span >
38
- </button >
39
- </span >
33
+ <slot
34
+ v-for =" option in valueAsArray"
35
+ name =" selected-option-container"
36
+ :option =" (typeof option === 'object')?option:{[label]: option}"
37
+ :deselect =" deselect"
38
+ :multiple =" multiple"
39
+ :disabled =" disabled"
40
+ >
41
+ <span class =" selected-tag" v-bind:key =" option.index" >
42
+ <slot
43
+ name =" selected-option"
44
+ v-bind =" (typeof option === 'object')?option:{[label]: option}"
45
+ >
46
+ {{ getOptionLabel(option) }}
47
+ </slot >
48
+ <button
49
+ v-if =" multiple"
50
+ :disabled =" disabled"
51
+ @click =" deselect(option)"
52
+ type =" button"
53
+ class =" close"
54
+ aria-label =" Remove option"
55
+ >
56
+ <span aria-hidden =" true" >× ; </span >
57
+ </button >
58
+ </span >
40
59
</slot >
41
60
```
42
61
43
62
## Component Actions
44
63
45
64
### ` spinner `
46
65
66
+ #### Scope:
67
+
68
+ - ` loading {Boolean} ` - if the component is in a loading state
69
+
47
70
``` html
48
- <slot name =" spinner" >
49
- <div class =" spinner " v-show =" mutableLoading" >Loading...</div >
71
+ <slot name =" spinner" v-bind = " scope.spinner " >
72
+ <div class =" vs__spinner " v-show =" mutableLoading" >Loading...</div >
50
73
</slot >
51
74
```
52
75
53
- ### ` no-options `
76
+ ### ` open-indicator `
54
77
55
- ``` html
56
- <slot name =" no-options" >Sorry, no matching options.</slot >
78
+ ``` js
79
+ attributes : {
80
+ ' ref' : ' openIndicator' ,
81
+ ' role' : ' presentation' ,
82
+ ' class' : ' vs__open-indicator' ,
83
+ }
84
+ ```
85
+
86
+ ``` vue
87
+ <slot name="open-indicator" v-bind="scope.openIndicator">
88
+ <component :is="childComponents.OpenIndicator" v-if="!noDrop" v-bind="scope.openIndicator.attributes"/>
89
+ </slot>
57
90
```
58
91
59
92
## Dropdown
60
93
61
94
### ` option `
62
95
63
- #### Scope:
64
-
65
96
- ` option {Object} ` - The currently iterated option from ` filteredOptions `
66
97
67
98
``` html
68
- <slot name =" option" v-bind =" (typeof option === 'object')?option:{[label]: option}" >
69
- {{ getOptionLabel(option) }}
99
+ <slot
100
+ name =" option"
101
+ v-bind =" (typeof option === 'object')?option:{[label]: option}"
102
+ >
103
+ {{ getOptionLabel(option) }}
104
+ </slot >
105
+ ```
106
+
107
+ ### ` no-options `
108
+
109
+ The no options slot is displayed in the dropdown when ` filteredOptions.length === 0 ` .
110
+
111
+ - ` search {String} ` - the current search text
112
+ - ` searching {Boolean} ` - if the component has search text
113
+
114
+ ``` vue
115
+ <slot name="no-options" v-bind="scope.noOptions">
116
+ Sorry, no matching options.
70
117
</slot>
71
118
```
0 commit comments