page.js 339B

12345678
  1. // 这个值先取, 不能动态
  2. // 因为移动端出现输入法的时候会变
  3. const height = document.documentElement.clientHeight || document.body.clientHeight;
  4. export function getPageStyle(fitHeight) {
  5. return fitHeight > height ? { height: `${fitHeight}px`, overflow: 'hidden' } : { height: `${height}px`, overflow: 'hidden' }
  6. }