From 575f9c3d07ae86269c735bad2b5a8eab110274d4 Mon Sep 17 00:00:00 2001 From: Ubugeeei Date: Tue, 24 Oct 2023 23:40:26 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20#158=20=F0=9F=92=AA=20provide/inject=20?= =?UTF-8?q?between=20VaporComponent=20and=20Component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/vapor/src/App.vue | 3 +- example/vapor/src/Counter.vue | 8 ++- example/vapor/src/MyComponent.vapor.ts | 41 ++++++++++---- packages/runtime-core/apiInject.ts | 13 ++--- packages/runtime-core/component.ts | 4 +- packages/runtime-core/renderer.ts | 78 ++++++++++++++++++++------ packages/vapor/component.ts | 35 +++++++++--- packages/vapor/index.ts | 9 ++- 8 files changed, 142 insertions(+), 49 deletions(-) diff --git a/example/vapor/src/App.vue b/example/vapor/src/App.vue index 1f1a1190..627ab1c9 100644 --- a/example/vapor/src/App.vue +++ b/example/vapor/src/App.vue @@ -1,11 +1,12 @@ diff --git a/example/vapor/src/MyComponent.vapor.ts b/example/vapor/src/MyComponent.vapor.ts index c746f381..23c8c83a 100644 --- a/example/vapor/src/MyComponent.vapor.ts +++ b/example/vapor/src/MyComponent.vapor.ts @@ -1,12 +1,30 @@ -import { effect, h, onMounted, onBeforeMount, ref } from "chibivue"; -import { template, setText, on, createComponent } from "chibivue/vapor"; +import { + type Ref, + effect, + h, + onMounted, + onBeforeMount, + ref, + inject, +} from "chibivue"; + +import { + type VaporComponent, + template, + setText, + on, + createComponent, +} from "chibivue/vapor"; // @ts-ignore import Counter from "./Counter.vue"; const t0 = () => template('