From 6055a3d39970dcc2dd680dcf1f77221275209ff5 Mon Sep 17 00:00:00 2001 From: rozetko Date: Wed, 27 Jul 2022 20:10:20 +0300 Subject: [PATCH] Vue: fix component destroy error --- src/VueChartwerkPodMixin.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/VueChartwerkPodMixin.ts b/src/VueChartwerkPodMixin.ts index 322a883..2055738 100644 --- a/src/VueChartwerkPodMixin.ts +++ b/src/VueChartwerkPodMixin.ts @@ -32,7 +32,9 @@ export default { this.renderChart(); }, destroyed() { - this.pod.removeEventListeners(); + if(this.pod) { + this.pod.removeEventListeners(); + } this.pod = undefined; }, methods: {