Skip to content

Instantly share code, notes, and snippets.

@wataruoguchi
Last active May 13, 2018 02:32
Show Gist options
  • Select an option

  • Save wataruoguchi/a6faa41ab971584c50216db9e8853807 to your computer and use it in GitHub Desktop.

Select an option

Save wataruoguchi/a6faa41ab971584c50216db9e8853807 to your computer and use it in GitHub Desktop.
<template>
<div>
<vue-multiselect
v-model="selected"
:multiple="true"
:options="options"
track-by="name"
:custom-label="title">
</vue-multiselect>
</div>
</template>
<script>
import VueMultiselect from 'vue-multiselect'
export default {
components: {
VueMultiselect: VueMultiselect
},
data: function() {
return {
selected: []
};
},
props: {
labels: {
type: Object
}
},
methods: {
title: function(option) {
return option.title;
}
}
}
</script>
<style src="vue-multiselect/dist/vue-multiselect.min.css"></style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment