[Vuejs]-What is the use to define :class as an array and not as an object in Vue?

0👍

Array is a type of Object that lends itself better to some uses. For example, you can run functions like map and filter on arrays much easier (instead of converting an object to a set of keys or values). In some cases, you may be using such functions to compose a set of classes to assign, and in other cases, you may have a class name you might want to assign based on the object value. Luckily Vue allows both.

Leave a comment