Skip to content

Commit

Permalink
add the ability to get areaContent
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurtil committed Jun 18, 2020
1 parent bb6819b commit ad12240
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Areas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default {
refInFor: true,
key: `teleportArea${areaContent.id}` // needed to do not rerender components
},
[h(areaContent.component, { ...areaContent.cfg })]
[h(areaContent.component, areaContent.cfg)]
)
: null
)
Expand Down
3 changes: 3 additions & 0 deletions src/Teleport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export default {
get areas() {
return self.areas;
},
get areaContent() {
return this.areas.areasContent[self.targetId];
},
onChange(handler) {
if (typeof handler !== "function") {
throw `onAreaChange only accept function, get "${typeof handler}"`;
Expand Down

0 comments on commit ad12240

Please sign in to comment.