admin-layout-vue

1.4.10 • Public • Published

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:

Property Type Required
brandName String No
leftItemsByGroups Array Yes
leftItemsByGroups[].heading String No
leftItemsByGroups[].items Array Yes
leftItemsByGroups[].items[].label String Yes
leftItemsByGroups[].items[].iconClass String No
leftItemsByGroups[].items[].route Object No
leftItemsByGroups[].items[].route.name String Yes
leftItemsByGroups[].items[].visible Bool No
leftItemsByGroups[].items[].subItems Array No
leftItemsByGroups[].items[].relatedRoutes Array No
leftItemsByGroups[].items[].subItems[].label String Yes
leftItemsByGroups[].items[].subItems[].route Object Yes
leftItemsByGroups[].items[].subItems[].route.name Object Yes
leftItemsByGroups[].items[].subItems[].visible Bool No
leftItemsByGroups[].items[].subItems[].relatedRoutes Array No
topItems Array Yes
topItems[].label String No
topItems[].iconClass String No
topItems[].callable Callable No
topItems[].showBadge Bool No
topItems[].subItems[] Array No
topItems[].subItems[].label String Yes
topItems[].subItems[].class String No
topItems[].subItems[].iconClass String No
topItems[].subItems[].callable Callable Yes
topNavClass String No
leftNavClass [String, Object] No
leftNavBgClass [String, Object] No
dataBsThemeTop String No
dataBsThemeLeft String No
strictActiveRoute Boolean No

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

Screenshot 2022-12-01 at 15 19 19

Screenshot 2022-12-01 at 15 19 37

Screenshot 2022-12-01 at 15 18 55

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.4.10144latest

Version History

VersionDownloads (Last 7 Days)Published
1.4.10144
1.4.90
1.4.80
1.4.70
1.4.60
1.4.50
1.4.40
1.4.30
1.4.20
1.4.10
1.4.00
1.3.20
1.3.10
1.3.00
1.2.20
1.2.10
1.2.00
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.10
1.0.00
0.3.40
0.3.31
0.3.21
0.3.10
0.3.00
0.2.10
0.2.00
0.1.30
0.1.20
0.1.10
0.1.01
0.0.20

Package Sidebar

Install

npm i admin-layout-vue

Weekly Downloads

147

Version

1.4.10

License

MIT

Unpacked Size

20 kB

Total Files

8

Last publish

Collaborators

  • zemkogabor