tabBar.js 930 B

123456789101112131415161718192021222324
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.initTabBar = void 0;
  4. const uni_shared_1 = require("@dcloudio/uni-shared");
  5. function initTabBar(entryPagePath, manifestJson, pagesJson) {
  6. if (!pagesJson.tabBar?.list?.length) {
  7. return;
  8. }
  9. const tabBar = JSON.parse(JSON.stringify(pagesJson.tabBar));
  10. tabBar.borderStyle = (0, uni_shared_1.normalizeTabBarStyles)(tabBar.borderStyle);
  11. if (!tabBar.selectedColor) {
  12. tabBar.selectedColor = uni_shared_1.SELECTED_COLOR;
  13. }
  14. tabBar.height = `${parseFloat(tabBar.height) || uni_shared_1.TABBAR_HEIGHT}px`;
  15. // 首页是 tabBar 页面
  16. const item = tabBar.list.find((page) => page.pagePath === entryPagePath);
  17. if (item) {
  18. ;
  19. tabBar.child = ['lauchwebview'];
  20. tabBar.selected = tabBar.list.indexOf(item);
  21. }
  22. manifestJson.plus.tabBar = tabBar;
  23. }
  24. exports.initTabBar = initTabBar;