其他分享
首页 > 其他分享> > ‘x‘ is assigned a value but never used no-unused-vars

‘x‘ is assigned a value but never used no-unused-vars

作者:互联网

报错:

97:21  error  'count' is assigned a value but never used  no-unused-vars

✖ 1 problem (1 error, 0 warnings)

发生原因:

发生这种情况是因为eslint的验证语法,您正在定义x但未使用它。

解决方法如下:

  1. 只需将其删除
  2. 在错误代码后加入该行注释就行:
// eslint-disable-line no-unused-vars

修改后为:

let count = 10000 // eslint-disable-line no-unused-vars
this.$nextTick(function() {
      console.log('DOM 更新了 ' )
})                

标签:assigned,used,vars,no,unused,eslint
来源: https://blog.csdn.net/xiaoyuer_2020/article/details/110429773