fix(backtop): code style

This commit is contained in:
Caaalabash
2020-08-07 14:05:12 +08:00
committed by jeremywu
parent 9dc7aeff28
commit ea9961087f
3 changed files with 7 additions and 8 deletions

View File

@@ -19,8 +19,8 @@
<script lang="ts">
import { defineComponent, ref, computed, onMounted, onBeforeUnmount } from 'vue'
import { throttle } from 'lodash-es'
import { on, off } from '../../utils/dom'
import { easeInOutCubic } from '../../utils/util'
import { on, off } from '@element-plus/utils/dom'
import { easeInOutCubic } from '@element-plus/utils/animation'
interface IElBacktopProps {
visibilityHeight: number

View File

@@ -0,0 +1,5 @@
export const cubic = (value: number): number => Math.pow(value, 3)
export const easeInOutCubic = (value: number): number => value < 0.5
? cubic(value * 2) / 2
: 1 - cubic((1 - value) * 2) / 2

View File

@@ -146,10 +146,4 @@ export function rafThrottle(fn: (args: Record<string, unknown>) => unknown): (..
export const objToArray = castArray
export const cubic = (value: number): number => Math.pow(value, 3)
export const easeInOutCubic = (value: number): number => value < 0.5
? cubic(value * 2) / 2
: 1 - cubic((1 - value) * 2) / 2
export { isVNode } from 'vue'