Merge pull request #54 from oliverkirsch/circle-rectangle-emits

Add "emits" to circle and rectangle and register listener to actively…
This commit is contained in:
Nathan A. Paludo
2023-02-24 09:04:58 -03:00
committed by GitHub
2 changed files with 16 additions and 0 deletions

View File

@@ -43,4 +43,12 @@ export default buildComponent({
name: 'circle', name: 'circle',
ctr: () => google.maps.Circle, ctr: () => google.maps.Circle,
events, events,
emits: events,
afterCreate(inst) {
events.forEach((event) => {
inst.addListener(event, (payload) => {
this.$emit(event, payload)
})
})
}
}) })

View File

@@ -38,4 +38,12 @@ export default buildComponent({
name: 'rectangle', name: 'rectangle',
ctr: () => google.maps.Rectangle, ctr: () => google.maps.Rectangle,
events, events,
emits: events,
afterCreate(inst) {
events.forEach((event) => {
inst.addListener(event, (payload) => {
this.$emit(event, payload)
})
})
}
}) })