Skip to content

Commit

Permalink
fix: 修复子组件在父组件setup时无法获取$scope字段 ask 199111
Browse files Browse the repository at this point in the history
fix: 修复子组件在父组件setup时无法获取$scope字段 ask 199111
  • Loading branch information
bfc846958672 authored and fxy060608 committed Sep 29, 2024
1 parent 15f52ad commit fce4567
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1115,10 +1115,13 @@ export function getExposeProxy(instance: ComponentInternalInstance) {
return target[key]
} else if (key in publicPropertiesMap) {
return publicPropertiesMap[key](instance)
} else if (key === '$scope') {
// TODO 临时补充$scope 字段,后续通过publicPropertiesMap 字段补充。ask:199111
return instance.ctx.$scope
}
},
has(target, key: string) {
return key in target || key in publicPropertiesMap
return key in target || key in publicPropertiesMap || key === '$scope'
},
}))
)
Expand Down

0 comments on commit fce4567

Please sign in to comment.