pull/6391/head
tugcekucukoglu 2024-09-11 11:19:34 +03:00
parent 89f6f2fe84
commit 3bdcbb4f1b
2 changed files with 3 additions and 13 deletions

View File

@ -61,7 +61,7 @@ export interface SelectButtonPassThroughOptions {
/** /**
* Used to pass attributes to the ToggleButton component. * Used to pass attributes to the ToggleButton component.
*/ */
pcButton?: SelectButtonPassThroughOptionType; pcToggleButton?: SelectButtonPassThroughOptionType;
/** /**
* Used to manage all lifecycle hooks. * Used to manage all lifecycle hooks.
* @see {@link BaseComponent.ComponentHooks} * @see {@link BaseComponent.ComponentHooks}

View File

@ -8,11 +8,11 @@
:disabled="disabled || isOptionDisabled(option)" :disabled="disabled || isOptionDisabled(option)"
:unstyled="unstyled" :unstyled="unstyled"
@change="onOptionSelect($event, option, index)" @change="onOptionSelect($event, option, index)"
:pt="ptm('pcButton')" :pt="ptm('pcToggleButton')"
> >
<template v-if="$slots.option" #default> <template v-if="$slots.option" #default>
<slot name="option" :option="option" :index="index"> <slot name="option" :option="option" :index="index">
<span v-bind="ptm('pcButton')['label']">{{ getOptionLabel(option) }}</span> <span v-bind="ptm('pcToggleButton')['label']">{{ getOptionLabel(option) }}</span>
</slot> </slot>
</template> </template>
</ToggleButton> </ToggleButton>
@ -41,15 +41,6 @@ export default {
getOptionRenderKey(option) { getOptionRenderKey(option) {
return this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option); return this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);
}, },
getPTOptions(option, key) {
return this.ptm(key, {
context: {
active: this.isSelected(option),
disabled: this.isOptionDisabled(option),
option
}
});
},
isOptionDisabled(option) { isOptionDisabled(option) {
return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false; return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;
}, },
@ -74,7 +65,6 @@ export default {
newValue = selected ? null : optionValue; newValue = selected ? null : optionValue;
} }
this.focusedIndex = index;
this.$emit('update:modelValue', newValue); this.$emit('update:modelValue', newValue);
this.$emit('change', { event: event, value: newValue }); this.$emit('change', { event: event, value: newValue });
}, },