{"id":19892409,"url":"https://github.com/arodax/vue-nav-spa","last_synced_at":"2025-05-02T18:31:44.733Z","repository":{"id":57098820,"uuid":"177774342","full_name":"arodax/vue-nav-spa","owner":"arodax","description":"single page navigation menu for vue","archived":false,"fork":false,"pushed_at":"2019-06-23T12:44:37.000Z","size":127,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T10:54:43.877Z","etag":null,"topics":["menu","scrollspy","smoothscroll","vue","vue-plugin","vuecomponent"],"latest_commit_sha":null,"homepage":null,"language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arodax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T11:26:06.000Z","updated_at":"2020-02-14T09:33:24.000Z","dependencies_parsed_at":"2022-08-20T17:31:33.323Z","dependency_job_id":null,"html_url":"https://github.com/arodax/vue-nav-spa","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodax%2Fvue-nav-spa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodax%2Fvue-nav-spa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodax%2Fvue-nav-spa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arodax%2Fvue-nav-spa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arodax","download_url":"https://codeload.github.com/arodax/vue-nav-spa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252088567,"owners_count":21692818,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["menu","scrollspy","smoothscroll","vue","vue-plugin","vuecomponent"],"created_at":"2024-11-12T18:23:29.839Z","updated_at":"2025-05-02T18:31:41.664Z","avatar_url":"https://github.com/arodax.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"![\"Licence: MIT\"](https://img.shields.io/badge/License-MIT-yellow.svg)\n\n![\"\u003cnav-spa\u003e logo\"](logo.png)\n\n# Nav-Spa\n\n- Highlight a menu item when you scroll at it's section.\n- Smooth scroll to section when you click on a menu item. \n\n*Note: This package is modified version of [eddiemf/vue-scrollactive](https://github.com/eddiemf/vue-scrollactive)\nplugin with some additional and modified functionality.*\n\n## Installation\n\nInstall with your favourite package manager:\n\n- Yarn: `yarn add vue-spa-nav`\n- Npm: `npm -i vue-spa-nav`\n\n## Usage\n\n```javascript\nimport Vue from 'vue'\nimport VueSpaNav from './vue-nav-spa'\n\nVue.use(VueSpaNav)\n\n```\n\nAdd `\u003cnav-spa\u003e` tag to your HTML, as you would add normal `\u003cnav\u003e` tag with\nmenu items you want to get highlighted during your scroll. All `\u003ca\u003e` tags\nwill be handled by this plugin (or see [advanced usage](#advanced-usage)).\n\n\n## Advanced usage\n\n### Define which links to handle\n\nAll links in `\u003cnav-spa\u003e` are handled by this plugin by default. If you want,\ncan add custom selector for link which you want to get handled, providing `link`\nproperty at `\u003cnav-spa\u003e` tag.\n\n\n**All links will be handled:**\n\n```\n\u003cnav-spa\u003e\n  \u003ca href=\"#foo\"\u003efoo\u003c/a\u003e\n  \u003ca href=\"#bar\"\u003ebar\u003c/a\u003e\n\u003c/nav-spa\u003e\n```\n\n**Only some links will be handled:**\n```\n\u003cnav-spa link=\"custom-class\"\u003e\n  \u003ca href=\"#foo\" class=\"custom-class\"\u003efoo\u003c/a\u003e\n  \u003ca href=\"#bar\"\u003ebar\u003c/a\u003e\n\u003c/nav-spa\u003e\n```\n\n### Replacing hash instead of appending\n\nInstead of pushing new hash into history, you can replace it.\n```\n\u003cnav-spa link=\"custom-class\" push-method=\"replaceState\"\u003e\n```\n\n## Props\n\n| attribute               | type     | default          | description\n| ------------------------| -------- | -----------------|------------\n| `active-class`          | String   | `active`         | CSS class displayed at the active link.\n| `always-track`          | Boolean  | `false`          | Defines if the plugin should track the section change when clicking an item to scroll to its section. If set to true, it will always keep track and change the active class to the current section while scrolling, if false, the active class will be immediately applied to the clicked menu item, ignoring the passed sections until the scrolling is over.\n| `bezier-easing-value`   | String   | `.5,0,.35,1`     | Your custom easing value for the click to scroll functionality. It must be a string with 4 values separated by commas in a cubic bezier format. Check [this tool](http://cubic-bezier.com) for generating values.\n| `duration`              | Number   | `500`            | Duration of the scroll animation.\n| `enabled`               | Boolean  | `true`           | Whether is event handler for click event enabled.\n| `enabled-smooth-scroll` | Boolean  | `true`           | Whether the smooth scroll feature is enabled or not.\n| `highlight-first-item`  | Boolean  | `true`           | Whether if the first item always highlighted.\n| `link`                  | String   | `a[href^=\"#\"]`   | Selector for links which observer for click event and added smooth scroll. By default all link in document are handled by smooth scroll.\n| `offset`                | Number   | `0`              | Space between top of the window and the section. This is usually set to your fixed header height.\n| `push-method`           | String   | `pushState`      | Which history API method will be used. pushState or replaceState?\n| `scroll-container`      | String   | `null`           | Container of the sections, if omitted window will be used.\n| `tag`                   | String   | `nav`            | Component tag, where will be the component rendered.\n| `update-hash`           | Boolean  | `true`           | Update hash in URL when section is changed.\n\n## Changelog\n\n### 1.2.0\n- [feature #1](https://github.com/arodax/vue-nav-spa/issues/1) Added `enabled-smooth-scroll` property to enable/disable smooth scrolling. \n\n### 1.1.0\n- Added push-method property, allowing replacing history instead of overwriting it.\n- Fixed missing `highlight-first-item` property.\n- Added onPopState listener allowing to go back to previous hashes.  \n\n## Licence\n\nThe MIT License (MIT)\n\nCopyright (c) 2019-present, ARODAX a.s.\n\nCopyright (c) 2017-2018 Mauricio Dziedzinski\n\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farodax%2Fvue-nav-spa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farodax%2Fvue-nav-spa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farodax%2Fvue-nav-spa/lists"}