From f75a39de58f8e87c15034d0f926164d9d059e951 Mon Sep 17 00:00:00 2001 From: Natalia Tepluhina Date: Wed, 10 Jul 2019 10:49:23 +0300 Subject: [PATCH 1/2] fix: fixed a type for AsyncComponentFactory component Close #10252 --- types/options.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/options.d.ts b/types/options.d.ts index 3fe7a9b7aa..4fe42e631c 100644 --- a/types/options.d.ts +++ b/types/options.d.ts @@ -26,7 +26,7 @@ export type AsyncComponentPromise, Methods=DefaultMethod ) => Promise | void; export type AsyncComponentFactory, Methods=DefaultMethods, Computed=DefaultComputed, Props=DefaultProps> = () => { - component: AsyncComponentPromise; + component: Promise; loading?: Component | EsModuleComponent; error?: Component | EsModuleComponent; delay?: number; From 3be9e28746724320121534e0de0bb607276d8b67 Mon Sep 17 00:00:00 2001 From: Natalia Tepluhina Date: Sun, 14 Jul 2019 17:51:04 +0300 Subject: [PATCH 2/2] fix: add test for AsyncComponentFactory Close #10252 --- types/test/options-test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/test/options-test.ts b/types/test/options-test.ts index 28060b7c81..4a62047baa 100644 --- a/types/test/options-test.ts +++ b/types/test/options-test.ts @@ -477,5 +477,13 @@ Vue.component('functional-component-v-model', { } }); +Vue.component('async-component-factory', () => ({ + component: import('./es-module'), + loading: Vue.component(''), + error: Vue.component(''), + delay: 100, + timeout: 200 +})) + Vue.component('async-es-module-component', () => import('./es-module'))