0 votes
in VueJS by

Frequently Asked Vue JS Efficacy Multiple Choice Questions and Answers on:

  • vue js tutorial
  • vue js vs react
  • vue js w3schools
  • vue js interview questions
  • vue.js examples
  • vue js vs angular
  • vue js 3
  • vue js documentation

1 Answer

0 votes
by

Question:-1 How to initialize the root instance in Vue JS (using the CDN method)?

a) var app = Vue new({…});

b) var app = Vue.new({…});

c) var app = Vue({…});

d) var app = new Vue({…});

Answer:-  var app = new Vue({…});

Question:-2 The following attributes can be used for conditional rendering, except __________.

a) v-show

b) v-ifelse

c) v-else

d) v-if

Answer:-  v-ifelse

Question:-3 Which is the simplest way to perform attribute binding?

a) <span :title:=”vue_var”>Some text</span>

b) <span title=”vue_var”>Some text</span>

c) <span title:=”vue_var”>Some text</span>

d) <span :title=”vue_var”>Some text</span>

Answer:-  <span :title=”vue_var”>Some text</span>

Question:-4 What is the shorthand way to invoke a function when a click event is fired?

a) #click

b) $click

c) @click

d) %click

Answer:-  @click

Question:-5 Vue CLI can be installed using _________.

a) npm install -g vuecli

b) npm install -g vue-cli

c) npm install -g @vue/cli

d) npm install -g vue

Answer:-  npm install -g @vue/cli

Question:-6 Which among the following is/are cached in the browser?

a) Computed method

b) Normal method

c) Both computed and normal methods

d) None of the options

Answer:-  Computed method

Question:-7 Communicating events allow data communication in which of the following ways?

a) From root instance to the component

b) From component to the root instance

c) Both the options

Answer:-  Both the options

Question:-8 Vue JS provides different attributes and directives for the Tab display of a web page.

a) True

b) False

Answer:-  False

Question:-9 There can be more than one root element in the template of a component.

a) True

b) False

Answer:-  False

Question:-10 Vue JS provides the feature to validate and display validation error messages.

a) True

b) False

Answer:-  True

Question:-11 Vue JS allows changing the font size of a text dynamically.

a) True

b) False

Answer:-  True

Question:-12 Which concept of Vue JS helps to modularize code?

a) Components

b) Tabs

c) Event handling

d) Forms

Answer:-  Components

Question:-13

<p v-if=”counterVar % 2 == 0″> Value is even </p>

<p v-else> Value is odd </p>

<button v-on:click=”___________________”>Click Me!</button>

Assuming that counterVar variable has been initialized to 0, what must be filled in the click event handling mechanism?

a) Both the options

b) None of the options

c) counterVar++

d) counterVar + 1

Answer:-  counterVar + 1

Question:-14 To pass the variable value from component to root instance, which method is employed in a Vue JS application?

a) Attribute binding

b) Event handling

c) Forms

d) Communicating Events

Answer:-  Communicating Events

Question:-15 How many sections does a component have?

a) 1

b) 2

c) 3

d) 4

Answer:-  1

Question:-16 Which is the attribute in component to define variables?

a) Data

b) Props

c) Template

d) Computed

Answer:-  Data

Question:-17 Which attribute in JavaScript/Vue JS is used to pass a variable value from parent component to child component?

a) Methods

b) Props

c) Computed

d) Template

Answer:-  Computed

Question:-18 Which Vue attribute is used to display an HTML element based on a condition?

a) Both the options

b) v-if

c) v-show

d) None of the options

Answer:-  v-show

Question:-19 What is the syntax to invoke the method handleUserClick when the user clicks a button?

a) <button v-on:click=”handleUserClick”>Click Me!</button>

b) <button :click=”handleUserClick”>Click Me!</button>

c) Both the options

d) None of the options

Answer:-  <button v-on:click=”handleUserClick”>Click Me!</button>

Question:-20 What is the syntax to bind a Vue variable domTitle with an attribute?

a) <span v-bind:title=”domTitle”></span>

b) <span :title=”domTitle”></span>

c) None of the options

d) Both the options

Answer:-  <span v-bind:title=”domTitle”></span>

Question:-21 An array of objects can be iterated using v-for.

a) True

b) False

Answer:-  True

Question:-22

<course-section @get-marks=”getMarks”></course-section>

var marks = 100;

this.$emit(___________________);

The developer needs to pass the value of marks to its parent component. Fill in the blank with the correct answer.

a) { event: ‘get-marks’, parameters: [marks] }

b) marks, ‘get-marks’

c) ’getMarks’, marks

d) ‘get-marks’, marks

Answer:-  ‘get-marks’, marks

Question:-23 A developer must not only know HTML and CSS but should also know JavaScript to develop front-end applications using Vue JS. Do you agree?

a) Yes

b) No

Answer:-  Yes

Question:-24 A component in Vue JS can have multiple components within it.

a) True

b) False

Answer:-  True

Question:-25 Vue JS can also be used to develop controller code.

a) True

b) False

Answer:-  True

Question:-26 Changes in the Vue variable reflects in the HTML element attributes. This concept is known as ________.

a) Element binding

b) Attribute binding

c) Variable binding

d) HTML binding

Answer:-  Variable binding

Question:-27

<form @submit.prevent=”validateSubmit”>…</form>

What does @submit.prevent do?

a) Invokes the validateSubmit method before the usual submit action is executed.

b) Irrespective of the method definition in validateSubmit, default submit action will be executed.

Answer:-  Invokes the validateSubmit method before the usual submit action is executed.

Question:-28 Which of the following statements is true?

a) Vue JS provides a mechanism to display an HTML element based on a Boolean condition.

b) Displaying an HTML element based on a Boolean condition is not possible in Vue JS.

Answer:-  Vue JS provides a mechanism to display an HTML element based on a Boolean condition.

Question:-29

<p v-if=”counterVar % 2 == 0″> Value is even </p>

<p v-else> Value is odd </p>

<button v-on:click=”___________________”>Click Me!</button> Assuming that counterVar variable has been initialized to 0, what must be filled in the click event handling mechanism?

a) counterVar + 1

b) counterVar++

c) Both the options

d) None of the options

Answer:-  Both the options

Learn more Vue.JS Interview Questions and Answers here

...