Vue plugin for AOS (Animate on scroll library)
npm install v-aosVue plugin for AOS (animate on scroll library)
``bash`
npm i v-aos --save
`js
import Vue from 'vue'
import VAos from 'v-aos'
Vue.use(VAos);
`
With AOS init settings :
`js`
Vue.use(VAos, {
startEvent: 'DOMContentLoaded',
duration: 400,
delay: 100
})
`html`
Hello world
With flags:
`html`
Hello world
With parameters:
`html`
Hello world
plugins/v-aos.js:
`js
import Vue from 'vue'
import VAos from 'v-aos'
Vue.use(VAos);
`
nuxt.config.js:
`js`
plugins: [
{ src: '~/plugins/v-aos', mode: 'client' },
]
AOS object can be accessed through $aos property in components or through window.AOS
`js`
export default {
mounted() {
this.$aos.refreshHard()
}
}
`html``
MIT