// ✗ bad
const elem = this.$el;
const element = e.target;
const input = this.$refs.input
// ✓ good
const el = this.$el;
const el = e.target;
const inputEl = this.$refs.input;
// ✗ bad
const instance = this;
const form = this.$refs.form;
this.$emit('select', {
item,
});
// ✓ good
const vm = this;
const formVM = this.$refs.form;
this.$emit('select', {
item,
itemVM: selectedVM,
});
// ✗ bad
{
methods: {
input() {
// ...
},
handleValidate() {
// ...
},
},
}
// ✓ good
{
methods: {
onInput() {
// ...
},
onValidate() {
// ...
},
},
}
// ✗ bad
<slot name="head">
<div :class="$style.head">
<slot name="title">
<div :class="$style.title">
{{ title }}
</div>
</slot>
<div :class="$style.close"></div>
</div>
</slot>
// ✓ good
<div :class="$style.head">
<slot name="head">
<div :class="$style.title">
<slot name="title">{{ title }}</slot>
</div>
<div :class="$style.close"></div>
</slot>
</div>