0

我的配置是:

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

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

4

1 回答 1

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

然后是应该工作。

于 2018-03-23T10:12:58.493 回答