Skip to content

Commit

Permalink
chore: provide aos methods from plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
BayBreezy committed Jan 11, 2024
1 parent 254db5b commit fde232d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/runtime/plugin.ts
Expand Up @@ -5,7 +5,17 @@ import "aos/dist/aos.css";

export default defineNuxtPlugin((nuxtApp) => {
const config = useRuntimeConfig();
if (typeof window !== "undefined") {
nuxtApp.AOS = AOS.init(config.public?.aos || {});
}
AOS.init(config.public.aos || {});

// refresh function
const refreshAos = () => AOS.refresh();
// refreshHard function
const refreshHardAos = () => AOS.refreshHard();

return {
provide: {
refreshAos,
refreshHardAos,
},
};
});

0 comments on commit fde232d

Please sign in to comment.