2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00

V3 - Remove mutable class properties plus other misc changes (#781)

* Remove the mutableValue prop in the Select component.

* Add back mutable value when Vue Select has to manage its own value.

* Remove mutableOptions, valueAsAarray. Update webpack minifer to use Terser.

* Fix tabbing

* Fix bug with showClearButton

* Fix tests.

* Call clearSelection when possible

* Update dev sandbox to have all three options for setting value.

* Update dev sandbox to display current value

* Remove unused karma test setup.

* Revert onInput name change.

* Use coveralls

* Change this.internalValue to this.$data._value.

* Remove onInput prop and replace with internal method, updateValue.

* Update tests.

* Rename optionObjectComparator to optionComparator.
This commit is contained in:
Owen Conti
2019-03-23 12:25:31 -06:00
committed by Jeff Sagal
parent f95b118edb
commit f9725919a4
16 changed files with 250 additions and 1950 deletions
+43
View File
@@ -2,7 +2,18 @@
<div id="app">
<sandbox hide-help>
<template slot-scope="config">
<p>Value managed by `v-model`:</p>
<v-select v-model="vModelValue" v-bind="config" />
<pre><code>`v-model` value: {{ vModelValueStringified }}</code></pre>
<hr />
<p>Value managed by `:value` and `@input`:</p>
<v-select :value="valueProp" @input="changeValueProp" v-bind="config" />
<pre><code>value passed to `@input`: {{ valuePropStringified }}</code></pre>
<hr />
<p>Value managed by Vue Select internally:</p>
<v-select v-bind="config" />
</template>
@@ -18,6 +29,30 @@ import Sandbox from '../docs/.vuepress/components/Sandbox';
export default {
components: {Sandbox, vSelect},
data: () => ({
vModelValue: {
value: 'CA',
label: 'Canada'
},
valueProp: {
value: 'US',
label: 'United States'
}
}),
methods: {
changeValueProp(value) {
this.valueProp = value;
}
},
computed: {
vModelValueStringified() {
return JSON.stringify(this.vModelValue, null, 2);
},
valuePropStringified() {
return JSON.stringify(this.valueProp, null, 2);
}
}
};
</script>
@@ -32,4 +67,12 @@ export default {
#app {
height: 100%;
}
hr {
border: none;
border-bottom: 1px solid #cacaca;
margin-bottom: 1em;
padding-top: 1em;
width: 90%;
}
</style>