我如何从我的 jQuery 块中引用 DirectUpload js class?
How can i reference the DirectUpload js class from my jQuery block?
我的布局有:
//= require activestorage
现在在我的 jQuery 中,我正在尝试引用 DirectUpload class:
// Instantiate the DirectUploader object
const upload = new DirectUpload(file, url)
我目前收到此错误:
Uncaught ReferenceError: DirectUpload is not defined
at new:210
您可以使用 ActiveStorage
命名空间引用 DirectUpload
class。
例如,
new class ActiveStorage.DirectUpload(...)
我的布局有:
//= require activestorage
现在在我的 jQuery 中,我正在尝试引用 DirectUpload class:
// Instantiate the DirectUploader object
const upload = new DirectUpload(file, url)
我目前收到此错误:
Uncaught ReferenceError: DirectUpload is not defined at new:210
您可以使用 ActiveStorage
命名空间引用 DirectUpload
class。
例如,
new class ActiveStorage.DirectUpload(...)