mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 17:02:38 +00:00
Fixed ToggleButton
This commit is contained in:
parent
d36dabf257
commit
2533843785
4 changed files with 56 additions and 93 deletions
|
@ -1,12 +1,10 @@
|
|||
<template>
|
||||
<div :class="cx('root')" v-bind="getPTOptions('root')" :data-p-highlight="active" :data-p-disabled="disabled">
|
||||
<button v-ripple type="button" :class="cx('button')" :tabindex="tabindex" :aria-pressed="modelValue" :aria-disabled="disabled" @click="onChange" v-bind="getPTOptions('button')">
|
||||
<slot name="icon" :value="modelValue" :class="cx('icon')">
|
||||
<span v-if="onIcon || offIcon" :class="[cx('icon'), modelValue ? onIcon : offIcon]" v-bind="getPTOptions('icon')" />
|
||||
</slot>
|
||||
<span :class="cx('label')" v-bind="getPTOptions('label')">{{ label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<button v-ripple type="button" :class="cx('root')" :tabindex="tabindex" :disabled="disabled" :aria-pressed="modelValue" @click="onChange" v-bind="getPTOptions('root')" :data-p-highlight="active" :data-p-disabled="disabled">
|
||||
<slot name="icon" :value="modelValue" :class="cx('icon')">
|
||||
<span v-if="onIcon || offIcon" :class="[cx('icon'), modelValue ? onIcon : offIcon]" v-bind="getPTOptions('icon')" />
|
||||
</slot>
|
||||
<span :class="cx('label')" v-bind="getPTOptions('label')">{{ label }}</span>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -4,12 +4,10 @@ const classes = {
|
|||
root: ({ instance, props }) => [
|
||||
'p-togglebutton p-component',
|
||||
{
|
||||
'p-disabled': props.disabled,
|
||||
'p-highlight': instance.active,
|
||||
'p-invalid': props.invalid
|
||||
}
|
||||
],
|
||||
button: 'p-togglebutton-button',
|
||||
icon: ({ instance, props }) => [
|
||||
'p-togglebutton-icon',
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue