Fixed #6412
parent
fcb8b56b57
commit
e6df32ab5c
|
@ -67,15 +67,10 @@ export interface ScrollTopSharedPassThroughMethodOptions {
|
||||||
*/
|
*/
|
||||||
export interface ScrollTopPassThroughOptions {
|
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}
|
* @see {@link ButtonPassThroughOptions}
|
||||||
*/
|
*/
|
||||||
root?: ButtonPassThroughOptions<ScrollTopSharedPassThroughMethodOptions>;
|
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.
|
* Used to manage all lifecycle hooks.
|
||||||
* @see {@link BaseComponent.ComponentHooks}
|
* @see {@link BaseComponent.ComponentHooks}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="p-scrolltop" appear @enter="onEnter" @after-leave="onAfterLeave" v-bind="ptm('transition')">
|
<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">
|
<template #icon="slotProps">
|
||||||
<slot name="icon" :class="cx('icon')">
|
<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>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
</Button>
|
</Button>
|
||||||
|
@ -15,7 +15,6 @@ import { getWindowScrollTop } from '@primeuix/utils/dom';
|
||||||
import { ZIndex } from '@primeuix/utils/zindex';
|
import { ZIndex } from '@primeuix/utils/zindex';
|
||||||
import ChevronUpIcon from '@primevue/icons/chevronup';
|
import ChevronUpIcon from '@primevue/icons/chevronup';
|
||||||
import Button from 'primevue/button';
|
import Button from 'primevue/button';
|
||||||
import { mergeProps } from 'vue';
|
|
||||||
import BaseScrollTop from './BaseScrollTop.vue';
|
import BaseScrollTop from './BaseScrollTop.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -89,12 +88,6 @@ export default {
|
||||||
},
|
},
|
||||||
containerRef(el) {
|
containerRef(el) {
|
||||||
this.container = el ? el.$el : undefined;
|
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: {
|
computed: {
|
||||||
|
|
Loading…
Reference in New Issue