diff --git a/src/platforms/h5/components/app/customTabBar.vue b/src/platforms/h5/components/app/customTabBar.vue new file mode 100644 index 0000000000000000000000000000000000000000..7d1e9715ac98993d63d8b1fa745e4d53e2cf71c8 --- /dev/null +++ b/src/platforms/h5/components/app/customTabBar.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/src/platforms/h5/components/app/index.vue b/src/platforms/h5/components/app/index.vue index 4fe64d306519f653f0c7989a4429b779f410eb00..375021c5573a1c9f08b1ab6c4f63f917b5974071 100644 --- a/src/platforms/h5/components/app/index.vue +++ b/src/platforms/h5/components/app/index.vue @@ -9,7 +9,7 @@ - -
+
-
-
-
- +
-
- {{ item.badge }} + {{ item.badge }}
-
{{ item.text }} -
- {{ item.badge }} +
+ {{ item.badge }}
@@ -53,125 +51,130 @@ + diff --git a/src/platforms/h5/components/index.js b/src/platforms/h5/components/index.js index 7e140eb6c12fde92f9cd698cb9257d3ca12818ea..59e8677adfb161e4fb6b7945f5f935e7e1bb7208 100644 --- a/src/platforms/h5/components/index.js +++ b/src/platforms/h5/components/index.js @@ -4,6 +4,7 @@ import App from './app' import Page from './page' import AsyncError from './async-error' import AsyncLoading from './async-loading' +import CustomTabBar from './app/customTabBar' import SystemRouteComponents from 'uni-h5-system-routes' @@ -11,6 +12,7 @@ Vue.component(App.name, App) Vue.component(Page.name, Page) Vue.component(AsyncError.name, AsyncError) Vue.component(AsyncLoading.name, AsyncLoading) +Vue.component(CustomTabBar.name, CustomTabBar) Object.keys(SystemRouteComponents).forEach(name => { const Component = SystemRouteComponents[name] diff --git a/src/platforms/h5/service/api/ui/tab-bar.js b/src/platforms/h5/service/api/ui/tab-bar.js index 671a430a60928c8fc2de72583c55f69d003a9dab..7118afd8ea238d80f95c41da2cb7d1d314b05e64 100644 --- a/src/platforms/h5/service/api/ui/tab-bar.js +++ b/src/platforms/h5/service/api/ui/tab-bar.js @@ -30,7 +30,7 @@ function setTabBar (type, args = {}) { const { index } = args - const tabBar = app.$children[0].tabBar + const tabBar = __uniConfig.tabBar if (index >= __uniConfig.tabBar.list.length) { return { errMsg: `${type}:fail tabbar item not found`