refactor: #7090 for SplitButton
parent
157883e0bf
commit
4a3306b97e
|
@ -33,7 +33,7 @@
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
:aria-expanded="isExpanded"
|
:aria-expanded="isExpanded"
|
||||||
:aria-controls="id + '_overlay'"
|
:aria-controls="$id + '_overlay'"
|
||||||
@click="onDropdownButtonClick"
|
@click="onDropdownButtonClick"
|
||||||
@keydown="onDropdownKeydown"
|
@keydown="onDropdownKeydown"
|
||||||
:severity="severity"
|
:severity="severity"
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</PVSButton>
|
</PVSButton>
|
||||||
<PVSMenu ref="menu" :id="id + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" :unstyled="unstyled" :pt="ptm('pcMenu')">
|
<PVSMenu ref="menu" :id="$id + '_overlay'" :model="model" :popup="true" :autoZIndex="autoZIndex" :baseZIndex="baseZIndex" :appendTo="appendTo" :unstyled="unstyled" :pt="ptm('pcMenu')">
|
||||||
<template v-if="$slots.menuitemicon" #itemicon="slotProps">
|
<template v-if="$slots.menuitemicon" #itemicon="slotProps">
|
||||||
<slot name="menuitemicon" :item="slotProps.item" :class="slotProps.class" />
|
<slot name="menuitemicon" :item="slotProps.item" :class="slotProps.class" />
|
||||||
</template>
|
</template>
|
||||||
|
@ -64,7 +64,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { isEmpty } from '@primeuix/utils/object';
|
import { isEmpty } from '@primeuix/utils/object';
|
||||||
import { UniqueComponentId } from '@primevue/core/utils';
|
|
||||||
import ChevronDownIcon from '@primevue/icons/chevrondown';
|
import ChevronDownIcon from '@primevue/icons/chevrondown';
|
||||||
import Button from 'primevue/button';
|
import Button from 'primevue/button';
|
||||||
import TieredMenu from 'primevue/tieredmenu';
|
import TieredMenu from 'primevue/tieredmenu';
|
||||||
|
@ -80,18 +79,10 @@ export default {
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: this.$attrs.id,
|
|
||||||
isExpanded: false
|
isExpanded: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
'$attrs.id': function (newValue) {
|
|
||||||
this.id = newValue || UniqueComponentId();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.id = this.id || UniqueComponentId();
|
|
||||||
|
|
||||||
this.$watch('$refs.menu.visible', (newValue) => {
|
this.$watch('$refs.menu.visible', (newValue) => {
|
||||||
this.isExpanded = newValue;
|
this.isExpanded = newValue;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue