我需要在我的sencha项目中使用路由。但我不明白为什么路由在最后会起作用,即使我在写其他路由之前也是如此。例如,
myFunction:function(){
console.info('hello ')
this.redirectTo('routingTest',true); //routes to hash 'routingTest'
console.info('world. ');
}
-----------
Output:
hello
world.
HI但是我想要的结果是
hello
HI
world.=============
以下是我的路线:
routes:{
'routingTest':{
action:'testing'
}
},
testing:function(){
console.log('HI')
}有什么办法可以解决这个问题吗?提前感谢
发布于 2016-11-01 14:47:32
我假设console.log正在写入标准输出,而console.info正在写入标准输出。
这些是不同的io流,很可能不会同步出现。
更新您的路由函数以改用console.info
发布于 2016-11-08 13:56:49
尝试删除redirectTo()的第二个参数,您已将其赋予true。
https://stackoverflow.com/questions/40355066
复制相似问题