aos
aos copied to clipboard
Vue 3 everything animates immediately as soon as page loads
This is:
- Bug
Specifications
- Browser: Firefox, Chrome
Expected Behavior
Element loads when it gets scrolled to
Actual Behavior
Everything animates as soon as page loads. when I refresh page i see animation happen but it happens everywhere not just to elements that are in viewport
Steps to Reproduce the Problem
- vue create test (vue 3 default config)
- npm install aos
- //main.js import { createApp } from 'vue' import App from './App.vue' const app = createApp(App) import AOS from "aos"; import "aos/dist/aos.css"; app.AOS = new AOS.init({ disable: "phone" }); app.mount('#app')
- anything i write no matter where gets animated as soon as page loads
any solution ?
nice!😑
In main.js file, you need to use AOS as following :
import { createApp } from 'vue' import App from './App.vue' import AOS from "aos"; import "aos/dist/aos.css";
const app = createApp(App)
app.AOS = new AOS.init({ disable: "phone" });
app.use(AOS).mount('#app')