Skip to content

Commit

Permalink
Adds nuxt module to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-schroeder committed Sep 6, 2023
1 parent 14081b7 commit e7f8e31
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
9 changes: 9 additions & 0 deletions docs/src/components/CodeExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import IconPNPM from "./IconPNPM.vue"
import IconJavaScript from "./IconJavaScript.vue"
import IconSvelte from "./IconSvelte.vue"
import IconAngular from "./IconAngular.vue"
import IconNuxt from "./IconNuxt.vue"
import { computed, ref } from "vue"
import { vAutoAnimate } from "../../../src"
import "../../assets/prism.css"
Expand All @@ -28,6 +29,7 @@ type LanguageOption =
| "yarn"
| "npm"
| "pnpm"
| "nuxt"
type Language = {
ext: "jsx" | "vue" | "html"
Expand Down Expand Up @@ -192,6 +194,13 @@ function copyCode(value: string) {
>
<IconPNPM />pnpm
</li>
<li
v-if="'nuxt' in props.examples"
@click="current = 'nuxt'"
:data-selected="current === 'nuxt' || null"
>
<IconNuxt />Nuxt
</li>
</ul>
</div>
</div>
Expand Down
13 changes: 13 additions & 0 deletions docs/src/components/IconNuxt.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<svg
width="900"
height="900"
viewBox="0 0 900 900"
fill="none"
>
<path
d="M504.908 750H839.476C850.103 750.001 860.542 747.229 869.745 741.963C878.948 736.696 886.589 729.121 891.9 719.999C897.211 710.876 900.005 700.529 900 689.997C899.995 679.465 897.193 669.12 891.873 660.002L667.187 274.289C661.876 265.169 654.237 257.595 645.036 252.329C635.835 247.064 625.398 244.291 614.773 244.291C604.149 244.291 593.711 247.064 584.511 252.329C575.31 257.595 567.67 265.169 562.36 274.289L504.908 372.979L392.581 179.993C387.266 170.874 379.623 163.301 370.42 158.036C361.216 152.772 350.777 150 340.151 150C329.525 150 319.086 152.772 309.883 158.036C300.679 163.301 293.036 170.874 287.721 179.993L8.12649 660.002C2.80743 669.12 0.00462935 679.465 5.72978e-06 689.997C-0.00461789 700.529 2.78909 710.876 8.10015 719.999C13.4112 729.121 21.0523 736.696 30.255 741.963C39.4576 747.229 49.8973 750.001 60.524 750H270.538C353.748 750 415.112 713.775 457.336 643.101L559.849 467.145L614.757 372.979L779.547 655.834H559.849L504.908 750ZM267.114 655.737L120.551 655.704L340.249 278.586L449.87 467.145L376.474 593.175C348.433 639.03 316.577 655.737 267.114 655.737Z"
fill="#00DC82"
/>
</svg>
</template>
9 changes: 9 additions & 0 deletions docs/src/examples/vue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ import { autoAnimatePlugin } from '@formkit/auto-animate/vue'
import App from 'App.vue'
createApp(App).use(autoAnimatePlugin).mount('#app')
`,
},
nuxt: {
language: "typescript",
ext: "ts",
example: `// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@formkit/auto-animate/nuxt'],
})
`,
},
}
Expand Down
7 changes: 4 additions & 3 deletions docs/src/sections/SectionUsage.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup>
import CodeExample from "../components/CodeExample.vue"
import AsideTip from "../components/AsideTip.vue"
import dropdown from "../examples/dropdown"
Expand Down Expand Up @@ -160,7 +160,7 @@ import IconQwik from "../components/IconQwik.vue"
<h2 id="usage-vue">Vue directive</h2>
<p>
Vue users can globally register the
<code>v-auto-animate</code> directive. This makes adding transitions and
<code>v-auto-animate</code> directive or install the Nuxt module. This makes adding transitions and
animations as easy as applying an attribute. Import the Vue plugin from
<code>@formkit/auto-animate/vue</code> and register it with your Vue app:
</p>
Expand Down Expand Up @@ -193,7 +193,8 @@ import IconQwik from "../components/IconQwik.vue"
<a href="usage-disable">enable and disable</a> animations.
</p>
<p>
Import the composable from <code>@formkit/auto-animate/vue</code>, and
Import the composable from <code>@formkit/auto-animate/vue</code> (the
Nuxt will automatically import <code>useAutoAnimate</code> for you), and
call it in <code>script setup</code> to create a
<a
href="https://vuejs.org/guide/essentials/template-refs.html#template-refs"
Expand Down

0 comments on commit e7f8e31

Please sign in to comment.