Skip to content

Commit 203400b

Browse files
committed
test: add async component in example
1 parent bdf6f47 commit 203400b

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

examples/vite-vue3/components.d.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ declare module 'vue' {
66
export interface GlobalComponents {
77
Avatar: typeof import('./src/components/global/avatar.vue')['default']
88
Book: typeof import('./src/components/book/index.vue')['default']
9-
CarbonSvg: typeof import('./src/components/CarbonSvg.svg')['default']
9+
CarbonSvg: typeof import('./src/components/CarbonSvg.svg?component')['default']
1010
ComponentA: typeof import('./src/components/ComponentA.vue')['default']
11+
ComponentAsync: typeof import('./src/components/ComponentAsync.vue')['default']
1112
ComponentB: typeof import('./src/components/ComponentB.vue')['default']
1213
ComponentC: typeof import('./src/components/component-c.vue')['default']
1314
ComponentD: typeof import('./src/components/ComponentD.vue')['default']
14-
IFaSolidDiceFive: typeof import('virtual:icons/fa-solid/dice-five')['default']
15-
IHeroiconsOutlineMenuAlt2: typeof import('virtual:icons/heroicons-outline/menu-alt2')['default']
16-
'IMdi:diceD12': typeof import('virtual:icons/mdi/dice-d12')['default']
17-
IMdiLightAlarm: typeof import('virtual:icons/mdi-light/alarm')['default']
18-
IRiApps2Line: typeof import('virtual:icons/ri/apps2-line')['default']
15+
IFaSolidDiceFive: typeof import('~icons/fa-solid/dice-five')['default']
16+
IHeroiconsOutlineMenuAlt2: typeof import('~icons/heroicons-outline/menu-alt2')['default']
17+
'IMdi:diceD12': typeof import('~icons/mdi/dice-d12')['default']
18+
IMdiLightAlarm: typeof import('~icons/mdi-light/alarm')['default']
19+
IRiApps2Line: typeof import('~icons/ri/apps2-line')['default']
1920
MarkdownA: typeof import('./src/components/MarkdownA.md')['default']
2021
MarkdownB: typeof import('./src/components/MarkdownB.md')['default']
21-
MyCustom: typeof import('./src/CustomResolved.vue')['default']
22+
MyCustom: typeof import('./../../../../../../src/CustomResolved.vue')['default']
2223
Recursive: typeof import('./src/components/Recursive.vue')['default']
2324
UiButton: typeof import('./src/components/ui/button.vue')['default']
2425
UiNestedCheckbox: typeof import('./src/components/ui/nested/checkbox.vue')['default']

examples/vite-vue3/src/App.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang='ts'>
2-
import { ref } from 'vue'
2+
import { ref, defineAsyncComponent } from 'vue'
33
44
const tree = ref({
55
label: 'Top Level',
@@ -9,6 +9,8 @@ const tree = ref({
99
],
1010
})
1111
12+
const ComponentAsync = defineAsyncComponent(() => import('./components/ComponentAsync.vue'))
13+
1214
const rate = ref(2.5)
1315
const radio = ref('1')
1416
</script>
@@ -34,6 +36,11 @@ const radio = ref('1')
3436
<Avatar />
3537
</div>
3638

39+
<div class="block">
40+
<h1>Async (2)</h1>
41+
<ComponentAsync />
42+
</div>
43+
3744
<div class="block">
3845
<h1>Markdown (2)</h1>
3946
<MarkdownA />

examples/vite-vue3/src/components/ComponentA.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
</template>
44

55
<script setup lang='ts'>
6-
import { defineProps } from 'vue'
7-
86
const props = defineProps({
97
msg: String,
108
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div>
3+
This should be import async
4+
</div>
5+
</template>

0 commit comments

Comments
 (0)