Skip to content

Commit b22ab30

Browse files
committed
fix(components): add as plugin
1 parent 8d074ef commit b22ab30

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

components.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './dist/components'

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sfxcode/formkit-primevue",
3-
"version": "1.8.3",
3+
"version": "1.8.4",
44
"type": "module",
55
"license": "MIT",
66
"repository": "https://github.com/sfxcode/formkit-primevue",
@@ -52,6 +52,7 @@
5252
}
5353
},
5454
"files": [
55+
"components.d.ts",
5556
"dist",
5657
"*.css",
5758
"*.scss"

src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { FormKitTypeDefinition } from '@formkit/core'
22
import { createInput } from '@formkit/vue'
3+
import type { Plugin } from 'vue'
34

45
import PrimeAutoComplete from './components/PrimeAutoComplete.vue'
56
import PrimeCalendar from './components/PrimeCalendar.vue'
@@ -28,6 +29,17 @@ import PrimeTriStateCheckbox from './components/PrimeTriStateCheckbox.vue'
2829

2930
import { useFormKitSchema } from './composables'
3031

32+
import * as components from './components'
33+
34+
const install: Plugin = {
35+
install(app) {
36+
for (const key of Object.keys(components))
37+
app.component(key, components[key as keyof typeof components])
38+
},
39+
}
40+
41+
export default install
42+
3143
export const primeAutoCompleteDefinition: FormKitTypeDefinition = createInput(PrimeAutoComplete, {
3244
props: [],
3345
})

0 commit comments

Comments
 (0)