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

vueg

v1.4.5

Published

[Vue] 页面级的转场动画插件

Downloads

153

Readme

Example:

使用方法

安装插件

npm i vueg --save

引入插件

import vueg from 'vueg'

Vue.use(vueg, new Router(), Options) // 传入实例化后的router,和插件的全局配置

插件指令

插件注册了名为v-transition的指令,接收一个Options参数,其包含的配置优先级高于全局配置。

启用插件:

router-view添加v-transition指令后,该router-view下所有的页面都将启用动画:

<router-view v-transition></router-view>

或,为template中的顶级标签添加v-transition指令后,该页面组件将启用动画效果:

<template>
    <page v-transition>
    </page>
</template>

支持Nuxt。


Options

@property {number} duration 动画时长。默认为0.3
@property {string} enter 入场动画,默认为'fadeInRight'
@property {string} leave 离场动画,默认为'fadeInLeft'
@property {boolean} disableAtSameDepths 深度相同时禁用动画(通过url中的反斜杠数量/判断)。默认为false
@property {boolean} shadow 是否为入场页面添加阴影。默认为true
@property {Object} map 有时候通过url判断的转场类型可能并不是你想要的,这时你可以使用map选项。
指定路由A到路由A/B/C的转场类型是enter还是leave,覆盖通过url深度判断的转场类型。
下面例子表示,从名为`user-login`的路由到名为`user-regiseter`的路由转场,使用入场动画,顺序反转则使用离场动画。
从名为`user-login`的路由到名为`index`的路由转场,使用离场动画,顺序反转则使用入场动画。
从名为`user-login`的路由到名为`user-login-sms`的路由转场,禁用转场动画。
例子:`
map: {
 'user-login':{
  enter: ['user-register'],
  leave: ['index'],
  disable: ['user-login-sms']
  }
 }
 `
 默认为{}。

enterleave 参数使用的animate.css的动画类名作为值,查看全部可用值,请访问:https://daneden.github.io/animate.css。 另外插件自带了一个可用值 touchPoint,动画效果为页面从触摸(点击)点放大入场。

其他

为了方便使用者查看、修改源代码、提交PR,本插件直接导出包,未经webpack构建;而源码中使用了ES6语法,所以你的项目需要支持ES6语法(比如Array.includes)。

协议

ISC