We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01ea912 commit a275089Copy full SHA for a275089
src/plugin/index.ts
@@ -1,3 +1,4 @@
1
+import { defineAsyncComponent } from 'vue';
2
import type { App } from 'vue';
3
import type { Props } from './types';
4
import './styles/cssVariables.css';
@@ -12,8 +13,9 @@ export const codeBlockOptions = Symbol();
12
13
export function createVCodeBlock(options: Props = {}) {
14
const install = (app: App) => {
15
app.provide(codeBlockOptions, options);
- app.component('CodeBlock', VCodeBlock);
16
- app.component('VCodeBlock', VCodeBlock);
+
17
+ app.component('CodeBlock', defineAsyncComponent(() => import('./VCodeBlock.vue')));
18
+ app.component('VCodeBlock', defineAsyncComponent(() => import('./VCodeBlock.vue')));
19
};
20
21
return {
0 commit comments