All Projects → hezhongfeng → Vue Page Stack

hezhongfeng / Vue Page Stack

Licence: mit
Routing and navigation for your Vue SPA. Vue 单页应用导航管理器

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Page Stack

Vue Navigation
A page navigation library, record routes and cache pages, like native app navigation. 一个页面导航库,记录路由并缓存页面,像原生APP导航一样。
Stars: ✭ 920 (+93.68%)
Mutual labels:  cache, page, vue-router
Vmtouch
Portable file system cache diagnostics and control
Stars: ✭ 1,341 (+182.32%)
Mutual labels:  cache, page
Pomodoro
A simple WordPress translation cache
Stars: ✭ 47 (-90.11%)
Mutual labels:  translation, cache
Vuet
允许你定义飙车过程的集中式状态管理模式
Stars: ✭ 430 (-9.47%)
Mutual labels:  vue-router
Algodeck
An Open-Source Collection of 200+ Algorithmic Flash Cards to Help you Preparing your Algorithm & Data Structure Interview 💯
Stars: ✭ 4,441 (+834.95%)
Mutual labels:  stack
Coding Interview Gym
leetcode.com , algoexpert.io solutions in python and swift
Stars: ✭ 451 (-5.05%)
Mutual labels:  stack
Douban
Douban book website demo by server side render
Stars: ✭ 468 (-1.47%)
Mutual labels:  vue-router
Music Player
Vue高仿网易云音乐(Vue入门实践)——在线预览 -- 暂时停止
Stars: ✭ 428 (-9.89%)
Mutual labels:  vue-router
Vue2 News
基于vue2 + vue-router + vuex 构建的一个新闻类单页面应用 —— 今日头条(移动端)
Stars: ✭ 462 (-2.74%)
Mutual labels:  vue-router
Laravel Translation Loader
Store your translations in the database or other sources
Stars: ✭ 446 (-6.11%)
Mutual labels:  translation
Blog Client
使用vue全家桶制作的博客前台页面
Stars: ✭ 443 (-6.74%)
Mutual labels:  vue-router
Redis
Vapor provider for RediStack
Stars: ✭ 434 (-8.63%)
Mutual labels:  cache
Under The Hood Reactjs
Entire React code base explanation by visual block schemes (Stack version)
Stars: ✭ 4,794 (+909.26%)
Mutual labels:  stack
Vue Family Mindmap
用一张思维导图总结了 Vue | Vue-Router | Vuex 源码与架构要点。
Stars: ✭ 432 (-9.05%)
Mutual labels:  vue-router
Unitybookpagecurl
Page curl effect for Unity3d using UGUI
Stars: ✭ 464 (-2.32%)
Mutual labels:  page
Libmc
Fast and light-weight memcached client for C++ / #python / #golang #libmc
Stars: ✭ 429 (-9.68%)
Mutual labels:  cache
Vue Boilerplate Template
🍎 Efficient development of web SPA using Vue.js(2.*) + Webpack + Element-ui + Pwa + Vuex + Vuex-router + Vue-i18n + Dayjs + Lodash.
Stars: ✭ 461 (-2.95%)
Mutual labels:  vue-router
Ru.reactjs.org
React documentation website in Russian / Официальная русская версия сайта React
Stars: ✭ 444 (-6.53%)
Mutual labels:  translation
Stringz
A lightweight and powerful editor for localizing iOS, macOS, tvOS, and watchOS applications.
Stars: ✭ 440 (-7.37%)
Mutual labels:  translation
Vue Particle Line
🌈一个Vue+Cnavas酷炫背景粒子线条
Stars: ✭ 451 (-5.05%)
Mutual labels:  vue-router

vue-page-stack

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-page-stack
# OR
yarn add vue-page-stack

use

import Vue from 'vue'
import VuePageStack from 'vue-page-stack';

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

CDN

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

API

install

use Vue.use to install vue-page-stack

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

Options description:

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

you can customize VuePageStack's name and keyName

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

forward or backward

If you want to make some animate entering or leaving, vue-page-stack 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';
  }
}

example

get current UI stack

let UIStack = this.$pageStack.getStack();

example code

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

Contributors ✨

Thanks goes to these wonderful people (emoji key):

hezf
hezf

🎨
李娜
李娜

📖
余小磊
余小磊

💻
yellowbeee
yellowbeee

💻
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].