Answer the question
In order to leave comments, you need to log in
Vue-router without creating a separate instance?
What is the correct way to write router paths directly in vue app without using new VueRouter ?
new Vue({
el: "#app",
data: {},
router: router, //как вот тут правильно писать пути, без вынесения роутера за пределы
});
Answer the question
In order to leave comments, you need to log in
new Vue({
el: "#app",
data: {},
router: new VueRouter({
routes: [
// динамические сегменты начинаются с двоеточия
{ path: '/user/:id', component: User }
]
})
});
How to build a house without starting? )))
That's right, no way.
By creating a new VueRouter instance, the output is not just an object that can be stupidly copied.
The output is an object that has associated methods and properties, without which nothing will work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question