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

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

上级 f4aa5576
...@@ -24,6 +24,8 @@ import { ...@@ -24,6 +24,8 @@ import {
navigate navigate
} from '../../framework/navigator' } from '../../framework/navigator'
let isNavigating = false
function _navigateTo ({ function _navigateTo ({
url, url,
path, path,
...@@ -46,6 +48,7 @@ function _navigateTo ({ ...@@ -46,6 +48,7 @@ function _navigateTo ({
animationType, animationType,
animationDuration, animationDuration,
() => { () => {
isNavigating = false
invoke(callbackId, { invoke(callbackId, {
errMsg: 'navigateTo:ok' errMsg: 'navigateTo:ok'
}) })
...@@ -60,6 +63,10 @@ export function navigateTo ({ ...@@ -60,6 +63,10 @@ export function navigateTo ({
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.
先完成此消息的编辑!
想要评论请 注册