What is wrong if none of the paragraphs show even when isActive and isPending are both false?
medium
A. The variables isActive and isPending must be true to render anything.
B. Nothing is wrong; the last v-else should show 'Inactive'.
C. You cannot use v-else-if after v-if.
D. The v-else is missing a condition and causes error.
Solution
Step 1: Review v-if, v-else-if, and v-else logic
Vue renders the first true condition block; if none are true, v-else runs.
Step 2: Check variables false case
Both isActive and isPending false means v-else block should show 'Inactive'.
Final Answer:
Nothing is wrong; the last v-else should show 'Inactive'. -> Option B
Quick Check:
v-else runs if all previous conditions false [OK]
Hint: v-else shows when all prior conditions are false [OK]
Common Mistakes:
Thinking v-else needs a condition
Believing v-else-if is invalid after v-if
Assuming no output if all conditions false
5. You want to display a list of users but only show those who are active. Which Vue template snippet correctly uses conditional rendering inside a v-for loop to achieve this?
hard
A.
<ul>
<li v-for="user in users">{{ user.name }}</li>
</ul>