You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can delay the loading of the script by using the `trigger` option. This can be useful if you want to load the script after a certain event or time.
170
170
171
-
In this example we'll combine the [useElementScriptTrigger](/docs/api/use-element-script-trigger) composable with the `useScriptNpm` composable to load the script after a certain element is in view.
171
+
In this example we'll combine the [useScriptTriggerElement](/docs/api/use-script-trigger-element) composable with the `useScriptNpm` composable to load the script after a certain element is in view.
Copy file name to clipboardExpand all lines: docs/content/docs/1.guides/1.script-triggers.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,14 +46,14 @@ By default, scripts are loaded when Nuxt is fully hydrated. You can change this
46
46
47
47
## Element Event Triggers
48
48
49
-
The [useElementScriptTrigger](/docs/api/use-element-script-trigger) composable allows you to hook into element events as a way to load script. This is useful for loading scripts when a user interacts with a specific element.
49
+
The [useScriptTriggerElement](/docs/api/use-script-trigger-element) composable allows you to hook into element events as a way to load script. This is useful for loading scripts when a user interacts with a specific element.
Copy file name to clipboardExpand all lines: docs/content/docs/1.guides/3.consent.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,24 +5,24 @@ description: Learn how to get user consent before loading scripts.
5
5
6
6
## Background
7
7
8
-
Many third-party scripts include tracking cookies that require user consent under privacy laws. Nuxt Scripts simplifies this process with the [useConsentScriptTrigger](/docs/api/use-consent-script-trigger) composable, allowing scripts to be loaded only after receiving user consent.
8
+
Many third-party scripts include tracking cookies that require user consent under privacy laws. Nuxt Scripts simplifies this process with the [useScriptTriggerConsent](/docs/api/use-script-trigger-consent) composable, allowing scripts to be loaded only after receiving user consent.
9
9
10
10
## Usage
11
11
12
-
The [useConsentScriptTrigger](/docs/api/use-consent-script-trigger) composable offers flexible interaction options suitable for various scenarios.
12
+
The [useScriptTriggerConsent](/docs/api/use-script-trigger-consent) composable offers flexible interaction options suitable for various scenarios.
13
13
14
-
See the [API](/docs/api/use-consent-script-trigger) docs for full details on the available options.
14
+
See the [API](/docs/api/use-script-trigger-consent) docs for full details on the available options.
15
15
16
16
### Accepting as a Function
17
17
18
-
The easiest way to make use of `useConsentScriptTrigger` is by invoking the `accept` method when user consent is granted.
18
+
The easiest way to make use of `useScriptTriggerConsent` is by invoking the `accept` method when user consent is granted.
19
19
20
20
For an example of how you might lay out your code to handle this, see the following:
@@ -51,12 +51,12 @@ import { agreedToCookiesScriptConsent } from '#imports'
51
51
52
52
### Accepting as a resolvable boolean
53
53
54
-
Alternatively, you can pass a reactive reference to the consent state to the `useConsentScriptTrigger` composable. This will automatically load the script when the consent state is `true`.
54
+
Alternatively, you can pass a reactive reference to the consent state to the `useScriptTriggerConsent` composable. This will automatically load the script when the consent state is `true`.
0 commit comments