vue-tree-navigation
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "vue-tree-navigation", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A Vue.js tree navigation", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# vue-tree-navigation | ||
A Vue.js tree navigation | ||
A Vue.js tree navigation menu | ||
@@ -9,3 +9,3 @@ [Demo](https://vue-tree-navigation.misrob.cz) | ||
* infinite number of levels | ||
* unlimited number of levels | ||
* you can define default open level | ||
@@ -38,2 +38,3 @@ * focused on core functionality, only necessary styles included - just apply your own styles like I did for demo page :wink: | ||
export default { | ||
... | ||
data() { | ||
@@ -48,18 +49,52 @@ return { | ||
], | ||
defaultOpenLevel: 2 | ||
defaultOpenLevel: 1 | ||
} | ||
} | ||
}, | ||
... | ||
}; | ||
``` | ||
**items** | ||
**items** `Array` | ||
You don't need to specify `href` field. Menu item will be rendered as a simple value instead of hyperlink in this case. | ||
An array containing navigation menu items. | ||
**defaultOpenLevel** | ||
You don't need to specify `href` field. Menu item will be rendered as a simple value instead of a hyperlink in this case. | ||
Optional. Default value is 0. | ||
**defaultOpenLevel** `Number` | ||
Optional. Default value is 0 (everything is closed). | ||
## Nuxt | ||
You can use the component in your [Nuxt.js](https://nuxtjs.org/) project if you disable server-side rendering for your Nuxt plugin: | ||
**plugins/vue-tree-navigation.js** | ||
```javascript | ||
import Vue from 'vue'; | ||
import VueTreeNavigation from 'vue-tree-navigation'; | ||
Vue.use(VueTreeNavigation); | ||
``` | ||
**nuxt.config.js** | ||
```javascript | ||
module.exports = { | ||
... | ||
plugins: [ | ||
{ src: '~plugins/vue-tree-navigation', ssr: false } | ||
], | ||
... | ||
} | ||
``` | ||
## Developers | ||
Install dependencies: | ||
```console | ||
$ npm install | ||
``` | ||
Run tests: | ||
@@ -93,4 +128,5 @@ | ||
$ cd demo | ||
$ npm install | ||
$ npm run dev | ||
``` | ||
89396
129