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.
https://auto-animate.formkit.com
MIT License
11.96k stars 210 forks source link

Does it support Vue2? #165

Closed lujunjian1570 closed 9 months ago

lujunjian1570 commented 9 months ago

Does it support Vue2?

justin-schroeder commented 9 months ago

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

SnakeO commented 7 months ago

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");