Is is possible to add a 3rd-party script in nuxt.config and load it via trigger? #443
Answered
by
harlan-zw
Farmatique
asked this question in
Q&A
-
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 |
Beta Was this translation helpful? Give feedback.
Answered by
harlan-zw
Apr 16, 2025
Replies: 1 comment 1 reply
-
Hey, you should just use the const { load } = useScript('/assets/scripts/swiftype.js', {
triger: 'manual'
})
// ...
load() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Farmatique
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