Quiz Space

Modern Application Development II · Quiz 2 · 4 Aug 2024 · May 2024 term

Question 3: Consider the following application with markup index.html…

Question 3

+3 marksOne correct option

Consider the following application with markup index.html and script app.js.

index.html:

html
<body>
<div id="app">
<router-view></router-view>
</div>
</body>

app.js:

javascript
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?

  1. A

    This is header
    404 Page not found

  2. B

    404 Page not found
    This is header

  3. C

    Welcome to profile page
    This is header

  4. D

    This is header
    Welcome to profile page

Show answer

Correct answer

  • A

    This is header
    404 Page not found

Question 3 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 4 Aug 2024, in the May 2024 term (IIT M DIPLOMA AN EXAM QDD2 4 Aug 2024). It carries 3 marks.

More questions from this paper

  1. Q1Consider the below JavaScript program. What will be the output of the above program, if executed?
  2. Q2Consider the following Vue application with markup “index.html” and JavaScript file “app.js”. index.html: app.js: Suppo…
  3. Q4Consider the below JavaScript program. What will be the output of the above program?
  4. Q5Consider the following Vue application with markup “index.html” and JavaScript file “app.js”. index.html: app.js: Suppo…
  5. Q6Consider the below JavaScript program, and predict the output, if executed.
  6. Q7Consider the following Vue application with markup index.html and JavaScript file app.js. File: index.html File: script…
  7. Q8Consider the following JavaScript code. What will be the output of the above code snippet on the console of the browser?
  8. Q9Consider the following HTML snippet that uses Vue 2 using CDN in the script.js file Filename: index.html Filename: scri…
  9. Q10Suppose you are organizing a felicitation program for the students with exemplary performance in the BS program. You ha…
  10. Q11Figure question
  11. Q12Which of the following statement(s) is/are incorrect regarding Vuex?
  12. Q13Consider the following HTML, with Vue 2 CDN attached to it. Filename: index.html Filename: script.js What will be logge…
  13. Q14Analyze the given HTML with embedded script. What will be the final state of HTML elements, after all the setTimeout() …
  14. Q15Consider the following HTML document embedded with Vue CDN and the script file shown below. Filename: index.html Filena…
  15. Q16Consider the below Vue component template and script definitions that use Vue router. Vue component template Filename: …