Answer the question
In order to leave comments, you need to log in
How to include a script only in a specific Vue component?
Hello.
How can I connect the script to the user only when a certain component is displayed? (vue route)
Answer the question
In order to leave comments, you need to log in
Drop the some.js script into the assets folder.
And in the created hook of this page component, write:
let someScript = document.createElement('script')
someScript.setAttribute('src', 'some.js')
document.head.appendChild(someScript);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question