Newer
Older
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
<template>
<div class="d-inline-block position-absolute ml-2">
<div
class="up"
:class="{
sorted: currentSortDir == 'desc' && currentSort == fieldName,
invisible: currentSortDir == 'asc' && currentSort == fieldName
}">
▲
</div>
<div
class="down"
:class="{
sorted: currentSortDir == 'asc' && currentSort == fieldName,
invisible: currentSortDir == 'desc' && currentSort == fieldName
}">
▼
</div>
</div>
</template>
<script>
export default {
props: {
fieldName: {
type: String,
required: true
},
currentSort: {
type: String,
required: true
},
currentSortDir: {
type: String,
required: true,
validator: function (value) {
return ["asc", "desc"].indexOf(value) !== -1
}
}
},
created() {
console.log("created")
}
}
</script>