npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-router-dom-cache

v1.3.2

Published

基础vue-router开发了新组件router-views,用于SPA切换路由时保存之前页面的dom,效果类似framework7的实现方式,同样也类似于子路由的方式,但是本组件不是嵌套组件,而是并列。详细效果可以查看examples中的router-views demo

Downloads

9

Readme

vue-router-dom-cache Build Status

基于vue-router v3.0.2的二次开发,主要是为了实现路由切换后,保存历史页面的dom,配合页面转场动画效果,实现类似ios原生切换的效果。

注意:目前只是针对mode: 'hash'、'history' 模式的路由做了处理,'abstract'模式和不支持history api的浏览器未做处理。如果有问题或者有需要可以与我们 联系,我们会继续完善这个项目。

Introduction

vue-router-dom-cache 是为了能让移动端上使用vue+vue-router的应用可以实现 ios 上原生应用的效而开发的,在vue-router v3.0.2的基础上,增加了router-views组件,并在router实例上增加了direction 属性,用于判断页面跳转方向, direction 的值有:

  • forward:通过调用 this.$router.push(args) 或者 window.history.go(n) n>0
  • back:通过调用 this.$router.back() 或者 window.history.go(n) n<0
  • refresh:通过调用 this.$router.replace(args) 或者 window.history.go(0)
  • replace:通过调用 this.$router.replace()

Usage

# install deps
npm install vue-router-dom-cache

# import 
import VueRouter from 'vue-router-dom-cache'

# use plugins
Vue.use(VueRouter)

# use router-views in template
<router-views class="view"/>

# add global animate css 
//以下样式为页面切换的效果动画,效果参数可以自己定义
.router-slid-enter-active{
    transition:all .3s linear;
}

.router-slid-leave-active{
    transition:all .3s linear;
}

.router-slid-enter, .router-slid-leave-to{
    transform:translate3d(100%, 0, 0);
}

.fade-enter-active, .fade-leave-active {
  transition: opacity .5s ease;
}

.fade-enter, .fade-leave-active {
  opacity: 0;
}

.cached {
  display: none
}

//.view 为 demo 中演示的非必须样式,可以不加,根据具体的场景自己定义
.view {
  box-sizing: border-box;
  position: absolute;
  left: 0;
  top: 250px;
  background: #efeff4;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  width: 100%;
  height: 100%;
}

License

MIT

Copyright (c) 2018-present ideacome-f2e