The class attribute in the Vue framework
Working with the class attribute is done via the v-bind directive or its shortened form. Let's look at it in practice. Let the str property store CSS classes of the tag, separated by spaces:
data() {
return {
str: 'active valid',
}
}
Let's add these CSS classes to some tag:
<template>
<p :class="str">text</p>
</template>
Given a paragraph. Given a property cssClasses, in which some CSS classes are written. Add these classes to our paragraph.