gpt4 book ai didi

javascript - Vue.js 中意外的模板字符串表达式

转载 作者:可可西里 更新时间:2023-11-01 02:33:06 29 4
gpt4 key购买 nike

每次我像这样编写 ${row.name} 代码时,都会收到此错误“eslint.org/docs/rules/no-template-curly-in-string Unexpected template string expression”。

有什么帮助吗?

enter image description here

最佳答案

ES6 模板字符串应该与反引号一起使用,而不是单引号。替换这个:

'delete the item ${row.name}'

有了这个:

`delete the item ${row.name}`

这里是评论中要求的 ESLint 示例:http://eslint.org/docs/rules/no-template-curly-in-string#examples

关于javascript - Vue.js 中意外的模板字符串表达式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41093825/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com