WEBTECH QUIZES\ Flashcards
What is the difference between v-show and v-if directives?
v-show renders an element to the DOM and then uses the CSS display property to show/hide elements based on expression
What is the difference between computed properties and methods?
Computed properties will cache the result
Which of the following is NOT a vue life cycle state?
afterCreated
Assume items is an array defined in the data option of a Vue instance, in Vue 2, which of the following operations on this array cannot be detected by Vue?
items[2] = newValue
Which of the following has error?
<img></img>
In Vue 3, which of the following is not an option (properties we used in Vue’s constructor) used to create a Vue instance?
el
Which part of the code corresponds to the first “V” in MVVM?
HTMLs in div with id=”app”
Which directive provides two-way data binding?
v-model
How does Vue.js change the CSS class of a div?
Using v-bind
Think about Vue’s life cycle, when does Vue get ready (In other words, Vue becomes reactive and can help you bind data to html
mounted
Which of the following is NOT an option in a Vue component?
slots
How to register component A inside another one, say component B?
Using component B’s option “components
How does a parent component pass data to its child component?
using props defined in the child component
What is a slot in Vue.js?
It is used to pass content from parent to child component
When do you need to use named slots?
When a child component needs to receive multple contents from its parent component