feature: add pagination component (#1213)

This commit is contained in:
花裤衩
2018-10-17 17:39:25 +08:00
committed by GitHub
parent f94aa1aca3
commit df23405bde
5 changed files with 158 additions and 38 deletions

View File

@@ -164,17 +164,6 @@ export function objectMerge(target, source) {
return target
}
export function scrollTo(element, to, duration) {
if (duration <= 0) return
const difference = to - element.scrollTop
const perTick = (difference / duration) * 10
setTimeout(() => {
element.scrollTop = element.scrollTop + perTick
if (element.scrollTop === to) return
scrollTo(element, to, duration - 10)
}, 10)
}
export function toggleClass(element, className) {
if (!element || !className) {
return