code style
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
<template>
|
||||
|
||||
<i v-if="props.sortable" :class="icon"></i>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "VtSortControl",
|
||||
props: ['props'],
|
||||
computed: {
|
||||
icon() {
|
||||
// if not sorted return base icon
|
||||
if (!this.props.sortStatus.sorted) return 'fas fa-sort';
|
||||
// return sort direction icon
|
||||
return this.props.sortStatus.asc ? 'fas fa-sort-amount-up' : 'fas fa-sort-amount-down';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
export default {
|
||||
name: "VtSortControl",
|
||||
props: ["props"],
|
||||
computed: {
|
||||
icon() {
|
||||
// if not sorted return base icon
|
||||
if (!this.props.sortStatus.sorted) return "fas fa-sort";
|
||||
// return sort direction icon
|
||||
return this.props.sortStatus.asc
|
||||
? "fas fa-sort-amount-up"
|
||||
: "fas fa-sort-amount-down";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user