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

keyword 获取后为啥请求时q=${keyword}没有替换 #3

Closed
choukin opened this issue Jul 12, 2016 · 1 comment
Closed

keyword 获取后为啥请求时q=${keyword}没有替换 #3

choukin opened this issue Jul 12, 2016 · 1 comment

Comments

@choukin
Copy link

choukin commented Jul 12, 2016

let keyword = nextProps.keyword;

    this.setState({"loading":true,"firstView":false});
    let url = 'https://api.github.com/search/users?q=${keyword}';

keyword 获取后为啥请求时q=${keyword}没有替换
发出的请求还是https://api.github.com/search/users?q=${keyword}

这个是怎么回事

@choukin
Copy link
Author

choukin commented Jul 13, 2016

找到原因了es6语法没学好,原来es6的字符串模板是用反单引号(tab键上面的按键)

@choukin choukin closed this as completed Jul 13, 2016
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