formkit / auto-animate

A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application.

Home Page:https://auto-animate.formkit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does it support Vue2?

lujunjian1570 opened this issue · comments

Does it support Vue2?

Sure, but no directive has been written for it. Youll just need to manually use the autoAnimate function.

Vue2 working example:
https://codesandbox.io/p/sandbox/priceless-thunder-m89xo6?file=%2Fsrc%2FApp.vue%3A3%2C9-3%2C23

import Vue from "vue";
import App from "./App.vue";
import autoAnimate from "@formkit/auto-animate";

Vue.config.productionTip = false;

Vue.directive("auto-animate", {
  inserted: function (el, binding) {
    autoAnimate(el, binding.value);
  }
});

new Vue({
  render: (h) => h(App)
}).$mount("#app");