Question 3
Consider the following application with markup index.html and script app.js.
index.html:
<body> <div id="app"> <router-view></router-view> </div></body>app.js:
const Header = { template: `<div>This is header <router-view /> </div>`,}const Error = { template: '<div> 404 Page not found</div>',}const Profile = { template: `<div> Welcome to profile page</div>`,}const routes = [ { path: '/', component: Header, children: [ { path: 'profile', component: Profile }, { path: '*', component: Error }, ], },]const router = new VueRouter({ routes,})new Vue({ el: '#app', router,})Suppose the application is running on http://127.0.0.1:8080. What will be rendered in the browser?
This is header
404 Page not found404 Page not found
This is headerWelcome to profile page
This is headerThis is header
Welcome to profile page