From 702088f1657dcad0c4bea996ab27e1383eca50f9 Mon Sep 17 00:00:00 2001 From: Alexandr Date: Tue, 5 Jul 2022 19:55:18 +0300 Subject: [PATCH] feat: tabs component --- .../tabs/examples/TabsDefaultExample.vue | 21 ++-- docs/guide/tabs/examples/TabsPillsExample.vue | 23 ++++ .../tabs/examples/TabsUnderlineExample.vue | 23 ++++ docs/guide/tabs/tabs.md | 113 +++++++++++++++++- src/components/Tabs/Tabs.vue | 32 ++++- src/components/Tabs/components/Tab/Tab.vue | 17 ++- src/components/Tabs/config.ts | 2 + 7 files changed, 212 insertions(+), 19 deletions(-) create mode 100644 docs/guide/tabs/examples/TabsPillsExample.vue create mode 100644 docs/guide/tabs/examples/TabsUnderlineExample.vue diff --git a/docs/guide/tabs/examples/TabsDefaultExample.vue b/docs/guide/tabs/examples/TabsDefaultExample.vue index a56462e..eb838e1 100644 --- a/docs/guide/tabs/examples/TabsDefaultExample.vue +++ b/docs/guide/tabs/examples/TabsDefaultExample.vue @@ -1,24 +1,23 @@ diff --git a/docs/guide/tabs/examples/TabsPillsExample.vue b/docs/guide/tabs/examples/TabsPillsExample.vue new file mode 100644 index 0000000..9ed000e --- /dev/null +++ b/docs/guide/tabs/examples/TabsPillsExample.vue @@ -0,0 +1,23 @@ + + diff --git a/docs/guide/tabs/examples/TabsUnderlineExample.vue b/docs/guide/tabs/examples/TabsUnderlineExample.vue new file mode 100644 index 0000000..942f0ae --- /dev/null +++ b/docs/guide/tabs/examples/TabsUnderlineExample.vue @@ -0,0 +1,23 @@ + + diff --git a/docs/guide/tabs/tabs.md b/docs/guide/tabs/tabs.md index 05daf1c..f5ebd6f 100644 --- a/docs/guide/tabs/tabs.md +++ b/docs/guide/tabs/tabs.md @@ -1,5 +1,116 @@ - \ No newline at end of file +## Prop - variant (default) + +```typescript +export type TabsVariant = 'default' | 'underline' | 'pills' + +defineProps({ + variant: { + type: String as PropType, + default: 'default', + }, +}) +``` + + + + +```vue + + +``` + +## Prop - variant (underline) + + + +```vue + + +``` + +## Prop - variant (pills) + + + +```vue + + +``` + +## Prop - directive + +Use this props if you want to control which directive to use for rendering every tab content + +```typescript +export type TabsVariant = 'default' | 'underline' | 'pills' + +defineProps({ + directive: { + type: String as PropType<'if' | 'show'>, + default: 'if', + }, +}) +``` \ No newline at end of file diff --git a/src/components/Tabs/Tabs.vue b/src/components/Tabs/Tabs.vue index 247eb86..651b59a 100644 --- a/src/components/Tabs/Tabs.vue +++ b/src/components/Tabs/Tabs.vue @@ -12,19 +12,24 @@ /> - +
+ +
+ + diff --git a/src/components/Tabs/components/Tab/Tab.vue b/src/components/Tabs/components/Tab/Tab.vue index c3b7845..b4849b4 100644 --- a/src/components/Tabs/components/Tab/Tab.vue +++ b/src/components/Tabs/components/Tab/Tab.vue @@ -1,9 +1,21 @@