Is is possible to add a 3rd-party script in nuxt.config and load it via trigger? #443
|
Hi all! The title pretty much describes it all. I'm loading external script via nuxt.config, like this: I need to load this script only when a certain button is being clicked. Not sure how to do that. I saw there's an option |
Answered by
harlan-zw
Apr 16, 2025
Replies: 2 comments 1 reply
|
Hey, you should just use the const { load } = useScript('/assets/scripts/swiftype.js', {
triger: 'manual'
})
// ...
load() |
1 reply
Answer selected by
Farmatique
|
Closing as answered — |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, you should just use the
useScript()composable within your app.vue