Skip to content
New issue

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

bui.config.map 新增无效 #221

Open
rexgo1 opened this issue Jul 30, 2017 · 0 comments
Open

bui.config.map 新增无效 #221

rexgo1 opened this issue Jul 30, 2017 · 0 comments

Comments

@rexgo1
Copy link

rexgo1 commented Jul 30, 2017

源码
function parseMap(uri) {
var map = data.map
var ret = uri

if (map) {
for (var i = 0, len = map.length; i < len; i++) {
var rule = map[i]

  ret = isFunction(rule) ?
      (rule(uri) || uri) :
      uri.replace(rule[0], rule[1])

  // Only apply the first matched rule
  if (ret !== uri) break
}

}

return ret
}
即使去除break语句,因为以上都是用uri来replace,即最后一条映射才有效,应该把uri.replace改为ret.replace,function和variable还没试,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant