【发布时间】:2021-08-26 04:17:04
【问题描述】:
<Card className='my-3 p-3 rounded'>
<a href={'/product/${product._id}'}>
<Card.Img src={product.image} variant='top' />
</a>
</Card>
我在这里发布我的代码我在运行 npm start 时遇到错误 意外的模板字符串表达式 no-template-curly-in-string
【问题讨论】:
-
您是否出于某种原因运行 ESLint?这听起来像是 ESLint 错误。 eslint.org/docs/rules/no-template-curly-in-string 如果是这样,请尝试将
href值更改为使用反引号`而不是单引号。
标签: javascript html visual-studio-code vscode-settings react-bootstrap-typeahead