@hippy/vue-router-next-history
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

vue-router-next-history

This is a hippy history mode for @hippy/vue-next. We copy source code from memory mode for vue-router and make a small change. Current history position was exported to be access outside for other purpose.

And we will inject android hardware back press to execute router back by default. only exit app when there is no history back.

How To Use

  1. Install
# you should install @hippy/vue-next and vue-router first
npm install @hippy/vue-router-next-history --save-dev
  1. Use
// we used typescript
import type { Router } from 'vue-router';
import { createHippyRouter } from '@hippy/vue-router-next-history';
import App from './app.vue';

const routes = [
  {
    path: '/',
    component: App,
  },
  {
    path: '/path',
    component: App,
  }
];

const router: Router = createHippyRouter({
  routes,
});


router.push('/');
router.push('/path');

// now if you press android hardware back, it should back to path '/' first. then exit
// app at the second press

Package Sidebar

Install

npm i @hippy/vue-router-next-history

Weekly Downloads

12

Version

0.0.1

License

Apache-2.0

Unpacked Size

9.52 kB

Total Files

4

Last publish

Collaborators

  • zealotchen
  • zoomchan-cxj
  • gguoyu