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-page-stack

v3.2.0

Published

<p align="center"> <img src="https://raw.githubusercontent.com/hezhongfeng/images/master/stack.svg" width="200"> </p>

Downloads

108

Readme

vue-page-stack

v3.1.4

  1. FIx the bug of refreshing the browser and then going back

v3.1.3

  1. Fixed the page caching issue when using replace.

v3.1.2

  1. Removed the stack-key parameter from the URL.
  2. Due to special handling of built-in components in Vue3.x, it is currently not possible to use it together with Transition.

This is the version of Vue3.0, Vue2.0 please click this link

English | 简体中文


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

Example

preview

demo code

Features

  • 🐉 Extend on vue-router, original navigation logic remains the same
  • push or forward renders the page and the newly rendered page is stored in Stack
  • 🏆 back or go(negative) when the previous pages are not re-rendered, but read from the Stack, and these pages retain the previous content state, such as form content, scrollbar scroll position, etc.
  • 🏈 back or go(negative) removes the unused pages from the Stack
  • 🎓replace will update the current page in the Stack
  • 🎉 The activated hook function is triggered when going back to the previous page
  • 🚀 Support for browser backward and forward events
  • 🐰 Provides routing direction changes and can add different animations when going forward and backward

The difference between VuePageStack and KeepAlive

  • 🌱 VuePageStack does not provide include, exclude and max parameters, because VuePageStack wants to achieve a complete page stack management, only in order in and out
  • 🪁 KeepAlive will keep caching the page after it has been cached, and VuePageStack will help destroy the extra pages based on the page stack hierarchy
  • 🧬 KeepAlive enters (not returns) the same route page and continues to reuse the previously cached page, while VuePageStack re-renders the page

Installation and use

Installation

pnpm install vue-page-stack

use

import { createApp } from 'vue';
import { VuePageStackPlugin } from 'vue-page-stack';

const app = createApp(App);

// router is necessary
app.use(VuePageStackPlugin, { router });
// App.vue
<template>
  <router-view v-slot="{ Component }">
    <vue-page-stack @back="onBack" @forward="onForward">
      <component :is="Component" :key="$route.fullPath"></component>
    </vue-page-stack>
  </router-view>
</template>

<script setup>
const onBack = () => {
  console.log('back');
};

const onForward = () => {
  console.log('forward');
};
</script>

API

install

use Vue.use to install vue-page-stack

import { VuePageStackPlugin } from 'vue-page-stack';

//...
app.use(VuePageStackPlugin, { router });

Options description:

| Attribute | Description | Type | Accepted Values | Default | | --------- | ------------------- | ------ | ------------------- | -------------- | | router | vue-router instance | Object | vue-router instance | - | | name | VuePageStack name | String | 'VuePageStack' | 'VuePageStack' |

forward or back

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

// App.vue
<vue-page-stack @back="onBack" @forward="onForward">
  <component :is="Component" :key="$route.fullPath"></component>
</vue-page-stack>

example

Notes

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 both vue-navigation and vue-nav,Thank you very much for their inspiration.

Contributors ✨

Thanks goes to these wonderful people (emoji key):