**
eslint 中的驼峰名报错
**
直接上代码:
这是我的代码,大家看到问题了吗?
async showEditDialog(attr_id) {
// 查询当前参数的信息
const { data: res } = await this.$http.get(
`categories/${this.cateId}/attributes/${attr_id}`,
{
params: { attr_sel: this.activeName }
}
)
if (res.meta.status !== 200) {
return this.$message.error('获取失败!')
}
this.editForm = res.data
console.log(this.editForm)
this.editDialogVisible = true
},
因为参数没有用到驼峰命名,所以一直在报错,看一下我报的错:
我用了网上查到的:"camelcase": ["error", { "properties": "never" }]
,结果并没有卵用,后来查了驼峰命名》话不多说直接上代码:
async showEditDialog(attrId) {
// 查询当前参数的信息
const { data: res } = await this.$http.get(
`categories/${this.cateId}/attributes/${attrId}`,
{
params: { attr_sel: this.activeName }
}
)
if (res.meta.status !== 200) {
return this.$message.error('获取失败!')
}
this.editForm = res.data
console.log(this.editForm)
this.editDialogVisible = true
},
聪明的你,一定看到了吧!