提交 584ba462 编写于 作者: 雪洛's avatar 雪洛

fix: 修复多次navigateTo会重复跳转的Bug

上级 f4aa5576
...@@ -23,6 +23,8 @@ import { ...@@ -23,6 +23,8 @@ import {
import { import {
navigate navigate
} from '../../framework/navigator' } from '../../framework/navigator'
let isNavigating = false
function _navigateTo ({ function _navigateTo ({
url, url,
...@@ -45,7 +47,8 @@ function _navigateTo ({ ...@@ -45,7 +47,8 @@ function _navigateTo ({
}), }),
animationType, animationType,
animationDuration, animationDuration,
() => { () => {
isNavigating = false
invoke(callbackId, { invoke(callbackId, {
errMsg: 'navigateTo:ok' errMsg: 'navigateTo:ok'
}) })
...@@ -59,7 +62,11 @@ export function navigateTo ({ ...@@ -59,7 +62,11 @@ export function navigateTo ({
openType, openType,
animationType, animationType,
animationDuration animationDuration
}, callbackId) { }, callbackId) {
if(isNavigating) {
return
}
isNavigating = true
const urls = url.split('?') const urls = url.split('?')
const path = urls[0] const path = urls[0]
const routeStyles = __uniRoutes.find(route => route.path === path).window const routeStyles = __uniRoutes.find(route => route.path === path).window
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册