Skip to content

Commit 3ba594d

Browse files
committed
add(vue): docs page
1 parent aa2ed2a commit 3ba594d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Vue only
2+
3+
Since Version `1.2.1` you can also use this module for Vue - instead of Nuxt.
4+
5+
::alert{type="info"}
6+
This feature is still experimental and to use with caution.
7+
Please report any issues on the [Github Issues Tab](https://github.com/holux-design/v-gsap-nuxt/issues)
8+
::
9+
10+
## 1. Install package
11+
12+
To use with Vue, do not use the auto-install command, since this is a nuxt-specific module install. Instead install the package itself through npm:
13+
14+
```bash [npx]
15+
npm i v-gsap-nuxt
16+
```
17+
18+
## 2. Import directive
19+
20+
In the second step go to your `main.ts` file for your vue app, import the Vue plugin and add it to your app **after initialization and before mount**:
21+
22+
::code-group
23+
24+
```ts [main.ts]
25+
import { vGsapVue } from 'v-gsap-nuxt/vue';
26+
27+
// const app = createApp(App);
28+
app.directive('gsap', vGsapVue());
29+
// app.mount('#app');
30+
::
31+
32+
33+
## Configuration
34+
35+
Since global configuration for nuxt happens in `nuxt.config.ts` which is not available in Vue, you can add these settings directly during initialization. All props are the same as with nuxt.
36+
37+
::code-group
38+
39+
```ts [main.ts]
40+
app.directive('gsap', vGsapVue({
41+
presets: [],
42+
breakpoint: 768,
43+
scroller: '',
44+
composable: true
45+
}));
46+
::
47+
48+
[See reference](/installation/configuration)

0 commit comments

Comments
 (0)