vikingmute / webpack-react-kit

a simple webpack react starter kit
56 stars 26 forks source link

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

Closed choukin closed 8 years ago

choukin commented 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}

这个是怎么回事

choukin commented 8 years ago

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