提交 29fe376f 编写于 作者: D DCloud_LXH

chore: swiper、tab-bar

上级 18ec9048
...@@ -487,7 +487,6 @@ export default { ...@@ -487,7 +487,6 @@ export default {
} }
}, },
_handleTrackStart () { _handleTrackStart () {
if (!this.items.length) return
this._cancelSchedule() this._cancelSchedule()
this._contentTrackViewport = this._viewportPosition this._contentTrackViewport = this._viewportPosition
this._contentTrackSpeed = 0 this._contentTrackSpeed = 0
...@@ -495,7 +494,6 @@ export default { ...@@ -495,7 +494,6 @@ export default {
this._cancelViewportAnimation() this._cancelViewportAnimation()
}, },
_handleTrackMove (data) { _handleTrackMove (data) {
if (!this.items.length) return
var self = this var self = this
var contentTrackT = this._contentTrackT var contentTrackT = this._contentTrackT
this._contentTrackT = Date.now() this._contentTrackT = Date.now()
...@@ -530,7 +528,6 @@ export default { ...@@ -530,7 +528,6 @@ export default {
} }
}, },
_handleTrackEnd (isCancel) { _handleTrackEnd (isCancel) {
if (!this.items.length) return
this.userTracking = false this.userTracking = false
var t = this._contentTrackSpeed / Math.abs(this._contentTrackSpeed) var t = this._contentTrackSpeed / Math.abs(this._contentTrackSpeed)
var n = 0 var n = 0
...@@ -547,7 +544,7 @@ export default { ...@@ -547,7 +544,7 @@ export default {
} }
}, },
_handleContentTrack (e) { _handleContentTrack (e) {
if (this.disableTouch) { if (this.disableTouch || !this.items.length) {
return return
} }
if (!this._invalid) { if (!this._invalid) {
......
...@@ -23,6 +23,11 @@ export function setTabBarItem ({ ...@@ -23,6 +23,11 @@ export function setTabBarItem ({
pagePath, pagePath,
visible visible
}) { }) {
if (!isTabBarPage()) {
return {
errMsg: 'setTabBarItem:fail not TabBar page'
}
}
tabBar.setTabBarItem(index, text, iconPath, selectedIconPath, visible) tabBar.setTabBarItem(index, text, iconPath, selectedIconPath, visible)
const route = pagePath && __uniRoutes.find(({ path }) => path === pagePath) const route = pagePath && __uniRoutes.find(({ path }) => path === pagePath)
if (route) { if (route) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册