Refactor #3965 - For ScrollTop

pull/3997/head
Tuğçe Küçükoğlu 2023-05-25 17:42:59 +03:00
parent ff2230736d
commit 4fc5d0918e
2 changed files with 4 additions and 4 deletions

View File

@ -39,7 +39,7 @@ const styles = `
const classes = {
root: ({ props }) => ['p-scrolltop p-link p-component', { 'p-scrolltop-sticky': props.target !== 'window' }],
icon: ({ props }) => ['p-scrolltop-icon', props.icon]
icon: 'p-scrolltop-icon'
};
const { load: loadStyle } = useStyle(styles, { id: 'primevue_scrolltop_style', manual: true });

View File

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