All Projects → zack24q → Vue Navigation

zack24q / Vue Navigation

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

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Vue Navigation

Vue Page Stack
Routing and navigation for your Vue SPA. Vue 单页应用导航管理器
Stars: ✭ 475 (-48.37%)
Mutual labels:  cache, page, vue-router
Vmtouch
Portable file system cache diagnostics and control
Stars: ✭ 1,341 (+45.76%)
Mutual labels:  cache, page
Transformerslayout
🔥 App金刚区导航菜单,类似淘宝、QQ音乐等APP导航,方格布局横向多行滑动翻页带滚动条
Stars: ✭ 258 (-71.96%)
Mutual labels:  navigation, page
Cleanmywechat
自动删除 PC 端微信缓存数据,包括从所有聊天中自动下载的大量文件、视频、图片等数据内容,解放你的空间。
Stars: ✭ 816 (-11.3%)
Mutual labels:  cache
Compass
🌍 Compass helps you setup a central navigation system for your application
Stars: ✭ 828 (-10%)
Mutual labels:  navigation
Manhuaren
vue2.0全家桶,仿漫画人官网(移动端)
Stars: ✭ 18 (-98.04%)
Mutual labels:  vue-router
Deepcache
Cache design for CNN on mobile
Stars: ✭ 22 (-97.61%)
Mutual labels:  cache
Tailwind Landing Page Template
Simple Light is a free landing page template built on top of TailwindCSS and fully coded in React. Made by
Stars: ✭ 797 (-13.37%)
Mutual labels:  page
Lazycache
An easy to use thread safe in-memory caching service with a simple developer friendly API for c#
Stars: ✭ 901 (-2.07%)
Mutual labels:  cache
Vue Meteor
🌠 Vue first-class integration in Meteor
Stars: ✭ 893 (-2.93%)
Mutual labels:  vue-router
React Native Cached Image
CachedImage component for react-native
Stars: ✭ 890 (-3.26%)
Mutual labels:  cache
Menu
Menu and sidebar management package for Laravel
Stars: ✭ 6 (-99.35%)
Mutual labels:  navigation
Django Sitecats
Django reusable application for content categorization.
Stars: ✭ 18 (-98.04%)
Mutual labels:  navigation
Once
A magic memoization function
Stars: ✭ 821 (-10.76%)
Mutual labels:  cache
Simple Cache
An easy to use Caching trait for Laravel's Eloquent Models.
Stars: ✭ 19 (-97.93%)
Mutual labels:  cache
Vscode Bookmarks
Bookmarks Extension for Visual Studio Code
Stars: ✭ 804 (-12.61%)
Mutual labels:  navigation
Go Reflectx
Go reflection library to find struct field by its tag
Stars: ✭ 19 (-97.93%)
Mutual labels:  cache
Vue Chat
👥Vue全家桶+Socket.io+Express/Koa2打造一个智能聊天室。
Stars: ✭ 887 (-3.59%)
Mutual labels:  vue-router
Vue2 Study
vue 的webpack配置,按需加载,element-ui,vuex
Stars: ✭ 16 (-98.26%)
Mutual labels:  vue-router
Jdf Phone Ui
🖖 前端混合开发整合框架(cordova插件,微信,H5)
Stars: ✭ 18 (-98.04%)
Mutual labels:  vue-router

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
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].