收到意外的字符串连接错误,
我所有的功能都正常运行,但显示出意外的字符串连接错误
$this.find('.content > .component:gt(' + (limit - 1) + ')').hide();
我使用了以下内容,但功能不起作用,
$this.find(`.content > .component:${limit - 1}`).hide();
请您参考如下方法:
我们必须使用模板文字而不是字符串连接。
$this.find(`.content > .component:gt(' ${limit- 1} ')`).hide();
在函数中调用值时,应使用反引号“`”,并应使用('$ {}')
作为引用,请按照以下说明进行操作:
https://eslint.org/docs/rules/prefer-template




