Home > front end >  Beginners vue, why don't the routing effect
Beginners vue, why don't the routing effect

Time:10-10

<script>
Var UserParams={
The template: '& lt; Div> I am a user 1 & lt;/div> '
Created: the function () {
The console. The log (' come out! ');
}
}
Var UserQuery={
The template: '& lt; Div> I am a user 2 & lt;/div> '
}
Var router=new VueRouter ({
Routes: [
//routing matching rules
{
Path:/user/: "id",
Name: 'userP'
Component: UserParams
},
{
Path: "/user,"
Name: 'userQ'
Component: UserQuery
}
]
})
Var App={
The template: ` & lt; Div> `,
}
New Vue ({
El: "# app,"
Data () {
Return {
}
},
Components: {
App
},
//6 to vue instantiation management
The router,
The template: '& lt; App/& gt; '
})
</script>

CodePudding user response:

The document is solved

CodePudding user response:

You go to which component right write the name ah, otherwise how to jump the
  • Related