Reputation: 147
Using Sappers export feature to build a static site, I would love to be able to use JavaScript libraries like Conversational Form and GSAP. Trying to add them to client.js
or my components, I can't access the window
object.
How do I best approach this?
Upvotes: 9
Views: 3028
Reputation: 29585
The standard way is to import
those libraries into your components:
<script>
import { TweenMax, Power2, TimelineLite } from 'gsap';
export default {
oncreate() {
// use GSAP in here, or in custom methods
}
};
</script>
Upvotes: 15