We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
文档是这样说的:
{Function} opts.onEnter 进入状态触发,可以返回false,或任意不为true的错误信息或一个promise对象,用法跟视图的$onEnter一致 {Function} onEnter.params 视图所属的state的参数 {Function} onEnter.resolve $onEnter return false的时候,进入同步等待,直到手动调用resolve {Function} onEnter.reject 数据加载失败,调用
使用时,
onEnter: function(rs ,rj){ console.log(arguments) setTimeout(function(){ rs(true) },300) return false }
遇到的问题是: 当路由上有参数时, arguments[0]为参数对象; 当没有参数时,arguments[0]为resolve函数;
假如我的onEnter是一个公用的,我就不得不判断一下当前的arguments,因为它可能会变!
建议:将onEnter的路由参数放到 resolve, reject函数的后面,因为这两个是必须的。
The text was updated successfully, but these errors were encountered:
这个是为了兼容之前的参数设计
Sorry, something went wrong.
No branches or pull requests
文档是这样说的:
使用时,
遇到的问题是:
当路由上有参数时, arguments[0]为参数对象;
当没有参数时,arguments[0]为resolve函数;
假如我的onEnter是一个公用的,我就不得不判断一下当前的arguments,因为它可能会变!
建议:将onEnter的路由参数放到 resolve, reject函数的后面,因为这两个是必须的。
The text was updated successfully, but these errors were encountered: