Skip to content

Commit

Permalink
fix: Tab component props
Browse files Browse the repository at this point in the history
  • Loading branch information
nextchamp-saqib committed Jan 31, 2024
1 parent 89832b4 commit d72a683
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
6 changes: 5 additions & 1 deletion frontend/src/components/Controls/InputWithTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ function getLabel() {
<div
class="my-2 flex select-none flex-col space-y-3 rounded border bg-white p-3 text-base shadow-md"
>
<Tabs :tabs="tabs" @switch="$emit('tab-change', $event.label)" />
<Tabs
:tabs="tabs"
:model-value="getLabel()"
@update:model-value="$emit('tab-change', $event.label)"
/>
<slot name="inputs"></slot>
<div class="flex w-full justify-end">
<Button variant="solid" @click="togglePopover()"> Done </Button>
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/components/Controls/TimespanPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@
<div
class="my-2 flex w-[18rem] select-none flex-col space-y-3 rounded border bg-white p-3 text-base shadow-md"
>
<Tabs
:tabs="[
{ label: 'Last', active: span == 'Last' },
{ label: 'Current', active: span == 'Current' },
{ label: 'Next', active: span == 'Next' },
]"
@switch="(tab) => (span = tab.label)"
></Tabs>
<Tabs :tabs="['Last', 'Current', 'Next']" v-model="span"></Tabs>

<div class="flex space-x-2">
<Input
Expand Down
9 changes: 1 addition & 8 deletions frontend/src/components/Controls/TimespanPickerFlat.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
<template>
<div class="flex select-none flex-col space-y-3 text-base">
<Tabs
:tabs="[
{ label: 'Last', active: span == 'Last' },
{ label: 'Current', active: span == 'Current' },
{ label: 'Next', active: span == 'Next' },
]"
@switch="(tab) => (span = tab.label)"
></Tabs>
<Tabs :tabs="['Last', 'Current', 'Next']" v-model="span"></Tabs>

<div class="flex space-x-2">
<Input
Expand Down

0 comments on commit d72a683

Please sign in to comment.