Skip to content

Commit 73d2784

Browse files
committed
Add beforeDestroy handlers
1 parent 05b4bca commit 73d2784

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/components/InfoControl.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ export default {
6363
placeholder: this.placeholder
6464
})
6565
}
66+
},
67+
beforeDestroy() {
68+
if (this.parent) {
69+
this.parent.removeLayer(this.mapObject);
70+
}
6671
}
67-
6872
}
6973
</script>
7074
<style>

src/components/ReferenceChart.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export default {
6060
this.parent = parent
6161
this.mapObject.addTo(parent)
6262
}
63+
},
64+
beforeDestroy() {
65+
if (this.parent) {
66+
this.parent.removeLayer(this.mapObject);
67+
}
6368
}
6469
}
6570
</script>

0 commit comments

Comments
 (0)