Fixed #6412
parent
fcb8b56b57
commit
e6df32ab5c
|
@ -67,15 +67,10 @@ export interface ScrollTopSharedPassThroughMethodOptions {
|
|||
*/
|
||||
export interface ScrollTopPassThroughOptions {
|
||||
/**
|
||||
* Used to pass attributes to the previous button's DOM element.
|
||||
* Used to pass attributes to the root's DOM element.
|
||||
* @see {@link ButtonPassThroughOptions}
|
||||
*/
|
||||
root?: ButtonPassThroughOptions<ScrollTopSharedPassThroughMethodOptions>;
|
||||
/**
|
||||
* Used to pass attributes to the previous button's DOM element.
|
||||
* @see {@link ButtonPassThroughOptions}
|
||||
*/
|
||||
button?: ButtonPassThroughOptions<ScrollTopSharedPassThroughMethodOptions>;
|
||||
/**
|
||||
* Used to manage all lifecycle hooks.
|
||||
* @see {@link BaseComponent.ComponentHooks}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
<template>
|
||||
<transition name="p-scrolltop" appear @enter="onEnter" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
||||
<Button v-if="visible" :ref="containerRef" :class="cx('root')" @click="onClick" :aria-label="scrollTopAriaLabel" :unstyled="unstyled" v-bind="buttonProps" :pt="rootPTOptions()">
|
||||
<Button v-if="visible" :ref="containerRef" :class="cx('root')" @click="onClick" :aria-label="scrollTopAriaLabel" :unstyled="unstyled" v-bind="buttonProps" :pt="pt">
|
||||
<template #icon="slotProps">
|
||||
<slot name="icon" :class="cx('icon')">
|
||||
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="[cx('icon'), icon, slotProps.class]" v-bind="iconPTOptions" />
|
||||
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="[cx('icon'), icon, slotProps.class]" v-bind="ptmi('root')['icon']" />
|
||||
</slot>
|
||||
</template>
|
||||
</Button>
|
||||
|
@ -15,7 +15,6 @@ import { getWindowScrollTop } from '@primeuix/utils/dom';
|
|||
import { ZIndex } from '@primeuix/utils/zindex';
|
||||
import ChevronUpIcon from '@primevue/icons/chevronup';
|
||||
import Button from 'primevue/button';
|
||||
import { mergeProps } from 'vue';
|
||||
import BaseScrollTop from './BaseScrollTop.vue';
|
||||
|
||||
export default {
|
||||
|
@ -89,12 +88,6 @@ export default {
|
|||
},
|
||||
containerRef(el) {
|
||||
this.container = el ? el.$el : undefined;
|
||||
},
|
||||
rootPTOptions() {
|
||||
return mergeProps(this.ptmi('root'), this.ptm('button'));
|
||||
},
|
||||
iconPTOptions() {
|
||||
return mergeProps(this.ptmi('root')['icon'], this.ptm('button')['icon']);
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
Loading…
Reference in New Issue