From 5c07726070b044e01d012fe275e6808143499183 Mon Sep 17 00:00:00 2001 From: Kevin Tam Date: Fri, 10 Jan 2020 09:52:59 +0800 Subject: [PATCH] Fix autoResize https://github.com/statnett/vue-plotly/issues/20 --- src/Plotly.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Plotly.vue b/src/Plotly.vue index f687273..fab9b1b 100644 --- a/src/Plotly.vue +++ b/src/Plotly.vue @@ -83,10 +83,10 @@ export default { methods: { initEvents() { if (this.autoResize) { - this.__resizeListener = () => { + this.__resizeListener = debounce(() => { this.internalLayout.datarevision++ - debounce(this.react, 200) - } + this.react() + }, 200) window.addEventListener('resize', this.__resizeListener) }