A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/hezhongfeng/vue-page-stack/tree/v1.5.0 below:

GitHub - hezhongfeng/vue-page-stack at v1.5.0

English | 简体中文

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

preview

demo code

npm install vue-page-stack
# OR
yarn add vue-page-stack
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>
<script src="https://unpkg.com/vue-page-stack/dist/vue-page-stack.umd.min.js"></script>
Vue.use(VuePageStack, { router });

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' });

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

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

example code

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.

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

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

The plug-in draws on both vue-navigation and vue-nav,Thank you very much for their inspiration.

Thanks goes to these wonderful people (emoji key):


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4