我的配置是:
self.editor = new $window.PhotoEditorSDK.UI.ReactUI({
container,
responsive: true,
license: JSON.stringify(sdkLicenseData),
assets: {
baseUrl: '/dist/photoeditorsdk/assets/',
},
editor: {
image: img,
},
style: {
width: 800,
height: 800,
},
enableExport: true,
export: {
type: $window.PhotoEditorSDK.ImageFormat.IMAGE,
quality: 1.0,
download: false,
},
});
我能够检测到点击的导出:
self.editor.on('export', (newUrl) => {
..但它仍会下载图像。如何禁用?
我也试过了:
self.editor.on('export', (newUrl) => {
self.editor.export(false)
.then((data) => {
const foo = 1;
});
...但是,当我执行第二行时,已经下载了一个图像。
答案 0 :(得分:0)
此处的export
字段必须位于editor
选项中,例如
self.editor = new $window.PhotoEditorSDK.UI.ReactUI({
container,
responsive: true,
license: JSON.stringify(sdkLicenseData),
assets: {
baseUrl: '/dist/photoeditorsdk/assets/',
},
editor: {
image: img,
export: {
type: $window.PhotoEditorSDK.ImageFormat.IMAGE,
quality: 1.0,
download: false,
}
},
style: {
width: 800,
height: 800,
},
enableExport: true
})
然后应该工作。