mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-10-15 05:02:09 +08:00
fix(transition): fix requestAnimationFrame is not executed in the background (#5131)
This commit is contained in:
parent
ebbc7a3e68
commit
270474f541
@ -1,5 +1,5 @@
|
|||||||
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
import { isDef, isNumber, isPlainObject, isPromise } from './validator';
|
||||||
import { canIUseGroupSetData, canIUseNextTick, getSystemInfoSync } from './version';
|
import { canIUseGroupSetData, canIUseNextTick } from './version';
|
||||||
|
|
||||||
export { isDef } from './validator';
|
export { isDef } from './validator';
|
||||||
export { getSystemInfoSync } from './version';
|
export { getSystemInfoSync } from './version';
|
||||||
@ -28,23 +28,11 @@ export function addUnit(value?: string | number): string | undefined {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function requestAnimationFrame(cb: () => void) {
|
export function requestAnimationFrame(cb: () => void) {
|
||||||
const systemInfo = getSystemInfoSync();
|
|
||||||
|
|
||||||
if (systemInfo.platform === 'devtools') {
|
|
||||||
return setTimeout(() => {
|
return setTimeout(() => {
|
||||||
cb();
|
cb();
|
||||||
}, 1000 / 30);
|
}, 1000 / 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
return wx
|
|
||||||
.createSelectorQuery()
|
|
||||||
.selectViewport()
|
|
||||||
.boundingClientRect()
|
|
||||||
.exec(() => {
|
|
||||||
cb();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function pickExclude(obj: unknown, keys: string[]) {
|
export function pickExclude(obj: unknown, keys: string[]) {
|
||||||
if (!isPlainObject(obj)) {
|
if (!isPlainObject(obj)) {
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user