File tree Expand file tree Collapse file tree 3 files changed +102
-3
lines changed Expand file tree Collapse file tree 3 files changed +102
-3
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <ul v-if =" tags.length" class =" flex flex-wrap gap-2" >
2
+ <ul v-if =" tags.length && additionalSearchViews" class =" flex flex-wrap gap-2" >
3
+ <VTag
4
+ v-for =" (tag, index) in tags"
5
+ :key =" index"
6
+ href =" /"
7
+ :title =" tag.name"
8
+ />
9
+ </ul >
10
+ <ul v-else >
3
11
<VMediaTag v-for =" (tag, index) in tags" :key =" index" tag =" li" >{{
4
12
tag.name
5
13
}}</VMediaTag >
6
14
</ul >
7
15
</template >
8
16
<script lang="ts">
9
- import { defineComponent , PropType } from " vue"
17
+ import { computed , defineComponent , PropType } from " vue"
10
18
11
19
import type { Tag } from " ~/types/media"
20
+ import { useFeatureFlagStore } from " ~/stores/feature-flag"
12
21
13
22
import VMediaTag from " ~/components/VMediaTag/VMediaTag.vue"
14
23
24
+ import VTag from " ~/components/VTag/VTag.vue"
25
+
15
26
export default defineComponent ({
16
27
name: " VMediaTags" ,
17
- components: { VMediaTag },
28
+ components: { VMediaTag , VTag },
18
29
props: {
19
30
tags: {
20
31
type: Array as PropType <Tag []>,
21
32
required: true ,
22
33
},
23
34
},
35
+ setup() {
36
+ const featureFlagStore = useFeatureFlagStore ()
37
+
38
+ const additionalSearchViews = computed (() =>
39
+ featureFlagStore .isOn (" additional_search_views" )
40
+ )
41
+
42
+ return { additionalSearchViews }
43
+ },
24
44
})
25
45
</script >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <VButton
3
+ as =" VLink"
4
+ size =" small"
5
+ variant =" filled-gray"
6
+ class =" label-bold"
7
+ :href =" href"
8
+ >{{ title }}</VButton
9
+ >
10
+ </template >
11
+
12
+ <script lang="ts">
13
+ import { defineComponent } from " vue"
14
+
15
+ import VButton from " ~/components/VButton.vue"
16
+
17
+ export default defineComponent ({
18
+ name: " VTag" ,
19
+ components: { VButton },
20
+ props: {
21
+ title: {
22
+ type: String ,
23
+ required: true ,
24
+ },
25
+ href: {
26
+ type: String ,
27
+ required: true ,
28
+ },
29
+ },
30
+ })
31
+ </script >
Original file line number Diff line number Diff line change
1
+ import {
2
+ ArgsTable ,
3
+ Canvas ,
4
+ Description ,
5
+ Meta ,
6
+ Story ,
7
+ } from " @storybook/addon-docs"
8
+
9
+ import VTag from " ~/components/VTag/VTag.vue"
10
+
11
+ <Meta
12
+ title = " Components/VTag"
13
+ component = { VTag }
14
+ argTypes = { {
15
+ title: {
16
+ type: " text" ,
17
+ },
18
+ href: {
19
+ type: " text" ,
20
+ },
21
+ }}
22
+ />
23
+
24
+ export const Template = (args ) => ({
25
+ template: ` <VTag v-bind="args"/> ` ,
26
+ components: { VTag },
27
+ setup() {
28
+ return { args }
29
+ },
30
+ })
31
+
32
+ # VTag
33
+
34
+ <Description of = { VTag } />
35
+
36
+ <ArgsTable of = { VTag } />
37
+
38
+ <Canvas >
39
+ <Story
40
+ name = " default"
41
+ args = { {
42
+ title: " cat" ,
43
+ href: " #" ,
44
+ }}
45
+ >
46
+ { Template .bind ({})}
47
+ </Story >
48
+ </Canvas >
You can’t perform that action at this time.
0 commit comments