Refactor #4384
parent
ddc0b98131
commit
02bd55492c
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<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">
|
<span class="p-hidden-accessible" v-bind="ptm('hiddenInputWrapper')" :data-p-hidden-accessible="true">
|
||||||
<input
|
<input
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
|
@ -17,9 +17,9 @@
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
<slot name="icon" :value="modelValue" :class="cx('icon')">
|
<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>
|
</slot>
|
||||||
<span :class="cx('label')" v-bind="ptm('label', ptOptions)">{{ label }}</span>
|
<span :class="cx('label')" v-bind="ptm('label', getPTOptions)">{{ label }}</span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ export default {
|
||||||
label() {
|
label() {
|
||||||
return this.hasLabel ? (this.modelValue ? this.onLabel : this.offLabel) : ' ';
|
return this.hasLabel ? (this.modelValue ? this.onLabel : this.offLabel) : ' ';
|
||||||
},
|
},
|
||||||
ptOptions() {
|
getPTOptions() {
|
||||||
return {
|
return {
|
||||||
context: {
|
context: {
|
||||||
focused: this.focused,
|
focused: this.focused,
|
||||||
|
|
Loading…
Reference in New Issue