mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 09:41:45 +00:00
Fixed label type.
Added tests.
This commit is contained in:
Vendored
+1
-1
@@ -25,7 +25,7 @@ export interface VueSelectProps {
|
||||
transition: string;
|
||||
clearSearchOnSelect: boolean;
|
||||
closeOnSelect: boolean;
|
||||
label: boolean;
|
||||
label: string;
|
||||
getOptionLabel: (option: Option) => string;
|
||||
onChange: OptionConsumer;
|
||||
taggable: boolean;
|
||||
|
||||
@@ -1,11 +1,67 @@
|
||||
import Vue from 'vue';
|
||||
import VueSelect, {Option} from 'vue-select';
|
||||
|
||||
const options = [
|
||||
{
|
||||
name: 'SomeName'
|
||||
},
|
||||
{
|
||||
name: 'SomeName2'
|
||||
}
|
||||
]
|
||||
|
||||
new Vue({
|
||||
|
||||
el: '#app',
|
||||
data: {
|
||||
options,
|
||||
value: null,
|
||||
|
||||
},
|
||||
components: {
|
||||
'vue-select': VueSelect
|
||||
},
|
||||
template: {
|
||||
'<vue-select></vue-select>'
|
||||
}
|
||||
methods: {
|
||||
getOptionLabel(option: Option) {
|
||||
if (option && option.name) {
|
||||
return option.name;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
optionConsumer(option: Option) {
|
||||
},
|
||||
optionToOption(option: Option) {
|
||||
return option;
|
||||
},
|
||||
onSearch(search: string, loading: (b: boolean) => void) {
|
||||
loading(true);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<vue-select :filterable="false"
|
||||
:value="value"
|
||||
:options="options"
|
||||
disable="false"
|
||||
maxHeight="200"
|
||||
searchable="true"
|
||||
multiple="false"
|
||||
placeholder="Placeholder"
|
||||
transition="SomeTransition"
|
||||
clearSearchOnSelect="false"
|
||||
:closeOnSelect="false"
|
||||
label="name"
|
||||
:getOptionLabel="getOptionLabel"
|
||||
:onChange="optionConsumer"
|
||||
:taggable="true"
|
||||
:tabindex="null"
|
||||
pushTags="false"
|
||||
:createOption="optionToOption"
|
||||
resetOnOptionsChange="false"
|
||||
noDrop="true"
|
||||
:inputId="null"
|
||||
dir="someDir"
|
||||
@search="onSearch"
|
||||
@input="optionConsumer">
|
||||
</vue-select>
|
||||
`
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user