I'm testing an API that helps me with the project I'm working on, and it's possible to install your NPM, its name is "parallax-js", so I looked for how to import, however I didn't have any results in my research, and I can't understand how I import an external script into VUE.
Here's the way I'm trying to put my project together in VUE.
APP VUE
<template>
<div id="app">
<img alt="Vue logo" src="./assets/logo.png" data-depth="0.2">
<HelloWorld msg="Welcome to Your Vue.js App" data-depth="0.2"/>
{{alpha()}}
</div>
</template>
<script>
import HelloWorld from './components/HelloWorld.vue'
import '../node_modules/parallax-js/src/parallax.js'
export default {
name: 'App',
components: {
HelloWorld
},
methods : {
alpha(){
let scene = document.getElementById('app');
let parallaxInstance = new Parallax(scene);
}
}
}
</script>
The point is ... I want to know how to learn the best way to import an external script ... and how I use the variables and objects inside that script.
new Parallax(scene)