From 132f91f7aa205f4868978502e3d3b1c994e96b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Tue, 31 Aug 2021 12:16:43 +0300 Subject: [PATCH] update tabmenu demo, doc --- src/views/tabmenu/TabMenuDemo.vue | 20 ++++ src/views/tabmenu/TabMenuDoc.vue | 193 +++++++++++++++++++++++++----- 2 files changed, 186 insertions(+), 27 deletions(-) diff --git a/src/views/tabmenu/TabMenuDemo.vue b/src/views/tabmenu/TabMenuDemo.vue index 46b1223ec..76032cfbf 100755 --- a/src/views/tabmenu/TabMenuDemo.vue +++ b/src/views/tabmenu/TabMenuDemo.vue @@ -10,9 +10,21 @@
+
Default
+ +
+
Programmatic
+
+
+ + +
@@ -25,12 +37,20 @@ import TabMenuDoc from './TabMenuDoc'; export default { data() { return { + active: 3, items: [ {label: 'Home', icon: 'pi pi-fw pi-home', to: '/tabmenu'}, {label: 'Calendar', icon: 'pi pi-fw pi-calendar', to: '/tabmenu/calendar'}, {label: 'Edit', icon: 'pi pi-fw pi-pencil', to: '/tabmenu/edit'}, {label: 'Documentation', icon: 'pi pi-fw pi-file', to: '/tabmenu/documentation'}, {label: 'Settings', icon: 'pi pi-fw pi-cog', to: '/tabmenu/settings'} + ], + items2: [ + {label: 'Home', icon: 'pi pi-fw pi-home'}, + {label: 'Calendar', icon: 'pi pi-fw pi-calendar'}, + {label: 'Edit', icon: 'pi pi-fw pi-pencil'}, + {label: 'Documentation', icon: 'pi pi-fw pi-file'}, + {label: 'Settings', icon: 'pi pi-fw pi-cog'} ] } }, diff --git a/src/views/tabmenu/TabMenuDoc.vue b/src/views/tabmenu/TabMenuDoc.vue index 6d7b3e5d1..7eaacae45 100755 --- a/src/views/tabmenu/TabMenuDoc.vue +++ b/src/views/tabmenu/TabMenuDoc.vue @@ -10,9 +10,32 @@ import TabMenu from 'primevue/tabmenu';

TabMenu uses the common MenuModel API to define the items, visit MenuModel API for details.

Getting Started
-

TabMenu is integrated with Vue Router and requires a collection of menuitems as its model.

+

TabMenu requires a collection of menuitems as its model.


 <TabMenu :model="items" />
+
+
+ +

+export default {
+	data() {
+		return {
+			items: [
+                {label: 'Home', icon: 'pi pi-fw pi-home'},
+                {label: 'Calendar', icon: 'pi pi-fw pi-calendar'},
+                {label: 'Edit', icon: 'pi pi-fw pi-pencil'},
+                {label: 'Documentation', icon: 'pi pi-fw pi-file'},
+                {label: 'Settings', icon: 'pi pi-fw pi-cog'}
+            ]
+		}
+	}
+}
+
+
+ +

TabMenu can be also integrated with Vue Router.

+

+<TabMenu :model="items" />
 <router-view />
 
 
@@ -32,10 +55,24 @@ export default { } } + + +
Active
+

Visibility of the content is specified with the activeIndex property that supports one or two-way binding.

+ +

+<TabMenu :model="items" :activeIndex="activeIndex" />
+
+
+ +

Two-way binding requires v-model.

+

+<TabMenu :model="items" v-model:activeIndex="activeIndex" />
+
 
Templating
-

TabMenu offers content customization with the item template that receives the menuitem instance from the model as a parameter.

+

TabMenu offers content customization with the item template that receives the menuitem instance from the model as a parameter.