瀏覽代碼

register event handlers once after every newPlot call

Brian Benjamin Maranville 1 年之前
父節點
當前提交
7862f1a427
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      nicegui/elements/plotly.vue

+ 1 - 1
nicegui/elements/plotly.vue

@@ -7,7 +7,6 @@ export default {
   async mounted() {
     await this.$nextTick();
     this.update();
-    this.set_handlers();
   },
   updated() {
     this.update();
@@ -24,6 +23,7 @@ export default {
         Plotly.react(this.$el.id, this.options.data, this.options.layout);
       } else {
         Plotly.newPlot(this.$el.id, this.options.data, this.options.layout, options.config);
+        this.set_handlers();
       }
 
       // store last options