⊗jsvuPmStAC 37 of 72 menu

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.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline