📜  在 React 中连接变量和字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:56.583000             🧑  作者: Mango

代码示例1
href={"#demo" + this.state.id}

//You can also use ES6 string interpolation/template literals with 
//` (backticks) and ${expr} (interpolated expression),

href={`#demo${this.state.id}`}

source
https://stackoverflow.com/questions/39523040/concatenating-variables-and-strings-in-react