Skip to content

Commit f424a49

Browse files
authored
Merge pull request #1751 from shentao/next
Release Version 3
2 parents df1d261 + 4c1ed14 commit f424a49

File tree

190 files changed

+37274
-20050
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+37274
-20050
lines changed

.babelrc

+3-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
{
2-
"presets": ["@vue/app"],
3-
"env": {
4-
"test": {
5-
"presets": [
6-
[
7-
"@vue/app",
8-
{
9-
"modules": "commonjs"
10-
}
11-
]
12-
]
13-
}
14-
}
2+
"presets": [
3+
"@vue/cli-plugin-babel/preset"
4+
]
155
}

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ jobs:
33
build:
44
docker:
55
# specify the version you desire here
6-
- image: cimg/node:12.22.12
6+
- image: cimg/node:14.18.1
77

88
# Specify service dependencies here if necessary
99
# CircleCI maintains a library of pre-built images

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ selenium-debug.log
55
tests/unit/coverage
66
tests/e2e/reports
77
.idea/
8+
/documentation/shiki/

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ index.html
2020
config.js
2121
bower.json
2222
v1/
23+
.idea/

.tern-project

-10
This file was deleted.

README.md

+76-95
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1-
# vue-multiselect ![Build Status](https://circleci.com/gh/shentao/vue-multiselect/tree/2.0.svg?style=shield&circle-token=5c931ff28fd12587610f835472becdd514d09cef)[![Codecov branch](https://img.shields.io/codecov/c/github/shentao/vue-multiselect/2.0.svg)](https://codecov.io/gh/shentao/vue-multiselect/branch/2.0)[![npm](https://img.shields.io/npm/v/vue-multiselect.svg)](https://www.npmjs.com/package/vue-multiselect)
2-
Probably the most complete *selecting* solution for Vue.js 2.0, without jQuery.
1+
# vue-multiselect
32

4-
### Vue 3.0 Support
5-
For Vue 3.0 compatible version see [`next`](https://github.com/shentao/vue-multiselect/tree/next) branch.
3+
## Documentation for version 3
64

7-
<a href="https://vue-multiselect.js.org/">
8-
<img src="/multiselect-screen-203.png" alt="Vue-Multiselect Screen">
9-
</a>
10-
11-
## Documentation
12-
Visit: [vue-multiselect.js.org](https://vue-multiselect.js.org/#sub-getting-started)
5+
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)
136

147
## Sponsors
158

169
<p align="center">
1710
<a href="https://getform.io/" target="_blank">
18-
<img src="https://cdn.discordapp.com/attachments/1002927810710605875/1034915542596845728/getform.png" alt="Get Form" width="240px">
11+
<img src="./svg/getform.svg" alt="GetForm Logo">
1912
</a>
2013
</p>
2114

2215
<p align="center">
2316
<a href="https://suade.org/" target="_blank">
24-
<img src="https://tinyurl.com/suadelogo" alt="Suade Labs" width="200px">
17+
<img src="./svg/suade.svg" alt="Suade Logo">
2518
</a>
2619
</p>
2720

@@ -33,7 +26,7 @@ Visit: [vue-multiselect.js.org](https://vue-multiselect.js.org/#sub-getting-star
3326

3427
<p align="center">
3528
<a href="https://www.vuemastery.com/" target="_blank">
36-
<img src="https://cdn.discordapp.com/attachments/258614093362102272/557267759130607630/Vue-Mastery-Big.png" alt="Vue Mastery logo" width="180px">
29+
<img src="./svg/vuemastery.svg" alt="Vue Mastery Logo">
3730
</a>
3831
</p>
3932

@@ -50,111 +43,102 @@ Visit: [vue-multiselect.js.org](https://vue-multiselect.js.org/#sub-getting-star
5043
* V-model support
5144
* Vuex support
5245
* Async options support
53-
* \> 95% test coverage
5446
* Fully configurable (see props list below)
5547

56-
## Breaking changes:
57-
* Instead of Vue.partial for custom option templates you can use a custom render function.
58-
* The `:key` props has changed to `:track-by`, due to conflicts with Vue 2.0.
59-
* Support for `v-model`
60-
* `@update` has changed to `@input` to also work with v-model
61-
* `:selected` has changed to `:value` for the same reason
62-
* Browserify users: if you wish to import `.vue` files, please add `vueify` transform.
6348

6449
## Install & basic usage
6550

6651
```bash
67-
npm install vue-multiselect
52+
npm install vue-multiselect@next
6853
```
6954

7055
```vue
7156
<template>
7257
<div>
73-
<multiselect
58+
<VueMultiselect
7459
v-model="selected"
7560
:options="options">
76-
</multiselect>
61+
</VueMultiselect>
7762
</div>
7863
</template>
7964
8065
<script>
81-
import Multiselect from 'vue-multiselect'
82-
export default {
83-
components: { Multiselect },
84-
data () {
85-
return {
86-
selected: null,
87-
options: ['list', 'of', 'options']
88-
}
66+
import VueMultiselect from 'vue-multiselect'
67+
export default {
68+
components: { VueMultiselect },
69+
data () {
70+
return {
71+
selected: null,
72+
options: ['list', 'of', 'options']
8973
}
9074
}
75+
}
9176
</script>
9277
93-
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
78+
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
9479
```
9580

9681
## JSFiddle
9782

9883
[Example JSFiddle](https://jsfiddle.net/mattelen/8cyt3hrn/5/) – Use this for issue reproduction.
9984

10085
## Examples
101-
in jade-lang/pug-lang
10286

10387
### 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"
11498
track-by="name"
115-
)
99+
/>
116100
```
117101

118102
### 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"
127111
track-by="name"
128-
)
112+
/>
129113
```
130114

131115
### 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"
140124
track-by="name"
141-
)
125+
/>
142126
```
143127

144128
### Tagging
145129
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"
156140
track-by="code"
157-
)
141+
/>
158142
```
159143

160144
``` javascript
@@ -170,19 +154,21 @@ addTag (newTag) {
170154
```
171155

172156
### 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"
181165
label="name"
182166
track-by="code"
183-
)
184-
span(slot="noResult").
167+
>
168+
<template #noResult>
185169
Oops! No elements found. Consider changing the search query.
170+
</template>
171+
</VueMultiselect>
186172
```
187173

188174
``` javascript
@@ -193,24 +179,19 @@ methods: {
193179
}
194180
```
195181

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+
196188
## Contributing
197189

198190
``` bash
199-
# serve with hot reload at localhost:8080
200-
npm run dev
201-
202191
# distribution build with minification
203192
npm run bundle
204193

205-
# build the documentation into docs
206-
npm run docs
207-
208194
# run unit tests
209195
npm run test
210196

211-
# run unit tests watch
212-
npm run unit
213-
214197
```
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).

bower.json

-28
This file was deleted.

build/build.js

-40
This file was deleted.

0 commit comments

Comments
 (0)