Answer the question
In order to leave comments, you need to log in
Vue + TypeScript $route is undefined?
I tried different things, I'm missing something, some kind of config or something else
import VueRouter from 'vue-router';
import Home from '@/components/public/pages/home/index.vue';
export default new VueRouter({
mode: 'history',
routes: [
{path: '/', name: 'home', component: Home},
],
linkActiveClass: 'active',
});
Answer the question
In order to leave comments, you need to log in
Not sure, but most likely you didn't add router to vue itself.
https://www.github.com/bubaley/django-vue-start/tr...
Look in this project, there is almost an empty vue cli project.
Notice how it is added in the main.js file.
The router itself is in the router folder.
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL, (remove this line)
routes
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question