skip-page

[![skip-page screencast](./resources/skip-page.gif)]

Usage no npm install needed!

<script type="module">
  import skipPage from 'https://cdn.skypack.dev/skip-page';
</script>

README

skip-page - skip/cache page component

[skip-page screencast]

Install

npm install skip-page --save

NPM

import Vue from 'vue'
import skipPage from 'skip-page'

Browser

<script src="skip-page\dist\skip-page.umd.min.js"></script>

Register components:

Vue.use(skipPage);
or
Vue.component('skip-page', skipPage);

Usage

main.vue


<skip-page ref="skipPage" :props="config">
    ...
</skip-page>

Default config below

config: {
        main: '主页', // The breadcrumb of main page
        goBackTitle: '返回',
        showGoBack: true,
        showBreadcrumb: true
    }

The use of skip(component,config)

  • @param component {Number | string | component} The target page of jump
  • @param config

// From main page skip to 'other.vue'
import other from 'other.vue'
this.$refs.skipPage.skip(other)

// skip to main page
 this.$parent.skip()

// skip to previous page
 this.$parent.skip(-1)

//skip by component.name
skip('componentName')

props、emit

var config = {
         cache:false,
         title: '',  // breadcrumb title
         props: {},
         emit: {}
  }

skip(component,config)