diff --git a/src/platforms/h5/components/app/tabBar.vue b/src/platforms/h5/components/app/tabBar.vue index c18fbf59b3052f0c498c07101bcffe366708511f..e379ca7d86aeee9addefef7ad9b53a274d64bcc1 100644 --- a/src/platforms/h5/components/app/tabBar.vue +++ b/src/platforms/h5/components/app/tabBar.vue @@ -220,16 +220,20 @@ export default { if (url === __uniRoutes[0].alias) { url = '/' } - UniServiceJSBridge.emit('onTabItemTap', { + const detail = { index, text, pagePath - }) - if (this.$route.path !== url) { - this.__path__ = this.$route.path - uni.switchTab({ - url - }) + } + if (this.$route.path !== url) { + this.__path__ = this.$route.path + uni.switchTab({ + from: 'tabBar', + url, + detail + }) + } else { + UniServiceJSBridge.emit('onTabItemTap', detail) } } } diff --git a/yarn.lock b/yarn.lock index 0de15d910ce761ac3aa5d6908ec1923283d780af..43057fec4d604c6bc1228ebaa5730fae9f3c2077 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1457,6 +1457,10 @@ balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" +base64-arraybuffer@^0.2.0: + version "0.2.0" + resolved "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.2.0.tgz#4b944fac0191aa5907afe2d8c999ccc57ce80f45" + base64-js@^1.0.2: version "1.3.0" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3"