英文:
how to implement simple uppy fileuploader
问题
这个简单的例子不能工作。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Uppy文件上传示例</title>
<link href="https://releases.transloadit.com/uppy/v3.7.0/uppy.min.css" rel="stylesheet">
</head>
<body>
<!-- 2. 初始化 -->
<div id="uppy"></div>
<script type="module">
import { Uppy, DragDrop } from "https://releases.transloadit.com/uppy/v3.7.0/uppy.min.js"
const uppy = new Uppy()
uppy.use(DragDrop, { target: '#uppy' })
</script>
</body>
</html>
Uncaught SyntaxError SyntaxError: 请求的模块 'https://releases.transloadit.com/uppy/v3.7.0/uppy.min.js' 未提供名为 'DragDrop' 的导出项
at (program) (c:\Users\belos\source\repos\testUppy\index.html:14:22)
我尝试过更改名称并查看文档,但它不起作用,我没有找到任何解决方案。
英文:
this simple example does not work.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Uppy File Uploader Example</title>
<link href="https://releases.transloadit.com/uppy/v3.7.0/uppy.min.css" rel="stylesheet">
</head>
<body>
<!-- 2. Initialize -->
<div id="uppy"></div>
<script type="module">
import { Uppy, DragDrop } from "https://releases.transloadit.com/uppy/v3.7.0/uppy.min.js"
const uppy = new Uppy()
uppy.use(DragDrop, { target: '#uppy' })
</script>
</body>
</html>
Uncaught SyntaxError SyntaxError: The requested module 'https://releases.transloadit.com/uppy/v3.7.0/uppy.min.js' does not provide an export named 'DragDrop'
at (program) (c:\Users\belos\source\repos\testUppy\index.html:14:22)
i tried to change names and check docs but it does not work i did not find any solution
答案1
得分: 0
我更改了链接,将文档中写的链接更改为这里的链接,这解决了我的问题。
英文:
import {
Uppy,
Dashboard,
Webcam,
Tus,
}
from "https://releases.transloadit.com/uppy/v3.10.0/uppy.min.mjs";
I changed link from which is writen in docs to link here and it solved my issue
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论