2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-17 02:29:37 +03:00
Files
vue-select/dev/Dev.vue
T
Owen Conti f9725919a4 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.
2019-03-23 11:25:31 -07:00

79 lines
1.6 KiB
Vue

<template>
<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>
</sandbox>
</div>
</template>
<script>
import vSelect from '../src/components/Select';
import Sandbox from '../docs/.vuepress/components/Sandbox';
// import countries from '../docs/.vuepress/data/countryCodes';
// import books from '../docs/.vuepress/data/books';
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>
<style>
html,
body {
margin: 0;
height: 100%;
font-family: -apple-system, sans-serif;
}
#app {
height: 100%;
}
hr {
border: none;
border-bottom: 1px solid #cacaca;
margin-bottom: 1em;
padding-top: 1em;
width: 90%;
}
</style>