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 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 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.
-
|
Closing as answered — |
Beta Was this translation helpful? Give feedback.
Hey, you should just use the
useScript()composable within your app.vue