1.0.24 • Published 3 years ago

vue-instant-menu v1.0.24

Weekly downloads
56
License
MIT
Repository
-
Last release
3 years ago

vue-instant-menu

WARNING: vue-instant-menu is at the pre-alpha stage of development and may undergo significant changes.

Getting started

  1. Install the plugin:
npm install --save vue-instant-menu
  1. Add the plugin into your app:
import Vue from 'vue'
import VueInstantMenu from 'vue-instant-menu'

Vue.use(VueInstantMenu)
  1. All done! The components have been globally registered and are ready for use!

Usage

HTML Structure

Once the vue-instant-menu and menu-item components are installed globally, they can be used in templates in the following manner:

<vue-instant-menu>
    <menu-item menu-title="Home" menu-href="#"></menu-item>
    <menu-item menu-title="Features" menu-href="#">
        <menu-item menu-title="Elements" menu-href="#"></menu-item>
        <menu-item menu-title="Pricing Tables" menu-href="#"></menu-item>
        <menu-item menu-title="Icons" menu-href="#"></menu-item>
    </menu-item>
    <menu-item menu-title="Portfolio" menu-href="#"></menu-item>
</vue-instant-menu>

This plugin currently only supports one level of nested menu

Configuration

Properties for the component vue-instant-menu

PropertyTypeDefaultDescription
mobileBreakpointinteger992Controls the breakpoint at which the layout switches to mobile
fontFamilyStringinheritGeneral font
colorString#333Desktop link color
mobileBackgroundColorString#333Mobile slideout panel color
mobileColorString#fffMobile text color
dropdownColorString#fffDesktop dropdown text color
dropdownBackgroundColorString#333Desktop dropdown background color
mobileOpenButtonFillString#333Fill color of mobile hamburger menu
activeColorString#3490dcThe color of the currently active menu item

Properties for the component menu-item

PropertyTypeDefaultDescription
menuTitlestringText content of the menu item
menuHrefstringThe URL that the menu item will link to
isActivebooleanSets whether the current menu item is active or not

Custom labels

If you want to use something other than the default elements for you labels you can use the custom named slot on the menu-item component:

<vue-instant-menu>
    <menu-item menu-title="Home" menu-href="#" :is-active="true"></menu-item>
        <template slot="custom">
            <!-- Your awesome svg in here! -->
        </template>
    <menu-item menu-title="Features" menu-href="#"></menu-item>
    <menu-item :is-active="true" menu-title="Portfolio" menu-href="#"></menu-item>
</vue-instant-menu>

Custom mobile drawer buttons

If you want to swap out the default buttons on mobile, use these named slots:

<vue-instant-menu>
    <template slot="mobile-open-button">
        😅
    </template>
    <template slot="mobile-close-button">
        😱
    </template>
    <menu-item menu-title="Home" menu-href="#"></menu-item>
    <menu-item menu-title="Portfolio" menu-href="#"></menu-item>
</vue-instant-menu>

Styling

WIP!

1.0.24

3 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.1.0

6 years ago