Skip to content

Commit 1ef8f46

Browse files
committedAug 8, 2024··
feat(custom-element): expose this.$host in Options API
1 parent 775103a commit 1ef8f46

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎packages/runtime-core/src/componentPublicInstance.ts

+2
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ export type ComponentPublicInstance<
313313
$slots: UnwrapSlotsType<S>
314314
$root: ComponentPublicInstance | null
315315
$parent: ComponentPublicInstance | null
316+
$host: Element | null
316317
$emit: EmitFn<E>
317318
$el: any
318319
$options: Options & MergedComponentOptionsOverride
@@ -371,6 +372,7 @@ export const publicPropertiesMap: PublicPropertiesMap =
371372
$refs: i => (__DEV__ ? shallowReadonly(i.refs) : i.refs),
372373
$parent: i => getPublicInstance(i.parent),
373374
$root: i => getPublicInstance(i.root),
375+
$host: i => i.ce,
374376
$emit: i => i.emit,
375377
$options: i => (__FEATURE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type),
376378
$forceUpdate: i =>

0 commit comments

Comments
 (0)
Please sign in to comment.