Question 15
Consider the below Vue class bindings:
Code 1:
<div :class="[isActive ? 'activeClass' : '', 'errorClass']"></div>Code 2:
<div :class="[{ 'activeClass': isActive }, 'errorClass']"></div>Which of the following statement(s) is/are true?
Both the code snippets will render the same HTML.
Both the code snippets will render the different HTML.
The code snippet 2 will always render the element div with class “activeClass”, and “errorClass” will only be applied, if the data variable “isActive” is truthy.
The code snippet 1 will always render the element div with class “errorClass”, and “activeClass” will only be applied”, if the data variable “isActive” is truthy.