Skip to content

Commit f0393e6

Browse files
committed
fix: button click
1 parent 4eb8438 commit f0393e6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

components/ButtonSelectCategory.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<div class="relative cursor-pointer select-none items-center justify-center text-base font-semibold" @click="isDropdownVisible = !isDropdownVisible">
2+
<div class="relative cursor-pointer select-none items-center justify-center text-base font-semibold" ref="dropdownRef" @click="isDropdownVisible = !isDropdownVisible">
33
<div
44
class="box-border flex items-center rounded-full py-3.5 pl-5 pr-4 transition-all active:scale-95"
55
:class="{ 'bg-black text-white hover:bg-black': isDropdownVisible, 'bg-[#efefef] hover:bg-[#e2e2e2]': !isDropdownVisible }">
66
<span class="mr-1.5">{{ route.query.category || 'All Categories' }}</span>
77
<Icon name="iconamoon:arrow-down-2" size="24" />
88
</div>
99
<Transition>
10-
<div v-if="isDropdownVisible" ref="dropdownRef" class="absolute top-full z-10 mt-[18px] rounded-2xl text-base font-semibold bg-white shadow-[0_0_8px_rgba(0,0,0,.1)]">
10+
<div v-if="isDropdownVisible" class="absolute top-full z-10 mt-[18px] rounded-2xl text-base font-semibold bg-white shadow-[0_0_8px_rgba(0,0,0,.1)]">
1111
<div class="m-2 w-44">
1212
<div @click="setCategory()" class="rounded-lg px-3 py-2 transition-all duration-300 hover:bg-[#e9e9e9]">
1313
<div class="flex items-center justify-between">

components/ButtonSortBy.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<div class="relative cursor-pointer select-none items-center justify-center text-base font-semibold" @click="isDropdownVisible = !isDropdownVisible">
2+
<div class="relative cursor-pointer select-none items-center justify-center text-base font-semibold" ref="dropdownRef" @click="isDropdownVisible = !isDropdownVisible">
33
<div
44
class="box-border flex items-center rounded-full py-3.5 pl-5 pr-4 transition-all active:scale-95"
55
:class="{ 'bg-black text-white hover:bg-black': isDropdownVisible, 'bg-[#efefef] hover:bg-[#e2e2e2]': !isDropdownVisible }">
66
<span class="mr-1.5">{{ selectedSort }}</span>
77
<Icon name="iconamoon:arrow-down-2" size="24" />
88
</div>
99
<Transition>
10-
<div v-if="isDropdownVisible" ref="dropdownRef" class="absolute top-full right-0 z-10 mt-[18px] rounded-2xl text-base font-semibold bg-white shadow-[0_0_8px_rgba(0,0,0,.1)]">
10+
<div v-if="isDropdownVisible" class="absolute top-full right-0 z-10 mt-[18px] rounded-2xl text-base font-semibold bg-white shadow-[0_0_8px_rgba(0,0,0,.1)]">
1111
<div class="m-2 w-48">
1212
<div v-for="(option, i) in options" :key="i" @click="setSort(option.value)" class="rounded-lg px-3 py-2 transition-all duration-300 hover:bg-[#e9e9e9]">
1313
<div class="flex items-center justify-between">

0 commit comments

Comments
 (0)