File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -52,11 +52,12 @@ onMounted(() => {
5252const visibleTags = computed (() => {
5353 if (showAllTags .value )
5454 return props .tags
55- return props .tags .slice (0 , 3 )
55+ return isMobile . value ? props . tags . slice ( 0 , 2 ) : props .tags .slice (0 , 3 )
5656})
5757
5858const remainingTagsCount = computed (() => {
59- return Math .max (0 , props .tags .length - 3 )
59+ const visibleCount = isMobile .value ? 2 : 3
60+ return Math .max (0 , props .tags .length - visibleCount )
6061})
6162
6263function toggleTags(event : Event ) {
@@ -109,7 +110,7 @@ const buttonLabel = computed(() =>
109110 <span class =" bg-hoppr-purple text-white px-2 py-1 rounded-full tracking-wider" role =" listitem" >{{ tag }}</span >
110111 </template >
111112 <button
112- v-if =" props.tags.length > 3 "
113+ v-if =" props.tags.length > (isMobile ? 2 : 3) "
113114 class =" bg-gray-200 text-gray-700 px-2 py-1 rounded-full text-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-hoppr-purple"
114115 :aria-expanded =" showAllTags"
115116 :aria-label =" buttonLabel"
Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ onMounted(() => {
4848const visibleTags = computed (() => {
4949 if (showAllTags .value )
5050 return props .tags
51- return isMobile .value ? props .tags .slice (0 , 3 ) : props .tags .slice (0 , 2 )
51+ return isMobile .value ? props .tags .slice (0 , 2 ) : props .tags .slice (0 , 2 )
5252})
5353
5454const remainingTagsCount = computed (() => {
55- const visibleCount = isMobile .value ? 3 : 2
55+ const visibleCount = isMobile .value ? 2 : 2
5656 return Math .max (0 , props .tags .length - visibleCount )
5757})
5858
@@ -104,7 +104,7 @@ const buttonLabel = computed(() =>
104104 <span class =" bg-hoppr-purple text-white px-2 py-1 rounded-full tracking-wider" role =" listitem" >{{ tag }}</span >
105105 </template >
106106 <button
107- v-if =" props.tags.length > (isMobile ? 3 : 2)"
107+ v-if =" props.tags.length > (isMobile ? 2 : 2)"
108108 class =" bg-gray-200 text-gray-700 px-2 py-1 rounded-full text-sm hover:bg-gray-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-hoppr-purple"
109109 :aria-expanded =" showAllTags"
110110 :aria-label =" buttonLabel"
You can’t perform that action at this time.
0 commit comments