# Use Computed Properties for Complex Class Logic
## Rule
When class bindings involve multiple conditions or complex logic, extract them into computed properties rather than writing inline expressions in templates.
## Why This Matters
- Inline class expressions quickly become unreadable with multiple conditions
- Computed properties are cached and only re-evaluate when dependencies change
- Logic in computed properties is easier to test and debug
- Keeps templates focused on structure, not logic
## Bad Code
```vue
{{ label }}
{{ label }}
```
## Good Code
```vue
{{ label }}
```
## Style Bindings Too
The same principle applies to style bindings:
```vue
Styled text
```
## Combining Static and Dynamic Classes
Use array syntax to combine static classes with computed dynamic classes:
```vue
Content
```
## References
- [Class and Style Bindings](https://vuejs.org/guide/essentials/class-and-style.html)
- [Computed Properties](https://vuejs.org/guide/essentials/computed.html)