diff --git a/src/core/view/components/swiper/index.vue b/src/core/view/components/swiper/index.vue index e5ec90db115f6a85c7bb5924b3ef8a727225e85a..e8b16d0f4abcd8cb5e582f1aca026db520c178d1 100644 --- a/src/core/view/components/swiper/index.vue +++ b/src/core/view/components/swiper/index.vue @@ -487,7 +487,6 @@ export default { } }, _handleTrackStart () { - if (!this.items.length) return this._cancelSchedule() this._contentTrackViewport = this._viewportPosition this._contentTrackSpeed = 0 @@ -495,7 +494,6 @@ export default { this._cancelViewportAnimation() }, _handleTrackMove (data) { - if (!this.items.length) return var self = this var contentTrackT = this._contentTrackT this._contentTrackT = Date.now() @@ -530,7 +528,6 @@ export default { } }, _handleTrackEnd (isCancel) { - if (!this.items.length) return this.userTracking = false var t = this._contentTrackSpeed / Math.abs(this._contentTrackSpeed) var n = 0 @@ -547,7 +544,7 @@ export default { } }, _handleContentTrack (e) { - if (this.disableTouch) { + if (this.disableTouch || !this.items.length) { return } if (!this._invalid) { diff --git a/src/platforms/app-plus/service/api/ui/tab-bar.js b/src/platforms/app-plus/service/api/ui/tab-bar.js index c5510fba15d45b4d131eba4f7d9b587b545e13ae..3fdc0dd860686e990b6c21bfe72ffba0bbc18a6a 100644 --- a/src/platforms/app-plus/service/api/ui/tab-bar.js +++ b/src/platforms/app-plus/service/api/ui/tab-bar.js @@ -23,6 +23,11 @@ export function setTabBarItem ({ pagePath, visible }) { + if (!isTabBarPage()) { + return { + errMsg: 'setTabBarItem:fail not TabBar page' + } + } tabBar.setTabBarItem(index, text, iconPath, selectedIconPath, visible) const route = pagePath && __uniRoutes.find(({ path }) => path === pagePath) if (route) {