如何从Toast-ui / vue-image-editor中的url加载图像?

时间:2019-06-24 10:21:10

标签: vue.js vuejs2

我需要在打开组件时加载图像。如何在组件打开之前加载图像?

我尝试了loadImageFromurl和loadImageFromFile,两者都不起作用? <tui-image-editor :options="options" cssMaxHeight={500} ref="tuiImageEditor"></tui-image-editor>

data() {
      return {
        useDefaultUI: true,
         options: {
            imageSize: {oldWidth: 300, oldHeight: 300, newWidth: 400, newHeight: 400},
            selectionStyle: {
              cornerSize: 20,
              rotatingPointOffset: 70
            },
            cssMaxWidth: 600,
            cssMaxHeight: 400,
            includeUI: {
              theme: blackTheme, // or whiteTheme
              uiSize: {
                width: '1000px',
                height: '100px'
              },
              imageSize: {oldWidth: 200, oldHeight: 200, newWidth: 200, newHeight: 200}
            }
          }
      };
    },
    methods: {
      addDefaultImage() {
        let url = "someImageurl";
        this.$refs.tuiImageEditor.invoke('loadImageFromURL', url, 'My 
         sample image').then((res) => { 
                          console.log(res);
                      });
      }
}

我希望在从网址打开组件之前加载图像。

0 个答案:

没有答案