Refactor #3965 - For ScrollTop
parent
ff2230736d
commit
4fc5d0918e
|
@ -39,7 +39,7 @@ const styles = `
|
||||||
|
|
||||||
const classes = {
|
const classes = {
|
||||||
root: ({ props }) => ['p-scrolltop p-link p-component', { 'p-scrolltop-sticky': props.target !== 'window' }],
|
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 });
|
const { load: loadStyle } = useStyle(styles, { id: 'primevue_scrolltop_style', manual: true });
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<transition name="p-scrolltop" appear @enter="onEnter" @after-leave="onAfterLeave">
|
<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')">
|
<button v-if="visible" :ref="containerRef" :class="cx('root')" @click="onClick" type="button" :aria-label="scrollTopAriaLabel" v-bind="ptm('root')">
|
||||||
<slot name="icon">
|
<slot name="icon" :class="cx('icon')">
|
||||||
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="cx('icon')" v-bind="ptm('icon')" />
|
<component :is="icon ? 'span' : 'ChevronUpIcon'" :class="[cx('icon'), icon]" v-bind="ptm('icon')" />
|
||||||
</slot>
|
</slot>
|
||||||
</button>
|
</button>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseScrollTop from './BaseScrollTop.vue';
|
|
||||||
import ChevronUpIcon from 'primevue/icons/chevronup';
|
import ChevronUpIcon from 'primevue/icons/chevronup';
|
||||||
import { DomHandler, ZIndexUtils } from 'primevue/utils';
|
import { DomHandler, ZIndexUtils } from 'primevue/utils';
|
||||||
|
import BaseScrollTop from './BaseScrollTop.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ScrollTop',
|
name: 'ScrollTop',
|
||||||
|
|
Loading…
Reference in New Issue