Skip to content

Commit 40b91df

Browse files
authored
Merge pull request #121 from codeforIATI/fix-multiple-categories
Fix multiple categories
2 parents a572004 + f76135a commit 40b91df

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

static/.vuepress/components/CodelistPage.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,16 @@
9191
</template>
9292

9393
<template v-slot:cell(category)="data" v-if="categoryCodelist">
94-
<router-link :to="'../' + categoryCodelist + '/#' + data.item.category">{{ data.item.category }}</router-link>
94+
<template v-if="data.item.category!= null">
95+
<span
96+
class="category-item"
97+
v-for="category in data.item.category.split(';').sort()"
98+
:key="category">
99+
<router-link
100+
:to="'../' + categoryCodelist + '/#' + category"
101+
>{{ category }}</router-link>
102+
</span>
103+
</template>
95104
</template>
96105
</b-table>
97106
<b-form-group
@@ -130,6 +139,13 @@
130139
table {
131140
display: table;
132141
}
142+
.category-item:after {
143+
content: "; ";
144+
color: #888;
145+
}
146+
.category-item:last-child:after {
147+
content: ""
148+
}
133149
</style>
134150
<script>
135151
import axios from 'axios'

0 commit comments

Comments
 (0)