Selectbutton class refactor

pull/12/head
Merve Özçifçi 2019-05-30 17:53:07 +03:00
parent b10cf9eb6b
commit 1d011e7c72
1 changed files with 8 additions and 3 deletions

View File

@ -1,5 +1,5 @@
<template>
<div class="p-selectbutton p-buttonset p-component p-buttonset">
<div :class="containerClass">
<div v-for="(option, i) of options" :key="getOptionLabel(option)" :aria-label="getOptionLabel(option)"
@click="onOptionSelect($event, option, i)" @keydown.enter.prevent="onOptionSelect($event, option, i)" @keydown.space.prevent="onOptionSelect($event, option)"
:tabindex="isOptionDisabled(option) ? null : '0'" @focus="onFocus($event, i)" @blur="onBlur($event)"
@ -89,6 +89,11 @@ export default {
this.focusedIndex = null
this.$emit('blur', event);
}
},
computed: {
containerClass() {
return 'p-selectbutton p-buttonset p-component p-buttonset-' + String(this.options ? this.options.length : 0);
}
},
}
</script>