瀏覽代碼

refactor(tabbar): 移除补丁文件并简化tabbar配置

移除不再需要的补丁文件和workspace配置,简化tabbar相关代码
将tabbar默认值从undefined改为空对象,避免控制台报错
feige996 8 月之前
父節點
當前提交
e4ea2face1
共有 6 個文件被更改,包括 1414 次插入1466 次删除
  1. 0 13
      patches/@dcloudio__uni-h5.patch
  2. 0 3
      patches/README.md
  3. 1412 1418
      pnpm-lock.yaml
  4. 0 6
      pnpm-workspace.yaml
  5. 1 25
      src/pages.json
  6. 1 1
      src/tabbar/config.ts

+ 0 - 13
patches/@dcloudio__uni-h5.patch

@@ -1,13 +0,0 @@
-diff --git a/dist/uni-h5.es.js b/dist/uni-h5.es.js
-index 7421bad97d94ad34a3d4d94292a9ee9071430662..19c6071ee4036ceb8d1cfa09030e471c002d2cda 100644
---- a/dist/uni-h5.es.js
-+++ b/dist/uni-h5.es.js
-@@ -23654,7 +23654,7 @@ function useShowTabBar(emit2) {
-   const tabBar2 = useTabBar();
-   const showTabBar2 = computed(() => route.meta.isTabBar && tabBar2.shown);
-   updateCssVar({
--    "--tab-bar-height": tabBar2.height
-+    "--tab-bar-height": tabBar2?.height || 0
-   });
-   return showTabBar2;
- }

+ 0 - 3
patches/README.md

@@ -1,3 +0,0 @@
-# 介绍
-
-这个文件是用来存放一些补丁的, `@dcloudio__uni-h5.patch` 用于修复 `无 tabbar` 时控制台报错导致运行失败的问题。(大部分项目都是 `有 tabbar` 的,用不到它。)

File diff suppressed because it is too large
+ 1412 - 1418
pnpm-lock.yaml


+ 0 - 6
pnpm-workspace.yaml

@@ -1,6 +0,0 @@
-packages:
-  - '**'
-  - '!node_modules'
-
-patchedDependencies:
-  '@dcloudio/uni-h5': patches/@dcloudio__uni-h5.patch

+ 1 - 25
src/pages.json

@@ -14,31 +14,7 @@
       "^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue"
     }
   },
-  "tabBar": {
-    "custom": true,
-    "color": "#999999",
-    "selectedColor": "#018d71",
-    "backgroundColor": "#F8F8F8",
-    "borderStyle": "black",
-    "height": "50px",
-    "fontSize": "10px",
-    "iconWidth": "24px",
-    "spacing": "3px",
-    "list": [
-      {
-        "text": "首页",
-        "pagePath": "pages/index/index"
-      },
-      {
-        "text": "关于",
-        "pagePath": "pages/about/about"
-      },
-      {
-        "text": "我的",
-        "pagePath": "pages/me/me"
-      }
-    ]
-  },
+  "tabBar": {},
   "pages": [
     {
       "path": "pages/index/index",

+ 1 - 1
src/tabbar/config.ts

@@ -153,4 +153,4 @@ const _tabbar: TabBar = {
 }
 
 // 0和1 需要显示底部的tabbar的各种配置,以利用缓存
-export const tabBar = tabbarCacheEnable ? _tabbar : undefined
+export const tabBar = tabbarCacheEnable ? _tabbar : {}