Sample questions
Question 1Easy
How do you bind a checkbox to a boolean ok?
- <input type="checkbox" :ok>
- <input v-checked="ok">
- <input @check="ok">
- <input type="checkbox" v-model="ok">
Answer: D. <input type="checkbox" v-model="ok">
Explanation
v-model on a checkbox binds checked state to a boolean.
Step-by-step solution
- Use v-model.
- ok toggles.
Why the other options are wrong
- A. :ok would bind an attribute named ok and not the checked state; v-model is needed.
- B.
<input v-checked="ok"> is not a Vue directive; the correct choice is <input type="checkbox" v-model="ok">. - C. No such event.
Question 2Medium
What does @click="inc(5)" pass, compared with @click="inc"?
- The event and 5
- 5 instead of the MouseEvent
- Nothing
- The element
Answer: B. 5 instead of the MouseEvent
Explanation
An inline call replaces the implicit event argument unless you write inc(5, $event).
Step-by-step solution
- Inline call uses given args.
- Add $event to get the event.
Why the other options are wrong
- A. Use $event to pass both.
- C. 5 is passed.
- D. Not the element.
Question 3Medium
In a <select v-model="c">, what is c when <option value="in">India</option> is picked?
- "in"
- "India"
- 0
- true
Answer: A. "in"
Explanation
The option's value is used when present; otherwise its text.
Step-by-step solution
- Option has value.
- c gets 'in'.
Why the other options are wrong
- B. Text only if no value attribute.
- C. c holds the option's value attribute, not an index.
- D. c holds the option's value attribute, not a boolean.
Question 4Medium
Several checkboxes share v-model="picked" where picked is an array. What is stored?
- Values of the checked boxes
- Only the last one, because each checkbox overwrites the value of the previous one
- Booleans for each
- The count
Answer: A. Values of the checked boxes
Explanation
Vue pushes or removes each box's value from the array.
Step-by-step solution
- Initialize array.
- Checked boxes add values.
Why the other options are wrong
- B. Array collects all.
- C. Values, not booleans.
- D. The array holds the values of the checked boxes, not a count.
Question 5Medium
What does @keyup.enter="send" do?
- Calls send on every key
- Calls send only when Enter is released
- Calls send on page load
- Blocks Enter
Answer: B. Calls send only when Enter is released
Explanation
Key modifiers filter keyboard events by key.
Step-by-step solution
- Listen for keyup.
- Run only for Enter.
Why the other options are wrong
- A. Key modifier filters.
- C. Not on load.
- D. It listens.
Question 6Medium
What does @submit.prevent="save" accomplish?
- Disables the form element and its inputs until the handler has finished running
- Validates input
- Runs save without a full page reload
- Submits twice
Answer: C. Runs save without a full page reload
Explanation
.prevent calls preventDefault on the submit event.
Step-by-step solution
- Form submit event.
- Default reload is blocked.
Why the other options are wrong
- A. Does not disable.
- B. No validation is built in.
- D. Single call.
Question 7Hard
What is the Vue 3 equivalent of Vue 2's .sync modifier?
- :prop.async
- @sync
- v-bind.once
- v-model:propName
Answer: D. v-model:propName
Explanation
Argument form v-model:title replaces .sync.
Step-by-step solution
- Child emits update:title.
- Parent uses v-model:title.
Why the other options are wrong
- A. :prop.async is not Vue 3 syntax; v-model with an argument replaced .sync.
- B. @sync listens for an event named sync and does not replace the .sync modifier.
- C. v-bind has no .once modifier, and it is one-way anyway.
Practise all 7 questions free
The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.
Open this topic in the app →