safeArea.js 789 B

123456789101112131415161718192021222324252627282930
  1. import {
  2. defineStore
  3. } from 'pinia';
  4. /**
  5. * 安全区
  6. * statusBarHeight: 状态栏高度
  7. * capsuleBarHeight: 胶囊按钮高度
  8. * topHeight: 状态栏+胶囊按钮高度
  9. * bottomHeight: 底部安全区高度
  10. * capsuleBarHeight 胶囊按钮栏高度
  11. * capsuleBarLeft 胶囊按钮栏左边距离
  12. * capsuleBarMargin 胶囊按钮栏边距
  13. * capsuleBarMarginTop 胶囊按钮栏上边距
  14. * capsuleBarMarginBottom 胶囊按钮栏下边距
  15. * capsuleBarContentHeight 胶囊按钮内容高度
  16. */
  17. export const useSafeAreaStore = defineStore('safeArea', {
  18. state: () => ({
  19. statusBarHeight: 0,
  20. capsuleBarHeight: 0,
  21. topHeight: 0,
  22. bottomHeight: 0,
  23. capsuleBarLeft: 0,
  24. capsuleBarMargin: 0,
  25. capsuleBarMarginTop: 0,
  26. capsuleBarMarginBottom: 0,
  27. capsuleBarContentHeight: 0
  28. })
  29. });