New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-tree-navigation

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-tree-navigation

A Vue.js tree navigation

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
296
decreased by-33.18%
Maintainers
1
Weekly downloads
 
Created
Source

vue-tree-navigation

A Vue.js tree navigation menu

Demo

Features:

  • unlimited number of levels
  • you can define default open level
  • focused on core functionality, only necessary styles included - just apply your own styles like I did for demo page :wink:

Installation

$ npm install vue-tree-navigation

main.js

import VueTreeNavigation from 'vue-tree-navigation';

Vue.use(VueTreeNavigation);

Usage

file.vue

<vue-tree-navigation :items="items" :defaultOpenLevel="defaultOpenLevel" />
export default {
  ...
  data() {
    return {
      items: [
        { name: 'First category', children: [
          { name: 'Category item', href: '#take-me-somewhere' },
          { name: 'Category item', href: '#take-me-somewhere' }
        ]},
        { name: 'Second category', href: '#take-me-somewhere' }
      ],
      defaultOpenLevel: 1
    }
  },
  ...
};

items Array

An array containing navigation menu items.

You don't need to specify href field. Menu item will be rendered as a simple value instead of a hyperlink in this case.

defaultOpenLevel Number

Optional. Default value is 0 (everything is closed).

Nuxt

You can use the component in your Nuxt.js project if you disable server-side rendering for your Nuxt plugin:

plugins/vue-tree-navigation.js

import Vue from 'vue';
import VueTreeNavigation from 'vue-tree-navigation';

Vue.use(VueTreeNavigation);

nuxt.config.js

module.exports = {
  ...
  plugins: [
    { src: '~plugins/vue-tree-navigation', ssr: false }
  ],
  ...
}

Developers

Install dependencies:

$ npm install

Run tests:

$ npm run test

Run tests in verbose mode:

$ npm run test:verbose

Run development server:

$ npm run dev

Build:

$ npm run build

Run demo development server:

$ cd demo
$ npm install
$ npm run dev

Keywords

FAQs

Package last updated on 28 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc