[Vuejs]-11:5 error 'router' is assigned a value but never used no-unused-vars

0👍

You made a router instance but never used it with Vue.
You must link both together by doing:

var router = new Router();
new Vue({
    router, // here we link the router instance to the Vue instance
    render: h => h(App),
}).$mount('#app')

As said here: https://router.vuejs.org/guide/#javascript

There error you see is because you created/declared a variable but never used it.

Leave a comment