瀏覽代碼

wait for plotly to be loaded (fixes #3784)

Falko Schindler 8 月之前
父節點
當前提交
9598efd8ae
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      nicegui/elements/plotly.vue

+ 6 - 0
nicegui/elements/plotly.vue

@@ -13,6 +13,12 @@ export default {
   },
   methods: {
     update() {
+      // wait for plotly to be loaded
+      if (typeof Plotly === "undefined") {
+        setTimeout(this.update, 10);
+        return;
+      }
+
       // default responsive to true
       const options = this.options;
       if (options.config === undefined) options.config = { responsive: true };