Skip to content

Commit 00cd837

Browse files
committed
revise VTag and VMediaTags
1 parent afbd407 commit 00cd837

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,45 @@
11
<template>
22
<ul v-if="tags.length" class="flex flex-wrap gap-2">
3+
<div v-if="additionalSearchViews">
4+
<VTag
5+
v-for="(tag, index) in tags"
6+
:key="index"
7+
href="/"
8+
:title="tag.name"
9+
/>
10+
</div>
311
<VMediaTag v-for="(tag, index) in tags" :key="index" tag="li">{{
412
tag.name
513
}}</VMediaTag>
614
</ul>
715
</template>
816
<script lang="ts">
9-
import { defineComponent, PropType } from "vue"
17+
import { computed, defineComponent, PropType } from "vue"
1018
1119
import type { Tag } from "~/types/media"
20+
import { useFeatureFlagStore } from "~/stores/feature-flag"
1221
1322
import VMediaTag from "~/components/VMediaTag/VMediaTag.vue"
1423
24+
import VTag from "~/components/VTag/VTag.vue"
25+
1526
export default defineComponent({
1627
name: "VMediaTags",
17-
components: { VMediaTag },
28+
components: { VMediaTag, VTag },
1829
props: {
1930
tags: {
2031
type: Array as PropType<Tag[]>,
2132
required: true,
2233
},
2334
},
35+
setup() {
36+
const featureFlagStore = useFeatureFlagStore()
37+
38+
const additionalSearchViews = computed(() =>
39+
featureFlagStore.isOn("additional_search_views")
40+
)
41+
42+
return { additionalSearchViews }
43+
},
2444
})
2545
</script>

frontend/src/components/VTag/VTag.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,22 @@
1010
</template>
1111

1212
<script lang="ts">
13-
import { defineComponent } from "@nuxtjs/composition-api"
13+
import { defineComponent } from "vue"
1414
1515
import VButton from "~/components/VButton.vue"
1616
1717
export default defineComponent({
1818
name: "VTag",
1919
components: { VButton },
2020
props: {
21-
title: { type: String },
21+
title: {
22+
type: String,
23+
required: true,
24+
},
2225
href: {
2326
type: String,
2427
required: true,
2528
},
2629
},
2730
})
2831
</script>
29-
30-
<style scoped></style>

0 commit comments

Comments
 (0)