pull/4142/head
mertsincan 2023-09-04 22:49:02 +01:00
parent ddc0b98131
commit 02bd55492c
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<template>
<div ref="container" v-ripple :class="cx('root')" @click="onClick($event)" v-bind="ptm('root', ptOptions)" :data-p-active="modelValue === true" data-pc-name="togglebutton">
<div ref="container" v-ripple :class="cx('root')" @click="onClick($event)" v-bind="ptm('root', getPTOptions)" :data-p-active="modelValue === true" data-pc-name="togglebutton">
<span class="p-hidden-accessible" v-bind="ptm('hiddenInputWrapper')" :data-p-hidden-accessible="true">
<input
:id="inputId"
@ -17,9 +17,9 @@
/>
</span>
<slot name="icon" :value="modelValue" :class="cx('icon')">
<span v-if="onIcon || offIcon" :class="[cx('icon'), modelValue ? onIcon : offIcon]" v-bind="ptm('icon', ptOptions)" />
<span v-if="onIcon || offIcon" :class="[cx('icon'), modelValue ? onIcon : offIcon]" v-bind="ptm('icon', getPTOptions)" />
</slot>
<span :class="cx('label')" v-bind="ptm('label', ptOptions)">{{ label }}</span>
<span :class="cx('label')" v-bind="ptm('label', getPTOptions)">{{ label }}</span>
</div>
</template>
@ -88,7 +88,7 @@ export default {
label() {
return this.hasLabel ? (this.modelValue ? this.onLabel : this.offLabel) : '&nbsp;';
},
ptOptions() {
getPTOptions() {
return {
context: {
focused: this.focused,