Skip to content

Commit

Permalink
feat(custom-element): expose this.$host in Options API
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 8, 2024
1 parent 775103a commit 1ef8f46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/runtime-core/src/componentPublicInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ export type ComponentPublicInstance<
$slots: UnwrapSlotsType<S>
$root: ComponentPublicInstance | null
$parent: ComponentPublicInstance | null
$host: Element | null
$emit: EmitFn<E>
$el: any
$options: Options & MergedComponentOptionsOverride
Expand Down Expand Up @@ -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 =>
Expand Down

0 comments on commit 1ef8f46

Please sign in to comment.