Skip to content

Commit

Permalink
Docs(class-and-style): Coexist style with regular style
Browse files Browse the repository at this point in the history
  • Loading branch information
tisma95 committed Feb 20, 2025
1 parent 5515e22 commit 3b01576
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/guide/essentials/class-and-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,22 @@ computed: {
<div :class="classObject"></div>
```

Là encore, la liaison de style objet est souvent utilisée avec des propriétés calculées qui renvoient des objets.

Les directives `:style` peuvent également coexister avec des attributs de style ordinaires, tout comme `:class`.

Template:

```vue-html
<h1 style="color: red" :style="'font-size: 1em'">hello</h1>
```

Il rendra :

```vue-html
<h1 style="color: red; font-size: 1em;">hello</h1>
```

### Liaison par tableau {#binding-to-arrays-1}

Nous pouvons lier `:class` à un tableau pour appliquer une liste de classes :
Expand Down

0 comments on commit 3b01576

Please sign in to comment.