Skip to content

Commit

Permalink
docs: broken tutorial, put some use into scriptOptions (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ky6uk authored Jul 16, 2024
1 parent 78a3145 commit be0f5b9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions docs/content/docs/1.getting-started/3.confetti-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@ useScriptNpm({
packageName: 'js-confetti',
file: 'dist/js-confetti.browser.js',
version: '0.12.0',
// tell useScript how to resolve the third-party script
use() {
return { JSConfetti: window.JSConfetti }
scriptOptions: {
// tell useScript how to resolve the third-party script
use() {
return { JSConfetti: window.JSConfetti }
},
},
})
</script>
Expand All @@ -113,8 +115,10 @@ const { $script } = useScriptNpm({
packageName: 'js-confetti',
file: 'dist/js-confetti.browser.js',
version: '0.12.0',
use() {
return { JSConfetti: window.JSConfetti }
scriptOptions: {
use() {
return { JSConfetti: window.JSConfetti }
},
},
})
onMounted(() => {
Expand All @@ -133,7 +137,9 @@ const { addConfetti } = useScriptNpm({
packageName: 'js-confetti',
file: 'dist/js-confetti.browser.js',
version: '0.12.0',
use: () => typeof window.JSConfetti !== 'undefined' && new window.JSConfetti()
scriptOptions: {
use: () => typeof window.JSConfetti !== 'undefined' && new window.JSConfetti()
}
})
onMounted(() => {
// just works
Expand Down

0 comments on commit be0f5b9

Please sign in to comment.