For my first project utilizing vue-cli and webpack, I am facing a challenge in integrating an external JavaScript library.
The library in question is Intro.js, which only requires me to import intro.js, add specific tags to HTML elements, and execute the introJs().start() function.
To begin, I installed the library using npm install introj.js --save
Next, I imported the library by including import introJS from 'intro.js'
within the <script>
section of my App.vue
file.
Upon inspecting the compiled app.js
file, I confirmed that introJS was successfully compiled, indicating no issues there.
My concern lies in where to place the introJs().start()
function call. Initially, I attempted placing it within the mounted()
function of the App.vue
file, but encountered difficulties.
Furthermore, when executing introJS().start()
from the mounted()
method in App.vue
, I encountered this error:
Error in mounted hook: "TypeError: __WEBPACK_IMPORTED_MODULE_7_intro_js___default(...) is not a function"