2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-20 03:09:36 +03:00
Files
vue-select/docs/components/CustomHandlers.vue
2021-07-28 09:46:15 -07:00

26 lines
465 B
Vue

<template>
<v-select
taggable
multiple
no-drop
:map-keydown="handlers"
placeholder="enter an email"
/>
</template>
<script>
export default {
name: 'CustomHandlers',
methods: {
handlers: (map, vm) => ({
...map, 50: e => {
e.preventDefault();
if( e.key === '@' && vm.search.length > 0 ) {
vm.search = `${vm.search}@gmail.com`;
}
},
}),
},
};
</script>