Skip to content

getPropVal 分隔符的问题 #8

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

Open
givingwu opened this issue Oct 20, 2020 · 0 comments
Open

getPropVal 分隔符的问题 #8

givingwu opened this issue Oct 20, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@givingwu
Copy link
Owner

如果 url 是 'a/b/c' 这种形式,但是后面有个函数是getPropVal:

const getPropVal = (obj, key) => {
  return key.split('.').reduce((o, k) => {
    return o[k]
  }, obj)
}

使用.来分割的 ,这里会分割不到值。

image

@givingwu givingwu added the bug Something isn't working label Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant