Skip to content

Commit 018896c

Browse files
Change to use async
1 parent bb9d855 commit 018896c

File tree

2 files changed

+33
-3
lines changed

2 files changed

+33
-3
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Change Log
22
All notable changes to the "vuetify-inline-fields" plugin will be documented in this file.
33

4+
## v1.0.7
5+
2024-03-13
6+
[main] (@webdevnerdstuff)
7+
* Change component to use `defineAsyncComponent`
8+
49
## v1.0.6
510
2024-02-26
611
[main] (@webdevnerdstuff)

src/plugin/index.ts

+28-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { defineAsyncComponent } from 'vue';
12
import { App } from 'vue';
23
import './styles/main.scss';
34
import type { SharedProps } from './types';
@@ -12,9 +13,33 @@ export function createVInlineFields(options: Omit<SharedProps,
1213
const install = (app: App) => {
1314
app.provide(globalOptions, options);
1415

15-
for (const key in VInlineFields) {
16-
app.component(key, VInlineFields[key]);
17-
}
16+
app.component('VInlineAutocomplete', defineAsyncComponent(
17+
() => import('./components/VInlineAutocomplete/VInlineAutocomplete.vue'))
18+
);
19+
20+
app.component('VInlineCheckbox', defineAsyncComponent(
21+
() => import('./components/VInlineCheckbox/VInlineCheckbox.vue'))
22+
);
23+
24+
app.component('VInlineCustomField', defineAsyncComponent(
25+
() => import('./components/VInlineCustomField/VInlineCustomField.vue'))
26+
);
27+
28+
app.component('VInlineSelect', defineAsyncComponent(
29+
() => import('./components/VInlineSelect/VInlineSelect.vue'))
30+
);
31+
32+
app.component('VInlineSwitch', defineAsyncComponent(
33+
() => import('./components/VInlineSwitch/VInlineSwitch.vue'))
34+
);
35+
36+
app.component('VInlineTextarea', defineAsyncComponent(
37+
() => import('./components/VInlineTextarea/VInlineTextarea.vue'))
38+
);
39+
40+
app.component('VInlineTextField', defineAsyncComponent(
41+
() => import('./components/VInlineTextField/VInlineTextField.vue'))
42+
);
1843
};
1944

2045
return { install };

0 commit comments

Comments
 (0)