Quiz Space

Modern Application Development II · Quiz 1 · 7 Jul 2024 · May 2024 term

Question 16: Consider the following html. Assuming Vue CDN has been a…

Question 16

+4.5 marksOne correct option

Consider the following html.

html
<div id="app">
<parent-component :title="parentTitle">
<template slot="header">
<h2>{{ headerTitle }}</h2>
</template>
</parent-component>
</div>
<script>
Vue.component('parent-component', {
props: ['title'],
template: `
<div>
<h1>{{ title }}</h1>
<slot name="header"></slot>
<p>Main Content</p>
</div>
`
});
new Vue({
el: '#app',
data: {
parentTitle: 'Parent Component Title',
headerTitle: 'Header Content'
}
});
</script>

Assuming Vue CDN has been added to the HTML and the HTML format is correct. What would be the output on the screen?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

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

More questions from this paper

  1. Q1Figure question
  2. Q2What will be the output of the following code snippet?
  3. Q3Which of the following statements best describes the ephemeral state?
  4. Q4What is the difference between v-bind and v-model directives in Vue.js?
  5. Q5Figure question
  6. Q6Consider the below JavaScript program. What will be the output of the above program, if executed?
  7. Q7Consider the below JavaScript program. What will be the output when the code is executed?
  8. Q8Figure question
  9. Q9What is state management in the context of a web application?
  10. Q10Consider the following JavaScript program. What will be the output of the above program, if executed?
  11. Q11Consider the following html. Assuming vue cdn has been added to the html and the html format is correct. What would be …
  12. Q12Which of the following is/are correct definition(s) of an arrow function that accepts a number and returns its square?
  13. Q13Consider the following JavaScript code embedded in the body of the HTML document given below. If the document is render…
  14. Q14Consider the below JavaScript program. What will be the output of the above program, if executed?
  15. Q15Consider the following Vue application with markup index.html and JavaScript file app.js. File: index.html File: script…