This rule prevents to use duplicated names.
This rule is aimed at preventing duplicated property names.
👎 Examples of incorrect code for this rule:
export default {
props: {
foo: String
},
computed: {
foo: {
get () {
}
}
},
data: {
foo: null
},
methods: {
foo () {
}
}
}
👍 Examples of correct code for this rule:
export default {
props: ['foo'],
computed: {
bar () {
}
},
data () {
return {
dat: null
}
},
methods: {
test () {
}
}
}
This rule has an object option:
"groups"
: [] (default) array of additional groups to search for duplicates.
vue/no-dupe-keys: [2, {
groups: ['asyncComputed']
}]
👎 Examples of incorrect code for this configuration
export default {
computed: {
foo () {}
},
asyncComputed: {
foo () {}
}
}