-
Notifications
You must be signed in to change notification settings - Fork 0
/
style-class-array.html
46 lines (37 loc) · 1.08 KB
/
style-class-array.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Estilos com classes - Array</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<style>
.selected {
text-decoration: underline;
}
</style>
</head>
<body>
<div id="styles">
<table class="table">
<tr v-for="city in cities">
<!-- <td :class="[selectedClass, statusClass]">{{ city }}</td> -->
<td :class="[selectedClass, error ? statusErrorClass : statusClass]">{{ city }}</td>
</tr>
</table>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
let app = new Vue({
el: '#styles',
data: {
cities: ['Orlando', 'Londres', 'Sidney'],
selectedClass: 'selected',
statusClass: 'alert-success',
statusErrorClass: 'alert-danger',
error: false
}
})
</script>
</body>
</html>