瀏覽代碼

use path prefix when loading editor.js for `ui.codemirror` (fixes #3122)

Falko Schindler 11 月之前
父節點
當前提交
bbab081de1
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      nicegui/elements/codemirror.js

+ 2 - 1
nicegui/elements/codemirror.js

@@ -147,7 +147,8 @@ export default {
     },
   },
   async mounted() {
-    this.CM = await import(`${this.resource_path}/editor.js`);
+    await this.$nextTick(); // NOTE: wait for window.path_prefix to be set
+    this.CM = await import(window.path_prefix + `${this.resource_path}/editor.js`);
     const CM = this.CM;
 
     // This is used to prevent emitting the value we just received from the server.