npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vusion/vue-navigation

v1.1.6

Published

A page navigation library, built with vue2 and vue-router2.

Downloads

4

Readme

@vusion/vusion-navigation

require vue 2.x and vue-router 2.x

What is it

A library that can cache the pages state when using vue-router, no matter how you trigger the forward/back behavior by invoking router.push/router.go, window.history.back or the forward/back button of native browser.

For instance: A、B、C are pages

  1. A -> B -> C,A forward to B, then forward to C
  2. C -> B,C back to B,then B will restore its state from cache
  3. B -> C,then B forward to C,if you forward page by pressing the native browser button, C will restore from cache, otherwise, rebuild C
  4. A -> B -> C -> A,now there're two A instance in the history list, the older one's state will be replaced by the newer one

Why need this

  1. Sometimes states of pages need to be cached and then restore them at specific time, like back to the preview page which may has a form you've filled previously.
  2. The default behavior of vue-router is to create new instance of the router view when navigate to page, however this is not consistent with the behavior of triggering the forward/back button of native browser. Under such circumstance, data, state, scroll bar position will be retained.

Install

npm i -S @vusion/vusion-navigation

yarn add @vusion/vusion-navigation

Usage

Event

Functions: [ on | once | off ]

Event types: [ forward | back | replace | refresh | reset ]

this.$navigation.on('forward', (to, from) => {})
this.$navigation.once('back', (to, from) => {})
this.$navigation.on('replace', (to, from) => {})
this.$navigation.off('refresh', (to, from) => {})
this.$navigation.on('reset', () => {})

Methods

Use Vue.navigation in global environment or use this.$navigation in vue instance.

  • getRoutes() get the routing records
  • cleanRoutes() clean the routing records