Browse Source

fix: backtop transition not work

pull/2682/head
tangjinzhou 4 years ago
parent
commit
9ab1644e1e
  1. 4
      components/back-top/__tests__/index.test.js
  2. 4
      components/back-top/index.jsx

4
components/back-top/__tests__/index.test.js

@ -27,9 +27,7 @@ describe('BackTop', () => {
const wrapper = mount(BackTop, {
props: {
visibilityHeight: -1,
},
listeners: {
click: onClick,
onClick,
},
});
const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => {

4
components/back-top/index.jsx

@ -1,3 +1,4 @@
import { inject, Transition } from 'vue';
import PropTypes from '../_util/vue-types';
import backTopTypes from './backTopTypes';
import addEventListener from '../vc-util/Dom/addEventListener';
@ -6,7 +7,6 @@ import BaseMixin from '../_util/BaseMixin';
import getTransitionProps from '../_util/getTransitionProps';
import { ConfigConsumerProps } from '../config-provider';
import scrollTo from '../_util/scrollTo';
import { inject } from 'vue';
function getDefaultTarget() {
return window;
@ -92,7 +92,7 @@ const BackTop = {
<div {...divProps}>{($slots.default && $slots.default()) || defaultElement}</div>
) : null;
const transitionProps = getTransitionProps('fade');
return <transition {...transitionProps}>{backTopBtn}</transition>;
return <Transition {...transitionProps}>{backTopBtn}</Transition>;
},
};

Loading…
Cancel
Save