Refactor #4384
parent
ddc0b98131
commit
02bd55492c
|
@ -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) : ' ';
|
||||
},
|
||||
ptOptions() {
|
||||
getPTOptions() {
|
||||
return {
|
||||
context: {
|
||||
focused: this.focused,
|
||||
|
|
Loading…
Reference in New Issue