mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(backtop): code style
This commit is contained in:
@@ -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
|
||||
|
||||
5
packages/utils/animation.ts
Normal file
5
packages/utils/animation.ts
Normal 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
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user