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

vue-app-navigation

v1.0.2

Published

[![npm version](https://badge.fury.io/js/vue-page-stack.svg)](https://badge.fury.io/js/vue-page-stack)

Downloads

2

Readme

vue-app-navigation

npm version

English | 简体中文


A Vue SPA navigation manager,cache the UI in the SPA like a native application, rather than destroy it.

Example

preview

demo code

Features

  • 🐉expanded on vue-router, the original navigation logic remains unchanged
  • ⚽When a page is re-rendered as a push or forward, the newly rendered page will be added to the Stack.
  • 🏆When back or go(negative number), the previous pages are not re-rendered, but instead are read from the Stack, and these pages retain the previous content state, such as the form content, the position of the scroll bar
  • 🏈back or go (negative) will remove unused pages from the Stack
  • 🎓replace will update the current page in the stack
  • 🎉activated hook function triggers when rolling back to the previous page
  • 🚀Browser back and forward events are supporded
  • 🍕Responding to changes in routes with Parameters is supporded, such as navigating from /user/foo to /user/bar, component instances are reused
  • 🐰provides routing direction changes, and you can add different animations when forward or backward

Installation and use

Installation

npm install vue-app-navigation
# OR
yarn add vue-app-navigation

use

import Vue from 'vue'
import VueAppNavigation from 'vue-app-navigation';

// vue-router is necessary
Vue.use(VueAppNavigation, { router });
// App.vue
<template>
  <div id="app">
    <vue-app-navigation>
      <router-view ></router-view>
    </vue-app-navigationvue-app-navigation>
  </div>
</template>

CDN

<script src="https://unpkg.com/vue-page-stack/dist/vue-page-stack.umd.min.js"></script>
Vue.use(VueAppNavigation, { router });

API

install

use Vue.use to install vue-app-navigation

Vue.use(VueAppNavigation, options);
// example
Vue.use(VueAppNavigation, { router });

Options description:

| Attribute | Description | Type | Accepted Values | Default | | --------- | ------------------- | ------ | ------------------- | -------------- | | router | vue-router instance | Object | vue-router instance | - | | name | VueAppNavigation name | String | 'VueAppNavigation' | 'VueAppNavigation' | | keyName | stack-key name | String | 'stack-key' | 'stack-key' |

you can customize VueAppNavigation's name and keyName

Vue.use(VueAppNavigation, { router, name: 'VueAppNavigation', keyName: 'stack-key' });

forward or backward

If you want to make some animate entering or leaving, Vue-app-navigation offers stack-key-dir to judge forward or backward.

// App.vue
$route(to, from) {
  if (to.params['stack-key-dir'] === 'forward') {
    this.transitionName = 'forward';
  } else {
    this.transitionName = 'back';
  }
}

Notes

keyName

Why is the parameter keyName added to the route? To support the browser's backward and forward events,this is important in webApp or wechat.

Changelog

Details changes for each release are documented in the release notes.

Principle

Getting the current page instance refers to the keep-alive section of Vue.

Thanks

The plug-in draws on vue-page-stack,Thank you very much for their inspiration.