
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
github.com/zack24q/vue-navigation
Advanced tools
require vue
2.xand vue-router2.x.
vue-navigation default behavior is similar to native mobile app (A、B、C are pages):
!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.
npm i -S vue-navigation
or
yarn add vue-navigation
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>
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.
Only router is required.
Vue.use(Navigation, {router, store, moduleName: 'navigation', keyName: 'VNK'})
functions: [ on | once | off ]
event types: [ forward | back | replace | refresh | reset ]
parameter( to | from ) properties:
name
route
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', () => {})
Use Vue.navigation in global environment or use this.$navigation in vue instance.
getRoutes() get the routing recordscleanRoutes() clean the routing recordsFAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.