Skip to content

Commit

Permalink
fix: dropdown click event
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyinws committed Mar 11, 2024
1 parent a93580b commit 020803a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions components/AccountList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script setup lang="ts">
import type { DropdownItem } from '@nuxt/ui/dist/runtime/types/dropdown'
import { storeToRefs } from 'pinia'
const { accounts, currentAccount, currentAccountIndex } = storeToRefs(useAccount())
Expand All @@ -9,7 +8,7 @@ const isModalOpen = ref(false)
const router = useRouter()
const { t, locale } = useI18n()
const items = computed<DropdownItem[][]>(() => {
const items = computed(() => {
return [
// [
// {
Expand All @@ -24,7 +23,7 @@ const items = computed<DropdownItem[][]>(() => {
account,
slot: 'account',
disabled: account.steamId === currentAccount.value?.steamId,
onClick: () => {
click: () => {
currentAccountIndex.value = index
parseConfig(locale.value, account.steamId)
},
Expand All @@ -33,13 +32,13 @@ const items = computed<DropdownItem[][]>(() => {
[{
label: t('system.add-account'),
icon: 'i-heroicons-plus-circle',
onclick: () => {
click: () => {
isModalOpen.value = true
},
}, {
label: t('system.sign-out'),
icon: 'i-heroicons-arrow-left-on-rectangle',
onclick: () => {
click: () => {
accounts.value.splice(currentAccountIndex.value, 1)
imgLoading.value = true
if (accounts.value?.length > 0) {
Expand Down

0 comments on commit 020803a

Please sign in to comment.