mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3879 - For ScrollTop
This commit is contained in:
parent
1af654c740
commit
9dd6301979
3 changed files with 59 additions and 2 deletions
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue