From 91abf87f4547daf744ea067933669c612f91098f Mon Sep 17 00:00:00 2001 From: Marco Curatitoli Date: Tue, 10 Jan 2023 12:22:33 +0100 Subject: [PATCH] added emits --- src/components/polygon.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/polygon.js b/src/components/polygon.js index 18f04ec..75f112a 100644 --- a/src/components/polygon.js +++ b/src/components/polygon.js @@ -47,7 +47,7 @@ export default buildComponent({ mappedProps: props, name: 'polygon', ctr: () => google.maps.Polygon, - + emits: events, beforeCreate(options) { if (!options.path) delete options.path if (!options.paths) delete options.paths @@ -55,6 +55,12 @@ export default buildComponent({ afterCreate(inst) { let clearEvents = () => {} + + events.forEach((event)=> { + inst.addListener(event, (payload)=> { + this.$emit(event, payload) + }); + }) // Watch paths, on our own, because we do not want to set either when it is // empty