Closed choukin closed 8 years ago
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}
这个是怎么回事
找到原因了es6语法没学好,原来es6的字符串模板是用反单引号(tab键上面的按键)
let keyword = nextProps.keyword;
keyword 获取后为啥请求时q=${keyword}没有替换 发出的请求还是https://api.github.com/search/users?q=${keyword}
这个是怎么回事