Skip to content

Commit 959e8a7

Browse files
committed
chore(feature): add autoAnimate plugin
1 parent b7fd077 commit 959e8a7

File tree

3 files changed

+45
-2
lines changed

3 files changed

+45
-2
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@
4040
"docs:serve": "vitepress serve docs"
4141
},
4242
"dependencies": {
43+
"@formkit/addons": "^1.4.0",
4344
"@formkit/i18n": "^1.4.0",
4445
"@formkit/vue": "^1.4.0",
46+
"add": "^2.0.6",
4547
"primeicons": "^6.0.1",
4648
"primevue": "^3.43.0"
4749
},

pnpm-lock.yaml

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/formkit.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
import { defaultConfig, plugin } from '@formkit/vue'
2+
import { createAutoAnimatePlugin } from '@formkit/addons'
23

34
import { de, en } from '@formkit/i18n'
45
import type { UserModule } from '@/types'
56
import { primeInputs } from '@/formkit'
67

7-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8-
export const install: UserModule = ({ app, router, isClient }) => {
8+
export const install: UserModule = ({ app }) => {
99
app.use(plugin, defaultConfig({
1010
locales: { de, en },
1111
// Define the active locale
1212
locale: 'en',
1313
inputs: primeInputs,
14+
plugins: [
15+
createAutoAnimatePlugin(
16+
{
17+
/* optional AutoAnimate config */
18+
// default:
19+
duration: 250,
20+
easing: 'ease-in-out',
21+
delay: 0,
22+
},
23+
{
24+
/* optional animation targets object */
25+
// default:
26+
global: ['outer', 'inner'],
27+
form: ['form'],
28+
repeater: ['items'],
29+
},
30+
),
31+
],
1432
}))
1533
}
1634

0 commit comments

Comments
 (0)