Skip to content

Commit a275089

Browse files
Adding async
1 parent 01ea912 commit a275089

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/plugin/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { defineAsyncComponent } from 'vue';
12
import type { App } from 'vue';
23
import type { Props } from './types';
34
import './styles/cssVariables.css';
@@ -12,8 +13,9 @@ export const codeBlockOptions = Symbol();
1213
export function createVCodeBlock(options: Props = {}) {
1314
const install = (app: App) => {
1415
app.provide(codeBlockOptions, options);
15-
app.component('CodeBlock', VCodeBlock);
16-
app.component('VCodeBlock', VCodeBlock);
16+
17+
app.component('CodeBlock', defineAsyncComponent(() => import('./VCodeBlock.vue')));
18+
app.component('VCodeBlock', defineAsyncComponent(() => import('./VCodeBlock.vue')));
1719
};
1820

1921
return {

0 commit comments

Comments
 (0)