Closed
Description
I would like to propose rule for checking if method beforeRouteEnter
uses this
in her body. Error Cannot read property 'someMethod' of undefined
can be very dangerous especially when only 1 method has no access to this
.
[ ] Enforces code style (layout)
[X ] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
<script>
export default {
beforeRouteEnter(to, from, next) {
this.someMethod();
},
</script>
Additional context
docs: https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards
Metadata
Metadata
Assignees
Labels
No labels