Volver al ranking

zack24q/vue-navigation

JavaScript

A page navigation library, record routes and cache pages, like native app navigation. 一个页面导航库,记录路由并缓存页面,像原生APP导航一样。

pagenavigationcachevuevue-router
Crecimiento de estrellas
Estrellas
1k
Forks
177
Crecimiento semanal
Issues
33
5001k
mar 2017abr 2020jun 2023jul 2026
Artefactosnpmnpm install vue-navigation
README

vue-navigation

npm npm npm Github file size

require vue 2.x and vue-router 2.x.

中文文档

vue-navigation default behavior is similar to native mobile app (A、B、C are pages):

  1. A forward to B, then forward to C;
  2. C back to B, B will recover from cache;
  3. B forward to C again, C will rebuild, not recover from cache;
  4. C forward to A, A will build, now the route contains two A instance.

!important: vue-navigation adds a key to the url to distinguish the route. The default name of the key is VNK, which can be modified.

DEMO

DEMO

CODE

Installing

npm i -S vue-navigation

or

yarn add vue-navigation

Usage

Basic Usage

main.js

import Vue from 'vue'
import router from './router' // vue-router instance
import Navigation from 'vue-navigation'

Vue.use(Navigation, {router})
// bootstrap your app...

App.vue

<template>
  <navigation>
    <router-view></router-view>
  </navigation>
</template>

Use with vuex2

main.js

import Vue from 'vue'
import router from './router' // vue-router instance
import store from './store' // vuex store instance
import Navigation from 'vue-navigation'

Vue.use(Navigation, {router, store})
// bootstrap your app...

After passing in store, vue-navigation will register a module in store (default module name is navigation), and commit navigation/FORWARD or navigation/BACK or navigation/REFRESH when the page jumps.

Options

Only router is required.

Vue.use(Navigation, {router, store, moduleName: 'navigation', keyName: 'VNK'})

Events

functions: [ on | once | off ]

event types: [ forward | back | replace | refresh | reset ]

parameter( to | from ) properties:

  • name
    • type: string
    • desc: name of the route(contains the key)
  • route
    • type: object
    • desc: vue-route`s route object
this.$navigation.on('forward', (to, from) => {})
this.$navigation.once('back', (to, from) => {})
this.$navigation.on('replace', (to, from) => {})
this.$navigation.off('refresh', (to, from) => {})
this.$navigation.on('reset', () => {})

Methods

Use Vue.navigation in global environment or use this.$navigation in vue instance.

  • getRoutes() get the routing records
  • cleanRoutes() clean the routing records
Repositorios relacionados
barbajs/barba

Create badass, fluid and smooth transitions between your website’s pages

TypeScriptnpmMIT Licensetransitionprefetch
barba.js.org
13k497
pujiaxin33/JXCategoryView

A powerful and easy to use category view (segmentedcontrol, segmentview, pagingview, pagerview, pagecontrol) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)

Objective-CMIT Licensecategorypageview
6.2k1.2k
laochiangx/Common.Utility

Various helper class

C#commonutility
5.3k2.2k
cruip/open-react-template

A free React / Next.js landing page template designed to showcase open source projects, SaaS products, online services, and more. Made by

TypeScriptnpmreactreactjs
cruip.com
4.7k2.1k
cruip/tailwind-landing-page-template

Simple Light is a free landing page template built on top of TailwindCSS and fully coded in React / Next.js. Made by

TypeScriptnpmtailwindcssreact
cruip.com
4.5k1.7k
pujiaxin33/JXPagingView

类似微博主页、简书主页等效果。多页面嵌套,既可以上下滑动,也可以左右滑动切换页面。支持HeaderView悬浮、支持下拉刷新、上拉加载更多。

Objective-CMIT Licensepagingviewpage
3k605
pujiaxin33/JXSegmentedView

A powerful and easy to use segmented view (segmentedcontrol, pagingview, pagerview, pagecontrol, categoryview) (腾讯新闻、今日头条、QQ音乐、网易云音乐、京东、爱奇艺、腾讯视频、淘宝、天猫、简书、微博等所有主流APP分类切换滚动视图)

SwiftMIT Licensepagepagecontrol
2.9k419
facade/ignition

A beautiful error page for Laravel apps

PHPPackagistMIT Licenselaravelerror
flareapp.io/docs/ignition-for-laravel/introduction
2.1k178
hoytech/vmtouch

Portable file system cache diagnostics and control

CBSD 3-Clause "New" or "Revised" Licensevirtual-memoryfilesystem-cache
hoytech.com/vmtouch/
1.9k223
issaafalkattan/React-Landing-Page-Template

A simple react one page landing page templates for startups/companies

JavaScriptnpmMIT Licensereactlanding
react-landing-page-template-93ne.vercel.app
1.7k1.2k
Dandarawy/UnityBookPageCurl

Page curl effect for Unity3d using UGUI

C#GNU Lesser General Public License v3.0pagecurl
u3d.as/odF
1.1k196