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
Documentation for v3.0.0 is almost the same as for v2.x as it is mostly backward compatible. For the full docs for v3 and previous versions, check out: [vue-multiselect.js.org](https://vue-multiselect.js.org/#sub-getting-started)
[Example JSFiddle](https://jsfiddle.net/mattelen/8cyt3hrn/5/) – Use this for issue reproduction.
99
84
100
85
## Examples
101
-
in jade-lang/pug-lang
102
86
103
87
### Single select / dropdown
104
-
```jade
105
-
multiselect(
106
-
:value="value",
107
-
:options="source",
108
-
:searchable="false",
109
-
:close-on-select="false",
110
-
:allow-empty="false",
111
-
@input="updateSelected",
112
-
label="name",
113
-
placeholder="Select one",
88
+
```vue
89
+
<VueMultiselect
90
+
:model-value="value"
91
+
:options="source"
92
+
:searchable="false"
93
+
:close-on-select="false"
94
+
:allow-empty="false"
95
+
@update:model-value="updateSelected"
96
+
label="name"
97
+
placeholder="Select one"
114
98
track-by="name"
115
-
)
99
+
/>
116
100
```
117
101
118
102
### Single select with search
119
-
```jade
120
-
multiselect(
121
-
v-model="value",
122
-
:options="source",
123
-
:close-on-select="true",
124
-
:clear-on-select="false",
125
-
placeholder="Select one",
126
-
label="name",
103
+
```vue
104
+
<VueMultiselect
105
+
v-model="value"
106
+
:options="source"
107
+
:close-on-select="true"
108
+
:clear-on-select="false"
109
+
placeholder="Select one"
110
+
label="name"
127
111
track-by="name"
128
-
)
112
+
/>
129
113
```
130
114
131
115
### Multiple select with search
132
-
```jade
133
-
multiselect(
134
-
v-model="multiValue",
135
-
:options="source",
136
-
:multiple="true",
137
-
:close-on-select="true",
138
-
placeholder="Pick some",
139
-
label="name",
116
+
```vue
117
+
<VueMultiselect
118
+
v-model="multiValue"
119
+
:options="source"
120
+
:multiple="true"
121
+
:close-on-select="true"
122
+
placeholder="Pick some"
123
+
label="name"
140
124
track-by="name"
141
-
)
125
+
/>
142
126
```
143
127
144
128
### Tagging
145
129
with `@tag` event
146
-
```jade
147
-
multiselect(
148
-
v-model="taggingSelected",
149
-
:options="taggingOptions",
150
-
:multiple="true",
151
-
:taggable="true",
152
-
@tag="addTag",
153
-
tag-placeholder="Add this as new tag",
154
-
placeholder="Type to search or add tag",
155
-
label="name",
130
+
```vue
131
+
<VueMultiselect
132
+
v-model="taggingSelected"
133
+
:options="taggingOptions"
134
+
:multiple="true"
135
+
:taggable="true"
136
+
@tag="addTag"
137
+
tag-placeholder="Add this as new tag"
138
+
placeholder="Type to search or add tag"
139
+
label="name"
156
140
track-by="code"
157
-
)
141
+
/>
158
142
```
159
143
160
144
```javascript
@@ -170,19 +154,21 @@ addTag (newTag) {
170
154
```
171
155
172
156
### Asynchronous dropdown
173
-
```jade
174
-
multiselect(
175
-
v-model="selectedCountries",
176
-
:options="countries",
177
-
:multiple="multiple",
178
-
:searchable="searchable",
179
-
@search-change="asyncFind",
180
-
placeholder="Type to search",
157
+
```vue
158
+
<VueMultiselect
159
+
v-model="selectedCountries"
160
+
:options="countries"
161
+
:multiple="multiple"
162
+
:searchable="searchable"
163
+
@search-change="asyncFind"
164
+
placeholder="Type to search"
181
165
label="name"
182
166
track-by="code"
183
-
)
184
-
span(slot="noResult").
167
+
>
168
+
<template #noResult>
185
169
Oops! No elements found. Consider changing the search query.
170
+
</template>
171
+
</VueMultiselect>
186
172
```
187
173
188
174
```javascript
@@ -193,24 +179,19 @@ methods: {
193
179
}
194
180
```
195
181
182
+
## Special Thanks
183
+
184
+
Thanks to Matt Elen for contributing this version!
185
+
186
+
> A Vue 3 upgrade of [@shentao's](https://github.com/shentao)[vue-mulitselect](https://github.com/shentao/vue-multiselect) component. The idea is that when you upgrade to Vue 3, you can swap the two components out, and everything should simply work. Feel free to check out our story of how we upgraded our product to Vue 3 on our blog at [suade.org](https://suade.org/a-products-vue-3-migration-a-real-life-story/)
187
+
196
188
## Contributing
197
189
198
190
```bash
199
-
# serve with hot reload at localhost:8080
200
-
npm run dev
201
-
202
191
# distribution build with minification
203
192
npm run bundle
204
193
205
-
# build the documentation into docs
206
-
npm run docs
207
-
208
194
# run unit tests
209
195
npm run test
210
196
211
-
# run unit tests watch
212
-
npm run unit
213
-
214
197
```
215
-
216
-
For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
0 commit comments