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
主要表现如下: 在状态配置里使用 /book/{id} 这种格式定义一个view, 然后用" /book/1" 访问是正常的,但是使用 "/book/0" 访问的话就会解析成"/book".
经过debug发现是mmRouter.js里的参数判断有问题:
urlFormate: function(url, params, query) { var query = query ? queryToString(query) : "", hash = url.replace(placeholder, function(mat) { var key = mat.replace(/[\{\}]/g, '').split(":") console.log(key); key = key[0] ? key[0] : key[1] //return params[key] || '' // 这个地方判断的时候param的值如果为 0或者false什么的,就会被过滤掉,改成下面一行就可以了 return params[key] !== undefined ? params[key] : '' }).replace(/^\//g, '') console.log("after url formate"); console.log("hash:" + hash); console.log("query:" + query); return { path: hash, query: query } },
The text was updated successfully, but these errors were encountered:
也发现了这个。。。例子里都是用没有就是0来兼容的。。。建议修复,我的项目后来改为了复杂参数规避了这个问题。
Sorry, something went wrong.
谢谢,已修
No branches or pull requests
主要表现如下:
在状态配置里使用 /book/{id} 这种格式定义一个view,
然后用" /book/1" 访问是正常的,但是使用 "/book/0" 访问的话就会解析成"/book".
经过debug发现是mmRouter.js里的参数判断有问题:
The text was updated successfully, but these errors were encountered: