[Vuejs]-Vue-router with webpack, can't access $route

0👍

Do not use arrow functions on your components. They have to be bound to the component’s context.

Instead, use proper methods:

export default {
    methods: {
        test () {
            var test = this.$route;

            console.dir(test);
        },
    },
    created () {
        console.log(this.$route);
    },
};

Leave a comment