Javatpoint Logo
Javatpoint Logo

Vue.js MCQ

1) Which of the following statement best define Vue.js?

  1. Vue.js is an open-source JavaScript library that is used for developing user interfaces.
  2. Vue.js is an open-source front-end JavaScript framework used for developing user interfaces.
  3. Vue.js is an open-source, cross-platform, JavaScript run-time situation that performs the JavaScript program outside a web browser.
  4. Vue.js is a JavaScript library constructed to facilitate HTML DOM tree traversal and administration, event handling, CSS activity, and Ajax.

Answer: B is the correct option. Vue.js is an open-source front-end JavaScript framework used for developing user interfaces.


2) Why is Vue.js called a progressive framework?

  1. Vue.js is called a progressive framework because it is being changed and developed continually.
  2. Vue.js is called a progressive framework because it facilitates us to create Dynamic User Interfaces and single-page applications.
  3. Vue.js is called a progressive framework because it follows the latest JavaScript standards.
  4. All of the above.

Answer: A is the correct option. Vue.js is called a progressive framework because it is being changed and developed continually.


3) What is the main usage of Vue.js?

  1. Vue.js is a dynamic JavaScript framework that is frequently used for developing user interfaces.
  2. Vue.js is a JavaScript library that makes user interfaces for single-page applications by dividing UI into components.
  3. Vue.js uses the MVVM pattern to bind data to certain DOM elements.
  4. All of the above.

Answer: A is the correct option. Vue.js is a dynamic JavaScript framework that is frequently used for developing user interfaces.


4) Which company invented Vue.js?

  1. Facebook
  2. Google
  3. Oracle
  4. Twitter

Answer: B is the correct option. Evan You is the founder/inventor of Vue.js. He was working at Google on several Angular projects when he founded Vue.js.


5) Which of the following data binding interpolation is also known as "Mustache" syntax?

  1. v-on
  2. v-model
  3. {{}}
  4. []

Answer: C is the correct option. The {{}} data binding interpolation is also known as "Mustache" syntax.


6) Which of the following is the correct way to install Vue.js in your project?

  1. We can install Vue.js by using CDN by including <script> tag in HTML file.
  2. We can install Vue.js by using Node Package Manager (NPM).
  3. You can install Vue.js using Bower.
  4. All of the above.

Answer: D is the correct option. All of the above are the correct ways to install Vue.js in your project.


7) Which of the following is the correct syntax to use for loop in Vue.js?

  1. vFor
  2. v-for
  3. *v-for
  4. None of the above.

Answer: B is the correct option. The "v-for" is the correct syntax to use for loop in Vue.js.


8) Which of the following syntax is correct for creating a Vue.js instance?

  1. var text = new object ({//options})
  2. var text = new class ({//options})
  3. var text = new text ({//options})
  4. var text = new Vue({// options })

Answer: D is the correct option. The correct syntax for creating instance is var text = new Vue({// options }).


9) Which of the following is the advantage of using Vue.js?

  1. Vue.js is very small in size.
  2. The documentation of Vue.js is very easy and comprehensive.
  3. Vue.js is flexible in nature.
  4. All of the above.

Answer: D is the correct option. All of the above are the advantages of using vue.js.


10) Which of the following modifier is very useful for improving the performance of mobile devices?

  1. .directive
  2. .once
  3. .capture
  4. .passive

Answer: D is the correct option. The ".passive" modifier is very useful for improving the performance of mobile devices.


11) Which of the following directive is used for two-way binding in Vue.js?

  1. v-on
  2. v-model
  3. no-one
  4. v-bind

Answer: B is the correct option. The v-model directive is used for two-way binding in Vue.js.


12) Which of the following directive is used for one-way data binding in Vue.js?

  1. v-on
  2. v-model
  3. no-one
  4. v-bind

Answer: D is the correct option. The v-bind directive is used for one-way data binding in Vue.js.


13) Which of the following statement is correct for components props in Vue.js?

  1. Props are used to pass down data to the child components.
  2. Props are custom attributes that you can register on a component.
  3. When a value is passed to a prop attribute, it becomes a property on that component instance.
  4. All of the above.

Answer: D is the correct option. All of the above statements are correct for components props in Vue.js.


14) How many ways are there to define a filter in Vue.js?

  1. 1
  2. 2
  3. 3
  4. 4

Answer: B is the correct option. There are two ways to define a filter in Vue.js


15) Which of the following is a core feature of Mixins in Vue.js?

  1. Mixins provide great flexibility.
  2. Mixin contains options for Vue.js components. You can use Mixins in Vue.js safely because they do not affect changes outside their defined scope.
  3. Mixins in Vue.js provide a great platform for code reusability.
  4. All of the above.

Answer: D is the correct option. All of the above are the features of Vue.js.


16) Which of the following is the correct full form of MVVM?

  1. Model-Value-Value Model
  2. Model-View-Value Model
  3. Model-View-View Model
  4. Module-View-View Model

Answer: C is the correct option. The correct full form of MVVM is Model-View-View Model.


17) What is VueX?

  1. VueX is a state management pattern and library for the Vue.js application.
  2. VueX is a command used in Vue.js.
  3. VueX is a component of Vue.js.
  4. None of the above.

Answer: A is the correct option. VueX is a state management pattern and library for the Vue.js application.


18) Which of the following method does not represent the non-mutation?

  1. Reverse() Method
  2. Concat() Method
  3. Slice() Method
  4. Filter() Method

Answer: A is the correct option. The Reverse() method does not represent the non-mutation.


19) What is the main usage of filters in Vue.js?

  1. Filters are used to enhance the presentation of the view layer.
  2. Filters are also reusable, and you can declare a filter globally and use it on any desirable component.
  3. Filters facilitate you to format your data at the view level.
  4. All of the above.

Answer: D is the correct option. All of the above is the usage of filters in Vue.js.


20) Which of the following keyword is used to create constant in Vue.js?

  1. Const
  2. Constant
  3. Define
  4. None of the above

Answer: A is the correct option. The const keyword is used to create a constant in Vue.js.


21) The Following code represents the registered component. How can you call the custom component in my template?

  1. v-bind:my-component
  2. <my-component></my-component>
  3. v-my-component
  4. @my-component

Answer: B is the correct option.


22) How many types of directives are available in Vue.js?

  1. 2
  2. 3
  3. 4
  4. 5

Answer: C is the correct option. There are four types of directives available in Vue.js.


23) Which of the following is the correct syntax to install Vue.js plug-in?

  1. install = function (Vue, options[]) {}
  2. install = function (Vue, options) {}
  3. install = function () {}
  4. None of the above.

Answer: B is the correct option.


24) Which of the following event modifier should we use to perform the click event only for the one time?

  1. <a @:click.passive="dotask"></a>
  2. <a @:click.once="dotask"></a>
  3. <a @:click.prevent-once="dotask"></a>
  4. <a @:click.prevent-once="dotask"></a>

Answer: B is the correct option.


Next Topic#





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA