Refactor #3879 - For ScrollTop

This commit is contained in:
Tuğçe Küçükoğlu 2023-04-21 16:42:00 +03:00
parent 1af654c740
commit 9dd6301979
3 changed files with 59 additions and 2 deletions

View file

@ -1,18 +1,21 @@
<template>
<transition name="p-scrolltop" appear @enter="onEnter" @after-leave="onAfterLeave">
<button v-if="visible" :ref="containerRef" :class="containerClass" @click="onClick" type="button" :aria-label="scrollTopAriaLabel">
<button v-if="visible" :ref="containerRef" :class="containerClass" @click="onClick" type="button" :aria-label="scrollTopAriaLabel" v-bind="ptm('root')">
<slot name="icon">
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="['p-scrolltop-icon', icon]"></component>
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="['p-scrolltop-icon', icon]" v-bind="ptm('icon')" />
</slot>
</button>
</transition>
</template>
<script>
import BaseComponent from 'primevue/basecomponent';
import ChevronUpIcon from 'primevue/icons/chevronup';
import { DomHandler, ZIndexUtils } from 'primevue/utils';
export default {
name: 'ScrollTop',
extends: BaseComponent,
scrollListener: null,
container: null,
props: {