vue-priority-plus-navigation

Responsively show menu items as the horizonal space allows and hides the rest.
2,587 7
Install
npm install vue-priority-plus-navigation
Latest Version:1.0.4
License:MIT
Last Updated:Jan 4, 2023
Links: GitHub  ·  npm
Maintainer: nguyenj

Vue Priority Plus Navigation

Responsively show menu items as the horizonal space allows and hides the rest.

Install

npm install --save vue-priority-plus-navigation

Usage

<template>
  <PriorityPlus :list="menuItems">
    <div slot-scope='{ mainItems, moreItems }'>
      <a v-for='(item, index) in mainItems'
          :key='index'
          :href='https://github.com/nguyenj/vue-priority-plus-navigation/blob/HEAD/item.link'
          :title='item.label'
          @click.prevent='clickItem($event, item)'>
        {{ item.label }}
      </a>
      <div v-if='moreItems.length'>
        <button type='button'>More +</button>
        <div class='dropdown'>
          <a v-for='(item, index) in moreItems'
              :key='index'
              :href='https://github.com/nguyenj/vue-priority-plus-navigation/blob/HEAD/item.link'
              :title='item.label'
              @click.prevent='clickItem($event, item)'>
            {{ item.label }}
          </a>
        </div>
      </div>
    </div>
  </PriorityPlus>
</template>

<script>
import PriorityPlus from 'vue-priority-plus-navigation'

export default {
  components: [ PriorityPlus ],
  data () {
    return {
      menuItems: [
        { label: 'Page 1', link: '/page-1' },
        { label: 'Page 2', link: '/page-2' },
        { label: 'Vue PriorityPlus Navigation Readme', link: 'https://github.com/nguyenj/vue-priority-plus-navigation/blob/master/README.md' }
      ]
    }
  },
  methods: {
    clickItem (event, item) { console.log(item) }
  }
}
</script>

API

slot-scope variables Type Description
mainItems Array The visible main menu items
moreItems Array The menu items that don't fit in the main menu

License

MIT © John Nguyen

Related Packages

vue-navigation-bar

A simple, pretty navbar for your Vue projects.

28,815 190
vue-tree-navigation

Vue.js 2 tree navigation

19,456 158
@greenborn/vue-side-menu

Menú lateral genérico y autocontenido para Vue 3: configurable por props, respon...

691 0
vue-stripe-menu

Creating a navigation menu with animations like on Stripe

10,214 534
@composy/menu-vue

LDesign 菜单系统 - Vue 3 适配器

0

Version History

Version Released License
1.0.4 MIT
1.0.3 MIT
1.0.2 MIT
1.0.1 MIT
1.0.0 MIT
Pre-releases (4)
Version Released License
1.0.0-rc.4 MIT
1.0.0-rc.3 MIT
1.0.0-rc.2 MIT
1.0.0-rc.1 MIT