vue-parent-change-transition

Animate a child component when it's parent changed.
13,337 27
Install
npm install vue-parent-change-transition
Latest Version:1.0.0
Vue:2
License:MIT
Last Updated:Jun 9, 2018
Links: GitHub  ·  npm
Maintainer: inamori

vue-parent-change-transition

MIT License NPM

Enable a child components to animate when it changes the parent.

It'll be useful when you create a card game.

(e.g. show transition of a card which move from deck to your hand)

Live Demo

Live Demo

demo

when you click a rect, the rect moves to another parent and show transit animation.

Installation

npm i vue-parent-change-transition --save

Usage

日本語記事

parent

<template>
  <div class="place">
    <child v-for="childId in model.children" :id="childId" :placeId="model.id" :key="childId" />
  </div>
</template>

child

<template>
  <parent-change-transition :idPropertyName="'childId'" :duration="300">
    <div class="child" @click="changeParent"></div>
  </parent-change-transition>
</template>

<script>
...
methods: {
  changeParent () {
    // move to under another parent
  }
}

computed: {
  childId () {
    // return the property which identify this data model
    // you can change this key via "idPropertyName" props
  }
}
</script>

Related Packages

vue-animate

LESS cross-browser animation library, for use with Vue.js. Ported from Animate.c...

15,409 184
vueg

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

3,786 1,039
animate4vue

A library for ready-to-use animations designed for Vue.js applications, featurin...

2,734 15
@morev/vue-transitions

Shareable Vue transitions library

412,603 222
vue-starport

Shared Vue component across routes with animations

57,522 1,949

Version History

Version Released Vue License
1.0.0 ^2.5.11 MIT
0.0.1 ^2.5.11 MIT