无法在4.3版中禁用自动下载

时间:2018-03-19 18:23:18

标签: photoeditorsdk

我的配置是:

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;
                                });

...但是,当我执行第二行时,已经下载了一个图像。

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
})

然后应该工作。