From: Evan You Date: Thu, 8 Aug 2024 04:40:40 +0000 (+0800) Subject: feat(custom-element): expose this.$host in Options API X-Git-Tag: v3.5.0-beta.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ef8f46af0cfdec2fed66376772409e0aa25ad50;p=thirdparty%2Fvuejs%2Fcore.git feat(custom-element): expose this.$host in Options API --- diff --git a/packages/runtime-core/src/componentPublicInstance.ts b/packages/runtime-core/src/componentPublicInstance.ts index 9ab6df52d6..ac0b910dc2 100644 --- a/packages/runtime-core/src/componentPublicInstance.ts +++ b/packages/runtime-core/src/componentPublicInstance.ts @@ -313,6 +313,7 @@ export type ComponentPublicInstance< $slots: UnwrapSlotsType $root: ComponentPublicInstance | null $parent: ComponentPublicInstance | null + $host: Element | null $emit: EmitFn $el: any $options: Options & MergedComponentOptionsOverride @@ -371,6 +372,7 @@ export const publicPropertiesMap: PublicPropertiesMap = $refs: i => (__DEV__ ? shallowReadonly(i.refs) : i.refs), $parent: i => getPublicInstance(i.parent), $root: i => getPublicInstance(i.root), + $host: i => i.ce, $emit: i => i.emit, $options: i => (__FEATURE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type), $forceUpdate: i =>