A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.npmjs.com/package/vue-nav below:

vue-nav - npm

vue-nav1.1.5 • Public • Published 8 years ago

vue-nav

The library is a navigation manager, it is similar to native mobile app.

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

中文文档

Function Attention

This Plugin just manage the page instance of navigation stack, it will not change the history of browser. So browser history is just as like as vue-router

Install

npm install --save vue-nav

Usage

main.js

import Vue from 'vue'

import router from './router' 

import Navigation from 'vue-nav'

Vue.use(Navigation, {router})

App.vue

<template>

  <navigation>

    <router-view></router-view>

  </navigation>

</template>

Use Single Page

<script>

  import ...

 

  export default {

    stackType: 'single'

    ...

  }

</script>

Use with vuex2

main.js

import Vue from 'vue'

import router from './router' 

import store from './store' 

import Navigation from 'vue-nav'

Vue.use(Navigation, {router, store})

App.vue

You can use stack.direction to control transition. stack.direction is mapped from vuex state

<template>

  <transition :name="'router-' + stack.direction">

    <navigation>

      <router-view></router-view>

    </navigation>

  </transition>

</template>

<script>

  export default {

    ....

    computed: {

      ...mapState([

        'stack'

      ])

    }

    ....

  }

</script>

<style>

  .router-backward-enter-active,

  .router-forward-enter-active,

  .router-backward-leave-active,

  .router-forward-leave-active {

    will-change: transform;

    transition: all 500ms ease-out;

    height: 100%;

    width: 100%;

    position: absolute;

    backface-visibility: hidden;

  }

 

  .router-backward-enter {

    opacity: 1;

    transform: translate3d(-50%, 0, 0);

  }

 

  .router-backward-leave-active {

    opacity: 0.5;

    z-index: 100;

    transform: translate3d(100%, 0, 0);

  }

 

  .router-forward-enter {

    opacity: 1;

    transform: translate3d(100%, 0, 0);

  }

 

  .router-forward-leave-active {

    opacity: 0.5;

    transform: translate3d(-50%, 0, 0);

  }

</style>

Thanks

Thank vue-navigation, it open my mind to make this

Package Sidebar Install Downloads Weekly Downloads Collaborators

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4