1.4.10 • Published 7 months ago

admin-layout-vue v1.4.10

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Admin Layout - Vue JS component

NPM version

Requirements:

  • Bootstrap 5.2
  • Vue router (for <router-link>)
  • Vue 3

Install:

npm install admin-layout-vue

Parameters:

PropertyTypeRequired
brandNameStringNo
leftItemsByGroupsArrayYes
leftItemsByGroups[].headingStringNo
leftItemsByGroups[].itemsArrayYes
leftItemsByGroups[].items[].labelStringYes
leftItemsByGroups[].items[].iconClassStringNo
leftItemsByGroups[].items[].routeObjectNo
leftItemsByGroups[].items[].route.nameStringYes
leftItemsByGroups[].items[].visibleBoolNo
leftItemsByGroups[].items[].subItemsArrayNo
leftItemsByGroups[].items[].relatedRoutesArrayNo
leftItemsByGroups[].items[].subItems[].labelStringYes
leftItemsByGroups[].items[].subItems[].routeObjectYes
leftItemsByGroups[].items[].subItems[].route.nameObjectYes
leftItemsByGroups[].items[].subItems[].visibleBoolNo
leftItemsByGroups[].items[].subItems[].relatedRoutesArrayNo
topItemsArrayYes
topItems[].labelStringNo
topItems[].iconClassStringNo
topItems[].callableCallableNo
topItems[].showBadgeBoolNo
topItems[].subItems[]ArrayNo
topItems[].subItems[].labelStringYes
topItems[].subItems[].classStringNo
topItems[].subItems[].iconClassStringNo
topItems[].subItems[].callableCallableYes
topNavClassStringNo
leftNavClassString, ObjectNo
leftNavBgClassString, ObjectNo
dataBsThemeTopStringNo
dataBsThemeLeftStringNo
strictActiveRouteBooleanNo

Example

<template>
  <admin-layout
      brand-name="Brand"
      :left-items-by-groups="leftItemsByGroups"
      :top-items="topItems"
  >
    <template #topEnd>
      <div class="badge bg-info me-3">
        Example
      </div>
    </template>
    <router-view />
  </admin-layout>
</template>

<script>
import AdminLayout from 'admin-layout-vue'

export default {
  name: 'ExampleComponent',
  components: {
    AdminLayout,
  },
  data() {
    return {
      /**
       * Sidebar menu items
       */
      leftItemsByGroups: [
        {
          items: [
            {
              label: 'Home',
              iconClass: 'bi bi-house-door-fill',
              route: {
                name: 'home',
              },
            },
          ],
        },
        {
          heading: 'First heading',
          items: [
            {
              label: 'People',
              iconClass: 'bi bi-people-fill',
              route: {
                name: 'people',
              },
              relatedRoutes: [
                  'peopleCreate',
              ],
            },
            {
              label: 'Briefcase',
              iconClass: 'bi bi-briefcase-fill',
              subItems: [
                {
                  label: 'Option 1',
                  route: {
                    name: 'option',
                    query: {
                      status: '1',
                    },
                  },
                  relatedRoutes: [
                    'relatedOption',
                  ],
                },
                {
                  label: 'Option 2',
                  route: {
                    name: 'option',
                    query: {
                      status: '2',
                    },
                  },
                },
              ],
            },
          ],
        },
        {
          items: [
            {
              label: 'Coin',
              iconClass: 'bi bi-coin',
              route: {
                name: 'coin',
              },
            },
          ],
        },
      ],
      /**
       * Top navbar items
       */
      topItems: [
        {
          iconClass: 'bi bi-person-circle',
          subItems: [
            {
              label: this.$t('logout.submit'),
              callable: this.onLogoutClick,
            },
          ],
          showBadge: false,
        },
        {
          iconClass: 'bi bi-bell-fill',
          callable: this.showNotifications,
          showBadge: this.notificationsTotalCount > 0,
        },
      ],
    }
  }
}
</script>

Screenshots

1.4.9

7 months ago

1.4.10

7 months ago

1.4.6

10 months ago

1.4.5

10 months ago

1.4.8

10 months ago

1.4.7

10 months ago

1.4.4

11 months ago

1.4.3

11 months ago

1.4.2

11 months ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.2.2

2 years ago

1.1.3

2 years ago

1.2.1

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago