mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-08-30 20:59:47 +08:00
fix(utils): fix compile error (#3878)
This commit is contained in:
parent
68f8b4e0ee
commit
76f58a12f6
@ -83,8 +83,7 @@ export function setContentAnimate(
|
|||||||
expanded: boolean,
|
expanded: boolean,
|
||||||
mounted: boolean
|
mounted: boolean
|
||||||
) {
|
) {
|
||||||
getRect
|
getRect(context, '.van-collapse-item__content')
|
||||||
.call(context, '.van-collapse-item__content')
|
|
||||||
.then((rect) => rect.height)
|
.then((rect) => rect.height)
|
||||||
.then((height: number) => {
|
.then((height: number) => {
|
||||||
canIUseAnimate()
|
canIUseAnimate()
|
||||||
|
@ -33,11 +33,13 @@ export function addUnit(value?: string | number): string | undefined {
|
|||||||
return isNumber(value) ? `${value}px` : value;
|
return isNumber(value) ? `${value}px` : value;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function requestAnimationFrame(cb: Function) {
|
export function requestAnimationFrame(cb: () => void) {
|
||||||
const systemInfo = getSystemInfoSync();
|
const systemInfo = getSystemInfoSync();
|
||||||
|
|
||||||
if (systemInfo.platform === 'devtools') {
|
if (systemInfo.platform === 'devtools') {
|
||||||
return nextTick(cb);
|
return setTimeout(() => {
|
||||||
|
cb();
|
||||||
|
}, 1000 / 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
return wx
|
return wx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user