瀏覽代碼

adhere url prefix with ui.download

Rodja Trappe 1 年之前
父節點
當前提交
2958546c14
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      nicegui/templates/index.html

+ 1 - 1
nicegui/templates/index.html

@@ -214,7 +214,7 @@
 
       function download(src, filename) {
         const anchor = document.createElement("a");
-        anchor.href = typeof src === "string" ? src : URL.createObjectURL(new Blob([src]));
+        anchor.href = typeof src === "string" ? "{{ prefix | safe }}" + src : URL.createObjectURL(new Blob([src]));
         anchor.target = "_blank";
         anchor.download = filename || "";
         document.body.appendChild(anchor);